Skip to content

Commit 01f7918

Browse files
committed
BLD: transition to pyproject.toml and setup.cfg
- rename THANKS.txt to AUTHORS.txt; so that it automatically gets included - remove MANIFEST.in/requirements{-dev}.txt; now all covered in setup.cfg - update installation documentation Fixes: lmfit#769
1 parent ba84969 commit 01f7918

File tree

11 files changed

+115
-106
lines changed

11 files changed

+115
-106
lines changed

.github/CONTRIBUTING.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ the Python coding style conventions (i.e., [PEP 8](https://www.python.org/dev/pe
66
closely. Additionally, we really want comprehensive docstrings that follow
77
[PEP 257](https://www.python.org/dev/peps/pep-0257/) using the
88
[numpydoc style](https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard),
9-
usable offline documentation, and good unit tests for the pytest framework. A
9+
usable offline documentation, and good unit tests for the ``pytest`` framework. A
1010
good contribution includes all of these. To ensure compliance with our coding
1111
style, we make use of the [pre-commit](https://pre-commit.com/) framework to run
1212
several *hooks* when committing code. Please follow the instructions below if
@@ -16,16 +16,16 @@ you intend to contribute to the lmfit repository:
1616
- clone your forked GitHub repository:
1717
``git clone https://github.com/<your-name>/lmfit-py.git``
1818
- install all (optional) dependencies either using ``pip`` or ``conda``:
19-
``pip install -U -r requirements-dev.txt`` or
20-
``conda install <packages in requirements-dev.txt>``
19+
``pip install lmfit[all]`` or
20+
``conda install <all packages listed in setup.cfg>``
2121
- initialize ``pre-commit`` by running ``pre-commit install`` in the lmfit directory
2222
- create a new branch: ``git checkout -b <awesome_new_feature>``
2323
- start coding
24-
- install the latest version of your code using one of the usual ``python setup.py`` commands (e.g., ``python setup.py install --user``)
24+
- install the latest version of your code using the PEP517/PEP518 way (``python -m build && pip install .``)
2525
- make sure the test-suite passes locally: run ``pytest`` in the lmfit directory
2626
- make sure the documentation builds locally: run ``make`` in the doc directory
2727
- push to your fork: ``git push origin``
28-
- open a Pull Request on https://github.com/lmfit/lmfit-py/pulls
28+
- open a Pull Request on [the lmfit GitHub repository](https://github.com/lmfit/lmfit-py/pulls)
2929

3030
If you need any additional help, please send a message to the
3131
[mailing list](https://groups.google.com/group/lmfit-py) or use the
@@ -55,7 +55,6 @@ inappropriate for the mailing list, but many questions are not Issues. We
5555
will try our best to engage in all discussions, but we may simply close
5656
GitHub Issues that are actually questions.
5757

58-
5958
## Providing an Example with GitHub Issues
6059

6160
If you are reporting a bug with GitHub Issues, we do expect a small, complete,
@@ -89,7 +88,6 @@ and are a good way to demonstrate a question or raise an issue. Please
8988
see the above about providing examples. The notebook you provide will be
9089
*read*, but will probably not be run.
9190

92-
9391
## Secret Code for First Time Issues
9492

9593
If you have not done so in the past, and are going to submit a GitHub Issue,

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ repos:
1414
- id: check-builtin-literals
1515
- id: check-case-conflict
1616
- id: check-merge-conflict
17+
- id: check-toml
1718
- id: debug-statements
1819
- id: end-of-file-fixer
1920
- id: mixed-line-ending
2021
- id: trailing-whitespace
21-
- id: requirements-txt-fixer
2222
- id: fix-encoding-pragma
2323
args: [--remove]
2424

THANKS.txt renamed to AUTHORS.txt

File renamed without changes.

MANIFEST.in

Lines changed: 0 additions & 14 deletions
This file was deleted.

doc/installation.rst

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Lmfit requires the following Python packages, with versions given:
4040
* `asteval`_ version 0.9.22 or higher.
4141
* `uncertainties`_ version 3.0.1 or higher.
4242

43-
All of these are readily available on PyPI, and should be installed
43+
All of these are readily available on PyPI, and are installed
4444
automatically if installing with ``pip install lmfit``.
4545

4646
In order to run the test suite, the `pytest`_, `pytest-cov`_, and `flaky`_
@@ -56,8 +56,14 @@ packages `sphinxcontrib-svg2pdfconverter`_ and `cairosvg`_ are also required,
5656
as well as the LaTex package `Latexmk`_ (which is included by default in some
5757
LaTex distributions).
5858

59-
Please refer to ``requirements-dev.txt`` for a list of all dependencies that
60-
are needed if you want to participate in the development of lmfit.
59+
Please refer to ``setup.cfg`` under ``options.extras_require`` for a list of all
60+
dependencies that are needed if you want to participate in the development of lmfit.
61+
You can install all these dependencies automatically by doing ``pip install lmfit[all]``,
62+
or select only a subset (e.g., ``dev```, ``doc``, or ``test``).
63+
64+
Please note: the "original" ``python setup.py install`` is deprecated, but we will
65+
provide a shim ``setup.py`` file for as long as ``Python`` and/or ``setuptools``
66+
allow the use of this legacy command.
6167

6268
Downloads
6369
~~~~~~~~~
@@ -88,7 +94,14 @@ To get the latest development version from the `lmfit GitHub repository`_, use::
8894

8995
and install using::
9096

91-
python setup.py install
97+
pip install --upgrade build pip setuptools wheel
98+
99+
to install the required build dependencies and then do::
100+
101+
python -m build
102+
pip install ".[all]'
103+
104+
to generate the wheel and install ``lmfit`` with all its dependencies.
92105

93106
We welcome all contributions to lmfit! If you cloned the repository for this
94107
purpose, please read `CONTRIBUTING.md`_ for more detailed instructions.
@@ -109,7 +122,7 @@ that `matplotlib`_ has been installed and is working correctly.
109122
Acknowledgements
110123
~~~~~~~~~~~~~~~~
111124

112-
.. literalinclude:: ../THANKS.txt
125+
.. literalinclude:: ../AUTHORS.txt
113126
:language: none
114127

115128

doc/whatsnew.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ Version 1.0.4 Release Notes (unreleased)
1818

1919
Bug fixes/enhancements:
2020

21-
- make sure variable ``spercent`` is always defined in ``params_html_table`` functions (Issue #768, PR #770)
21+
- make sure variable ``spercent`` is always defined in ``params_html_table`` functions (reported by @MySlientWind; Issue #768, PR #770)
22+
- always initialize the variables ``success`` and ``covar`` the ``MinimizerResult`` (reported by Marc W. Pound; PR #771)
23+
- build package following PEP517/PEP518; use pyproject.toml and setup.cfg; leave setup.py for now (PR #777)
2224

2325

2426
.. _whatsnew_103_label:

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[build-system]
2+
requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.setuptools_scm]
6+
write_to = "lmfit/version.py"
7+
version_scheme = "post-release"

requirements-dev.txt

Lines changed: 0 additions & 21 deletions
This file was deleted.

requirements.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

setup.cfg

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,81 @@
1+
[metadata]
2+
name = lmfit
3+
description = Least-Squares Minimization with Bounds and Constraints
4+
long_description = file: README.rst
5+
long_description_content_type = text/x-rst
6+
author = LMFit Development Team
7+
author_email = [email protected]
8+
url = https://lmfit.github.io//lmfit-py/
9+
license = BSD 3-Clause
10+
platforms = any
11+
classifiers =
12+
Development Status :: 5 - Production/Stable
13+
Intended Audience :: Science/Research
14+
Topic :: Scientific/Engineering
15+
License :: OSI Approved :: BSD License
16+
Operating System :: OS Independent
17+
Programming Language :: Python :: 3
18+
Programming Language :: Python :: 3 :: Only
19+
Programming Language :: Python :: 3.6
20+
Programming Language :: Python :: 3.7
21+
Programming Language :: Python :: 3.8
22+
Programming Language :: Python :: 3.9
23+
Programming Language :: Python :: 3.10
24+
Programming Language :: Python :: Implementation :: CPython
25+
Programming Language :: Python :: Implementation :: PyPy
26+
keywords = curve-fitting, least-squares minimization
27+
project_urls =
28+
Source = https://github.com/lmfit/lmfit-py
29+
Changelog = https://lmfit.github.io/lmfit-py/whatsnew.html
30+
Documentation = https://lmfit.github.io/lmfit-py/
31+
Tracker = https://github.com/lmfit/lmfit-py/issues
32+
33+
[options]
34+
packages = find:
35+
python_requires = >=3.6
36+
setup_requires = setuptools_scm
37+
install_requires =
38+
asteval>=0.9.22
39+
numpy>=1.18
40+
scipy>=1.4
41+
uncertainties>=3.0.1
42+
43+
[options.packages.find]
44+
include =
45+
lmfit
46+
47+
[options.extras_require]
48+
dev =
49+
build
50+
check-wheel-contents
51+
pre-commit
52+
twine
53+
doc =
54+
cairosvg
55+
corner
56+
dill
57+
emcee>=3.0.0
58+
jupyter_sphinx>=0.2.4
59+
matplotlib
60+
numdifftools
61+
pandas
62+
Pillow
63+
pycairo;platform_system=="Windows"
64+
Sphinx
65+
sphinx-gallery>=0.10
66+
sphinxcontrib-svg2pdfconverter
67+
sympy
68+
test =
69+
codecov
70+
coverage
71+
flaky
72+
pytest
73+
pytest-cov
74+
all =
75+
%(dev)s
76+
%(test)s
77+
%(doc)s
78+
179
[isort]
280
skip=lmfit/__init__.py,doc/conf.py
381
known_third_party=asteval,dill,emcee,IPython,matplotlib,numdifftools,numpy,NISTModels,pandas,pytest,scipy,uncertainties

0 commit comments

Comments
 (0)