summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* distutils-r1.eclass: make esetup.py require setup.{py,cfg}Michał Górny2022-02-011-0/+3
| | | | | | | | | Make esetup.py fail if neither setup.py nor setup.cfg is available. To support PEP 517 builds, the function has been modified to work without setup.py. However, this also caused esetup.py to implicitly succeed in installing zero files on non-distutils/setuptools packages. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Disable stale egg-info cleaning in PEP517 modeMichał Górny2022-02-011-1/+7
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Do not create ${BUILD_DIR}/lib in PEP 517 modeMichał Górny2022-01-291-8/+8
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Fix installing scripts w/ PEP517 & single-implMichał Górny2022-01-291-0/+3
| | | | | Closes: https://bugs.gentoo.org/832267 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* eclass: Update links to Gentoo Python GuideMichał Górny2022-01-291-1/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Support deprecated flit/poetry backendsMichał Górny2022-01-291-2/+23
| | | | | | | | | Detect, report and fix the deprecated flit/poetry backends to use flit_core and poetry_core respectively. In both cases, the end result is the same. Using flit involves unnecessary dependencies, and poetry is not even packaged right now (and has even worse dependency hell). Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Improve PEP 517 einfo outputMichał Górny2022-01-291-1/+2
| | | | | | | Add an einfo message for calling installer. Indent both messages relevant to PEP 517 logic. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Set script shebangs to venv in PEP 517Michał Górny2022-01-291-15/+24
| | | | | | | | | | | | | | | | | | | Alter the shebangs of generated scripts to point out the to venv Python executables in PEP 517 mode. Otherwise, the executables are run with system Python during the test run and therefore do not use the venv. For convenience, rather than modifying them back just copy them immediately into the python-exec directory. This means that instead of reverting some of our python_compile() changes in python_install() and then moving scripts to the python-exec directory, we can just discard /usr/bin and let the wrapping logic recreate it. While at it, stop repeating ${root}${EPREFIX}/usr/bin multiple times in python_compile(). Just shove it into a helper variable. Also move pyvenv.cfg inside bindir for convenience — Python is fine with either location. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Bump installer requirement and remove hackMichał Górny2022-01-241-8/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Link to installer +x fixMichał Górny2022-01-231-0/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Fix prefix pathsMichał Górny2022-01-231-14/+14
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Strip LICENSE* & COPYING* from PEP517 dist-infoMichał Górny2022-01-231-0/+5
| | | | | | | The .dist-info metadata installed by PEP517 packages contains a full copy of the license. Strip that following the Gentoo policy. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Also run nosetests via EPYTHONMichał Górny2022-01-211-1/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Mark installed scripts +x in PEP517 modeMichał Górny2022-01-191-0/+6
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Clean the build tree in PEP517 modeMichał Górny2022-01-181-0/+6
| | | | | | | | | | Ensure to call `esetup.py clean -a` after performing the wheel install in PEP517 mode. This is necessary since we no longer override build paths and setuptools performs the PyPy and CPython builds in the same directory. With its bad install/bdist logic, the CPython wheel ends up including PyPy3 extensions as well. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Implement PEP517 modeMichał Górny2022-01-161-90/+319
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a PEP517 mode to the distutils-r1.eclass in order to facilitate building packages via PEP517 backends. In order to use it, set DISTUTILS_USE_PEP517 to the appropriate build system name. The eclass will take care of setting BDEPEND, then invoke the backend to build a wheel and then install its contents in python_compile(). The install phase is limited to merging the staging area into the image directory. In PEP517 mode, the test phase is automatically provided with venv-style install tree that should suffice the vast majority of test suites. As a result, distutils_install_for_testing should no longer be necessary and is not available in this mode. The new mode can also be used to install pre-PEP517 distutils and setuptools packages. To do so, just specify setuptools backend. If pyproject.toml is missing, the eclass assumes legacy setuptools backend that invokes setup.py. It also enables setuptools-vendored distutils, effectively carrying the migration from deprecated stdlib version. The PEP517 support effectively deprecates the legacy eclass mode. This follows upstream deprecation of distutils and install commands in setuptools. Closes: https://github.com/gentoo/gentoo/pull/23750 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Fix manpage formattingMichał Górny2022-01-161-0/+4
| | | | | | Thanks to arthurzam for noticing. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Force stdlib distutils for the time beingMichał Górny2022-01-161-0/+4
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Minimize & unify dift --via-venv logicMichał Górny2022-01-161-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modify `distutils_install_for_testing --via-venv` to create a minimal venv manually rather than relying on Python to do so. Use root-style install rather than the egg-style to improve consistency with regular installs. This is a step towards unifying different install layouts used within the eclass. Right now we support three different variants for testing: 1. The build-dir layout that's created by python_compile() and exposed unconditionally through PYTHONPATH. 2. The --via-root layout of dift that resembles install closer (primarily through including package metadata) and also uses PYTHONPATH. 3. The --via-venv layout of dift that creates a venv and installs the packages there. It requires only PATH, not PYTHONPATH. The last layout is the newest and probably the most compatible but it requires additional install step. Since the PEP517 build logic is going to require installing a wheel anyway, the plan is to inject a minimal venv into the staging directory and use it unconditionally for tests. The purpose of this patch is to prepare a single code snippet that will be used both by dift and the new logic logic. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Bump minimal pytest depMichał Górny2022-01-091-2/+2
| | | | | | | | Bump the minimal pytest dep to what we have right now, since a growing number of packages requires new pytest version (>= 6.2.4 is the highest explicit dep we have) and there is really no point in repeating the dep. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: depend on >=dev-python/pyproject2setuppy-22Mike Gilbert2021-12-271-1/+1
| | | | | Closes: https://bugs.gentoo.org/830104 Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* distutils-r1.eclass: Update "predict" list for pypy3.8Michał Górny2021-11-091-2/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Skip pyproject.toml check if DUS=manualMichał Górny2021-11-041-0/+2
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: fix formattingArthur Zamarin2021-09-271-0/+4
| | | | | | | - mark _distutils-r1_check_all_phase_mismatch as @INTERNAL - fix list appearance for distutils_enable_tests options Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* distutils-r1.eclass: use _python_check_EPYTHONFlorian Schmaus2021-09-141-1/+7
| | | | | | | | Replace the existing EPYTHON check with _python_check_EPYTHON and use _python_check_EPYTHON in a few additional places. Signed-off-by: Florian Schmaus <flow@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/21610
* distutils-r1.eclass: Fix obsolete comment on DUSMichał Górny2021-09-091-1/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Set @PROVIDESMichał Górny2021-09-021-0/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Require pyproject2setuppy >= 18Michał Górny2021-08-121-1/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Check for _all phase mismatchMichał Górny2021-06-291-0/+16
| | | | | | | Check for the mistake of calling distutils-r1_python_*_all() from non-all python_*() subphase. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Use 'dosym -r' in EAPI 8Michał Górny2021-06-291-2/+4
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Eliminate path arg to ..._wrap_scriptsMichał Górny2021-06-291-13/+12
| | | | | | | Eliminate the path argument to _distutils-r1_wrap_scripts, and inline the use of ${D} instead. This should make the code less confusing. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Defer wrapping scripts until after root-mergeMichał Górny2021-06-291-1/+1
| | | | | | | | Defer wrapping installed Python scripts until the files are merged from impl-specific directory into ${ED}. This should clear the way into using 'dosym -r'. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: fix distutils_enable_tests (${PYTHON_MULTI_USEDEP} usage)Sam James2021-06-291-1/+1
| | | | | | | | We banned PYTHON_MULTI_USEDEP in EAPI 8, so this internal usage causes breakage when using distutils_enable_tests in an EAPI 8 ebuild. Reported-by: Marco Scardovi (scardracs) <marco@scardovi.com> Signed-off-by: Sam James <sam@gentoo.org>
* Revert "distutils-r1.eclass: Use 'dosym -r' in EAPI 8"Mike Gilbert2021-06-241-4/+2
| | | | | | | | | | | | | | | | This breaks installation of scripts when EPREFIX is non-empty. _distutils-r1_wrap_scripts should create a symlink like this: "${D}/_${EPYTHON}${EPREFIX}/usr/bin/myscript" The "dosym" version of this code creates the following instead: "${D}${EPREFIX}/_${EPYTHON}/usr/bin/myscript" Reverts: 9f831e240a9804a996fc80015f64d5e102ced740 Closes: https://bugs.gentoo.org/798456 Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* distutils-r1.eclass: Enable EAPI 8Michał Górny2021-06-231-2/+2
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Use 'dosym -r' in EAPI 8Michał Górny2021-06-231-2/+4
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>