summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* distutils-r1.eclass: Update license stripping for hatchMichał Górny2022-05-111-3/+6
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Introduce sipbuild backend supportMichał Górny2022-05-111-2/+51
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Move setup from src_configure to prepare_allMichał Górny2022-05-091-3/+3
| | | | | | | | | | Move a few minor setup calls from distutils-r1_src_configure() to distutils-r1_python_prepare_all(). Since we do not declare default configure sub-phases, it is easy to override src_configure() entirely and accidentally skip these steps. We already warn for missing distutils-r1_python_prepare_all() call, so let's move them there. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Print buildsys package versions to aid debugMichał Górny2022-05-091-0/+92
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Support DISTUTILS_ARGS in PEP517 modeMichał Górny2022-05-091-5/+27
| | | | | | Use gpep517 --config-json support to pass DISTUTILS_ARGS in PEP517 mode. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Utilize the new makeopts_jobs defaultMichał Górny2022-05-011-5/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Support pbr backendMichał Górny2022-05-011-0/+9
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Unleash dev-python/gpep517Michał Górny2022-04-251-70/+15
| | | | | | Switch the distutils-r1.eclass to gpep517 code branches unconditionally. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Limit dev-python/installer versionMichał Górny2022-04-251-0/+1
| | | | | | | | dev-python/installer has made incompatible changes in 0.5.1 that breaks the non-gpep517 code path. Add a version limit prior to bumping, in case we end up reverting gpep517 changes. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: support maturin backendIonen Wolkens2022-04-251-0/+17
| | | | | Signed-off-by: Ionen Wolkens <ionen@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: use case for system-specific build quirksIonen Wolkens2022-04-251-36/+39
| | | | | | | With only indentation changes. Signed-off-by: Ionen Wolkens <ionen@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Account for func args when counting makejobsMichał Górny2022-04-251-1/+1
| | | | | | | | Account for distutils-r1_python_compile arguments when counting makejobs. This is needed to correctly detect forced "-j1", e.g. in dev-python/pandas. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Run build_ext only with --jobs -gt 1Michał Górny2022-04-251-1/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Run build_ext only if there are 2+ filesMichał Górny2022-04-251-4/+8
| | | | | | | | Run parallel build_ext only if there are at least two potential source files to compile. This call is expensive and parallel builds do not benefit us if there is only one file to compile. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: "build" dir warn makes sense for pep517 onlyMichał Górny2022-04-211-1/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Support flit_scm backendMichał Górny2022-04-211-0/+9
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: don't call copy_egg_info if USE_PEP517=setuptoolsSam James2022-04-111-1/+1
| | | | | | Fixes: 6451cf647f04b31a56ea2dc8c3f84a70c2468f87 Thanks-to: Ionen Wolkens <ionen@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org>
* distutils-r1.eclass: Bump min. dependency versionsMichał Górny2022-04-111-9/+11
| | | | | | | | | Bump min. dependency versions to match oldest stable in ::gentoo, in order to avoid requiring developers to repeat them in BDEPEND with higher version. Closes: https://github.com/gentoo/gentoo/pull/24965 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Print deprecation warning for distutils buildsMichał Górny2022-04-111-0/+9
| | | | | | | | | | Print deprecation warnings for non-PEP517 builds using plain distutils. This is a small subset of Python packages overall, and the first step towards deprecating legacy build support. Transitioning pure distutils packages is also important to avoid .egg-info collisions when we switch from CPython distutils to setuptools-vendored distutils. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Introduce distutils_write_namespaceMichał Górny2022-04-111-0/+41
| | | | | | | | Introduce a distutils_write_namespace helper that can be used to temporarily write a namespace __init__.py as needed to run tests when legacy dev-python/namespace-* packages are installed. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Skip build_ext when there no .c/.pyx filesMichał Górny2022-04-111-1/+11
| | | | | | | | | Skip issuing build_ext when there appears to be no .c/.pyx files. Since starting setuptools is expensive, this gives a major speedup to building pure Python packages. If the check misfires, the worst that can happen is that C extensions will be built serialized. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Call build_ext instead of build in PEP517 modeMichał Górny2022-04-111-1/+5
| | | | | | | | | | | | | | Call `setup.py build_ext` instead of the wholesale `build` in PEP517 mode. After all, the call is not strictly necessary; it is only done in order to build C extensions in parallel (PEP517 backend does not support specifying job count). By skipping the other tasks build command does (and then repeats via PEP517 call), the ebuild can build a few seconds faster. Since this is a potentially breaking change (but very unlikely to actually break anything), let's test it behind GPEP517_TESTING. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Update namespace package doc URLMichał Górny2022-04-111-1/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Issue a QA warning if "build" existsMichał Górny2022-04-111-1/+7
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Prefer "rm -rf build" over "setup.py clean -a"Michał Górny2022-04-111-1/+5
| | | | | | | | | | | | | | | | | | Prefer using "rm -rf build" directly over "setup.py clean -a". This has three advantages: 1. It is much faster. 2. It works on packages that have broken "setup.py clean", e.g. dev-python/pydantic. 3. It works on packages that block "setup.py clean" and tell you to use "git clean" (sic!), e.g. dev-python/scipy. This is a potentially (but unlikely) breaking change, so do it conditionally to GPEP517_TESTING. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Remove extra deps from jupyter backendMichał Górny2022-04-081-4/+2
| | | | | | | | dev-python/jupyter_packaging depends on these directly, and packages using it don't list these deps in their requires, so I guess it doesn't make sense for us to copy them. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Recognize jupyter PEP517 backendMichał Górny2022-04-081-0/+11
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Fix PEP517 + single-impl w/ no scriptsMichał Górny2022-04-081-1/+4
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Support GPEP517_TESTING modeMichał Górny2022-04-071-31/+57
| | | | | | | | | Support GPEP517_TESTING variable to enable using dev-python/gpep517 instead of inline Python snippets. This is meant to provide the necessary testing before we stabilize it and switch over. Closes: https://github.com/gentoo/gentoo/pull/24910 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Add hatchling support (meh!)Michał Górny2022-04-071-0/+9
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Revert "Support backend-path in pyproject.toml"Michał Górny2022-04-021-8/+1
| | | | | | | | | | This does not handle packages without pyproject.toml correctly. Reverts: c8b8dc11f7235ad4f7b05f24bd75a85c110ec400 Closes: https://bugs.gentoo.org/836660 Closes: https://bugs.gentoo.org/836661 Closes: https://bugs.gentoo.org/836662 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Support backend-path in pyproject.tomlMichał Górny2022-04-021-1/+8
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* *.eclass: @ECLASS-VARIABLE renamed to @ECLASS_VARIABLEUlrich Müller2022-03-241-11/+11
| | | | | Bug: https://bugs.gentoo.org/835396 Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* distutils-r1.eclass: Do not filter error output from backend getterMichał Górny2022-02-251-2/+3
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Make build-backend getting more reliableMichał Górny2022-02-251-2/+4
| | | | | | Protect build-backend getter against stray output to stdout. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Update the desc for PEP517 modeMichał Górny2022-02-251-5/+10
| | | | | | | Do not call PEP517 mode "experimental" anymore, and instead describe the potential problem with it. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Use python_has_version in ...enable_sphinxMichał Górny2022-02-151-3/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Require explicit root for d_pep517_installMichał Górny2022-02-151-4/+4
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Add min version to tomli depMichał Górny2022-02-091-1/+1
| | | | | Closes: https://bugs.gentoo.org/832782 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Support matching impls by stdlib versionMichał Górny2022-02-091-3/+2
| | | | | | | | | | | | | | Update _python_impl_matches() (used to implement python_gen*, python_setup) to support specifying stdlib versions ("3.8", "3.9") in addition to exact implementation names. This makes handling PyPy3 version changes much easier when dealing with backports. For example, if you specify "3.8", then the spec will match python3_8 and pypy3, for as long as we supply PyPy3.8. Once we upgrade to PyPy3.9 completely, it will stop matching pypy3 and we won't have to manually keep updating these deps. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Use heredoc instead of "python -c"Michał Górny2022-02-091-10/+22
| | | | | | | Use heredocs instead of inlining longish scripts in "python -c", for greater readability. Thanks to arthurzam for the suggestion. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Remove python_is_python3Michał Górny2022-02-091-5/+3
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Fix has_version for distutils_enable_sphinxMichał Górny2022-02-091-1/+5
| | | | | | | Fix the has_version calls for distutils_enable_sphinx to use -b option (--host-root in earlier EAPIs). Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Create distutils_pep517_install helperMichał Górny2022-02-091-29/+48
| | | | | | Split the wheel build & install logic into a a new helper. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Get wheel name from the backendMichał Górny2022-02-091-9/+5
| | | | | | | Use the wheel name returned by build_wheel() rather than trying to guess it from WHEEL_DIR. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Split backend getting code into a functionMichał Górny2022-02-091-47/+63
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Restore QA warning for DUS + DISTUTILS_OPTIONALMichał Górny2022-02-011-0/+5
| | | | | | | Restore the QA warning (proviously issued as part of install-qa-check.d) for combining DISTUTILS_USE_SETUPTOOLS and DISTUTILS_OPTIONAL. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Add DISTUTILS_DEPS output var for PEP 517 modeMichał Górny2022-02-011-1/+33
| | | | | | | | | | The PEP 517 build-time deps have gotten more complex, and largely depend on the internal eclass logic used to build and install wheels. Introduce a DISTUTILS_DEPS output variable that contains the correct BDEPEND string for use in DISTUTILS_OPTIONAL=1 ebuilds. Bug: https://bugs.gentoo.org/832337 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Move DISTUTILS_OPTIONAL check into set_globalsMichał Górny2022-02-011-7/+9
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Fix subphase return value passthroughMichał Górny2022-02-011-15/+33
| | | | | | | | | | | | | | | | | | | | | | | | Fix distutils-r1 phase functions to correctly pass through the return value from the subphases. This fixes e.g. the mistake of virtx not failing in the following case: src_test() { virtx distutils-r1_src_test } python_test() { epytest } This is because virtx implicitly uses nonfatal and epytest uses `die -n`. However, since the return value was not passed through, virtx never knew that anything has failed. While this covers only trivial cases and this is better solved via dying explicitly in the redefined python_test(), there's no harm in adding this passthrough. Signed-off-by: Michał Górny <mgorny@gentoo.org>