summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* distutils-r1.eclass: Add pytest-xdist dep if EPYTEST_XDIST is setMichał Górny2023-11-071-0/+3
| | | | | | | Make `distutils_enable_tests pytest` automatically add the `dev-python/pytest-xdist` dependency if `EPYTEST_XDIST` is set. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Refactor d_e_t to permit multiple test packagesMichał Górny2023-11-071-6/+6
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Refactor `d_e_t unittest` (NFC)Michał Górny2023-11-071-9/+8
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Make use of gpep517's new build-wheel --prefix argJames Le Cuirot2023-10-091-1/+2
| | | | | | This fixes cross-prefix installations. Signed-off-by: James Le Cuirot <chewi@gentoo.org>
* distutils-r1.eclass: teach setuptools to respect (some) build optionsEli Schwartz2023-09-141-38/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, setup.py was handled by: - manually passing makejobs, with a heuristic to guess whether it was a time saver to do so. - rm -rf'ing the build directory in between python versions to prevent cross-version contamination This is because in PEP 517 mode, it doesn't accept build options specific to a setuptools phase. So a crude hack is to just build_ext twice, once explicitly and once internally as part of bdist_wheel, and pray that in the latter case it detects that there's nothing to do. Unfortunately, sometimes build_ext does NOT detect that there is nothing to do -- e.g. for codegen tools such as mypyc, that produce *.c files which are different every time you try building. As for build directories, those were given up on as hopeless. There's a better hack which is to set a magic environment variable for a setup.cfg file which is parsed additionally to the one provided by the project. It can contain additional settings, such as the build-base and parallelism, which means that bdist_wheel intrinsically builds extensions in parallel the only time it is called. And we can set the output directory for all build artifacts to outside of the source tree, so it is no longer necessary to delete them (which among other things, makes debugging difficult). This is similar to .pydistutils.cfg, but is processed later and can be in arbitrary locations. Since we store it in the per-impl build directory we don't need to wipe it after using it to avoid leakage. Signed-off-by: Eli Schwartz <eschwartz93@gmail.com> Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: append scikit-build-core to documentation.Benda Xu2023-08-191-0/+2
| | | | | | | | To complete 5b29e5b1a393c21db9974de5c2d01e6dc482d4b9. Signed-off-by: Benda Xu <heroxbd@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/32354 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: wheel dep moved into setuptoolsMichał Górny2023-07-171-3/+2
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Disable LTO when using cargo.eclassMichał Górny2023-07-171-0/+7
| | | | | | | | | Strip LTO flags when cargo.eclass is inherited. This means that Rust extensions are being built, and linking them with C/C++ style LTO results in broken shared libraries. Closes: https://bugs.gentoo.org/910220 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Update addpredict for PyPy3.10Michał Górny2023-07-171-1/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Remove --reflink=auto from calls to cpViolet Purcell2023-07-171-1/+1
| | | | | | | | --reflink=auto has become the default behaviour in coreutils 9, and it is not compatible with BSD userland. Signed-off-by: Violet Purcell <vimproved@inventati.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Include setuptools-rust version in outputMichał Górny2023-07-021-0/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Add scikit-build-core backendMichał Górny2023-07-021-0/+13
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Bump minimum dep versionsMichał Górny2023-07-021-5/+5
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: drop dead prefix targetsSam James2023-06-031-2/+0
| | | | | Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Add support for pdm-backendMichał Górny2023-06-031-0/+16
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Remove support for old meson-pythonMichał Górny2023-06-031-36/+15
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Remove support for old maturinMichał Górny2023-06-031-29/+15
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Do not force stdlib distutils on py3.12+Michał Górny2023-06-031-3/+5
| | | | | | | | Do not force SETUPTOOLS_USE_DISTUTILS=stdlib on Python 3.12+ (in non-PEP517 mode), as stdlib no longer supplies distutils there. Thanks to Sam for the report! Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Bump min dep versionsArthur Zamarin2023-05-291-9/+9
| | | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Include dev-python/cython version in logMichał Górny2023-05-291-0/+5
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Use CYTHON_FORCE_REGEN=1Michał Górny2023-05-291-0/+4
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Use config_settings with maturinIonen Wolkens2023-05-231-7/+29
| | | | | | | | | | | | | Replaces the deprecated MATURIN_PEP517_ARGS and will also allow ebuilds to enable/disable cargo --features through DISTUTILS_ARGS like the rest should the need arise. Support was technically added in 0.15.3, but 1.0.0 allows passing an array rather than only a to-be-shlex.split string. Signed-off-by: Ionen Wolkens <ionen@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/31143 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Use unittest-or-fail on Python < 3.12 onlyMichał Górny2023-05-231-1/+8
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* Rename dev-python/{jupyter_packaging → jupyter-packaging}Michał Górny2023-05-201-2/+2
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Fix sed mistakeMichał Górny2023-05-151-2/+2
| | | | | | Closes: https://bugs.gentoo.org/906385 Closes: https://bugs.gentoo.org/906376 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* Rename dev-python/{flit_core → flit-core}Michał Górny2023-05-151-6/+6
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Add IUSE=debug w/ DISTUTILS_EXT+_OPTIONALMichał Górny2023-05-051-1/+4
| | | | | | | Fix DISTUTILS_EXT to add IUSE=debug even if DISTUTILS_OPTIONAL is used. This was the intended behavior, as documented in the Python Guide. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: ensure meson-python uses a stable build directoryEli Schwartz2023-05-021-0/+3
| | | | | | | | | | | | | | When not passing an explicit build directory, meson-python configures meson into a build directory that is rooted in a tempdir with a random suffix. This results in unstable paths, which currently disappear after meson-python completes (either with success or failure). It doesn't handle incremental or resumed builds, and it's very difficult to debug -- for example by inspecting the logfile that meson itself prints out when the configure stage fails. Bug: https://bugs.gentoo.org/905396 Signed-off-by: Eli Schwartz <eschwartz93@gmail.com> Signed-off-by: Sam James <sam@gentoo.org>
* distutils-r1.eclass: Fix support for >=meson-python-0.13.0Michał Górny2023-04-241-17/+34
| | | | | Closes: https://bugs.gentoo.org/904677 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Detect missing DISTUTILS_EXTMichał Górny2023-04-221-0/+10
| | | | | | | | | Detect when Python packages install extensions and warn about missing DISTUTILS_EXT appropriately. Signed-off-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/30650 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Issue build_ext only w/ DISTUTILS_EXTMichał Górny2023-04-221-6/+11
| | | | | | | | Issue the explicit `build_ext` command call only if `DISTUTILS_EXT` is set. This should avoid a few false positives where the command was called due to irrelevant .c files being present in the source tree. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Support IUSE=debug for DISTUTILS_EXTMichał Górny2023-04-221-0/+7
| | | | | | | Add IUSE=debug when DISTUTILS_EXT is set, and use it to control assertions via appending -DNDEBUG or -UNDEBUG to CPPFLAGS. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Add PYTHON_DEPS to DEPEND when DISTUTILS_EXTMichał Górny2023-04-221-0/+9
| | | | | | | | | | | Add `${PYTHON_DEPS}` to `DEPEND` (i.e. `SYSROOT` dependencies) when building extensions. This is necessary to support cross-compilations correctly. Originally proposed by Raul E Rangel <rrangel@chromium.org>. Closes: https://github.com/gentoo/gentoo/pull/30469 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Add DISTUTILS_EXT control variableMichał Górny2023-04-221-0/+7
| | | | | | | Add a control variable that should be set in ebuilds that build C, Cython, Rust extensions, etc. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Remove < dep on dev-python/setuptoolsMichał Górny2023-04-051-7/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: fix spellingSam James2023-03-261-1/+1
| | | | | | | Thanks to codespell. Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* eclass: standardize prologue/epilogueDavid Seifert2023-03-171-12/+8
| | | | | Closes: https://github.com/gentoo/gentoo/pull/30061 Signed-off-by: David Seifert <soap@gentoo.org>
* Rename dev-python/{setuptools_scm → setuptools-scm}Michał Górny2023-03-031-3/+3
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Strip pkg_resources namespaces automaticallyMichał Górny2023-02-251-0/+32
| | | | | Closes: https://github.com/gentoo/gentoo/pull/29701 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Use --build-option instead of --global-optionMichał Górny2023-02-251-1/+1
| | | | | | | | | | Replace the `--global-option` used to pass custom setup.py arguments with `--build-option`. Using the former to pass arbitrary options is deprecated since setuptools 64.0.0. They are both equivalent right now and `--build-option` will preserve the current behavior, so this should be NFC (except for silencing the warning). Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: fix typo in setuptools versionSam James2023-02-091-1/+1
| | | | | Fixes: 50546c3db84904399e5624eb8f163e3d2be284e3 Signed-off-by: Sam James <sam@gentoo.org>
* distutils-r1.eclass: adjust setuptools dep to avoid known-bad versionsSam James2023-02-091-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | 79071eb9f6f4a5725c1a89700bcfd7f120101179 tried to mitigate this but blockers don't affect dependency resolution (ordering), so let's add a || ( <dev-python/setuptools-... >=dev-python/setuptools-...) dep in the eclass to ensure that the bad in-between versions (which were in ~arch, not stable, for a period, and are no longer in tree) aren't considered good enough to install any distutils-r1 PEP517 packages. We can clean this up once newer setuptools is stable & then simplify (and tighten) the dep. (Worth keeping in mind that Portage (rightly) doesn't aggressively update things listed in RDEPEND in that order simply because they're in RDEPEND. It might update something listed in RDEPEND after the package listing it provided there's no >= or otherwise dep.) Bug: https://bugs.gentoo.org/892529 Bug: https://bugs.gentoo.org/892525 Bug: https://bugs.gentoo.org/893538 Bug: https://bugs.gentoo.org/893632 Bug: https://bugs.gentoo.org/893630 Bug: https://bugs.gentoo.org/893634 Signed-off-by: Sam James <sam@gentoo.org>
* distutils-r1.eclass: Remove code for gpep517 < 12Michał Górny2023-02-071-6/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Bump minimum pytest versionMichał Górny2023-02-071-1/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Bump minimal build system versionsMichał Górny2023-02-071-10/+10
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: esetup.py, omit setup.cfg check in PEP517 modeMichał Górny2023-02-071-1/+7
| | | | | | Closes: https://bugs.gentoo.org/891959 Closes: https://github.com/gentoo/gentoo/pull/29354 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Strip licenses directory (hatchling)Michał Górny2023-02-071-0/+2
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Update link to deprecated PEP517 backend docMichał Górny2023-02-071-1/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Report stray top-level files in site-packagesMichał Górny2023-02-071-4/+26
| | | | | | | | | | | In addition to checking for known-bad package names, detect stray files installed into top-level site-packages directory. This is primarily meant to cover the common mistake in using `include` in Poetry-built packages. Closes: https://bugs.gentoo.org/893172 Closes: https://github.com/gentoo/gentoo/pull/29425 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: support nonfatal in testAlexey Sokolov2023-01-071-2/+2
| | | | | | | | | | | | | | Rationale: src_test() { virtx distutils-r1_src_test } If the test fails with "die", Xvfb keeps running forever; but it's cleaned up correctly with die -n Signed-off-by: Alexey Sokolov <alexey+gentoo@asokolov.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>