silx
silx copied to clipboard
Build: Simplified `setup.py`
Merge PR #3649 first!
This PR cleans-up/removes features from setup.py since:
running python setup.py directly as a script is considered deprecated. This also means that users should avoid running commands directly via python setup.py <command>.
https://setuptools.pypa.io/en/latest/deprecated/commands.html
We can look at packages such as invoke for this.
This PR:
-
Removes
setup.pycommands:- Remove
python setup.py test(https://github.com/silx-kit/silx/commit/84b3d7047ccb74f1a7bca1e62258a63209181695): There isrun_test.pyfor it. - Remove
python setup.py build_doc&cie and document how to call sphinx directly (https://github.com/silx-kit/silx/commit/ea1d920da1964075886c75c1b5e0419872a39f7b): Sphinx setuptools integration is deprecated. - Remove
python setup.py cleanoverride (https://github.com/silx-kit/silx/commit/c9db62e9f2ff09d1fbdd4fd6bdf512b83caeb9da): There is no equivalent for that, but it allows to get rid of the lastdistutilsimport.
- Remove
-
Prepares for not calling
setup.py builddirectly:- Deprecate
python setup.py buildarguments (--no-openmp,--openmp,--force-cython) and document the env. var. that provides the same feature (https://github.com/silx-kit/silx/commit/e5ee93adcf04f369cf523df507db4bac3262cfda and https://github.com/silx-kit/silx/commit/d080eafc1a7b1b7b42fc471b7f88a561b6297a04). I renamed the env. var. with aSILX_prefix while at it. - Rework and document
SPECFILE_USE_GNU_SOURCE(https://github.com/silx-kit/silx/commit/ba22270b8ccb596ae9869ec54d969cf2b5897c1e). - Document
SILX_FULL_INSTALL_REQUIRESandSILX_INSTALL_REQUIRES_STRIPenv. var. (https://github.com/silx-kit/silx/commit/6ae33008c7bbe348757e7e7d819e09170eea8dd6)
- Deprecate
-
Misc:
- Fixed documentation by de duplicating the doc of
silx.io.commonh5.Group(https://github.com/silx-kit/silx/commit/75324d254156b2965e8913d62766951abc52c96a) - Simplify setup kwargs (https://github.com/silx-kit/silx/commit/c02fec2558ffd6352ed244a64cebdf2cd3d0f711)
- Fixed documentation by de duplicating the doc of
With this PR, setup.py no longer rely on distutils.
2 setup.py commands remains (build_man and debian_src) which are related to Linux packaging.
closes #3574
Release CI passes with this PR: https://gitlab.esrf.fr/silx/bob/silx/-/pipelines/85576
Rebased to master, ready for review
I dont like much env var for build. Is that a real problem to support such options?
What is the aim?
Else, i am fine with it anyway.
I dont like much env var for build. Is that a real problem to support such options?
Neither do I... but "running python setup.py directly as a script is considered deprecated.", and passing options through pip's --global-option is more complex than using env. var. and anyway not self documented.
What is the aim?
Be future-proof