summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* python-utils-r1.eclass: epytest, error out on missing async pluginMichał Górny2024-04-011-0/+3
| | | | | | | | | | | | | Explicitly error out if epytest is run without an appropriate async plugin, and the test suite contains async tests. Currently, these tests are skipped with a warning but that is usually a mistake, and one can easily miss it when pytest-asyncio or a similar plugin is installed on the test system. However, a missing dependency can result in the tests being skipped afterwards on the tinderbox. Signed-off-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/35913 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Fix python_doheader install location with ROOTJames Le Cuirot2024-03-081-1/+1
| | | | | | | | | | python_get_includedir is prefixed with ESYSROOT, not EPREFIX, so we need to strip off the former, not the latter. This is currently only used for dev-python/pillow, which I have tested. Signed-off-by: James Le Cuirot <chewi@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass, distutils-r1.eclass: Add EPYTEST_TIMEOUTMichał Górny2024-01-051-0/+22
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Minimize pytest tempdir retentionMichał Górny2024-01-051-1/+6
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: fix EclassReservedName (drop obsolete ${EBUILD} old ↵Sam James2023-12-141-11/+0
| | | | | | | | | | compat check) We introduced this in ddd9cd63e860ce71ad5f92e80a3e6e4be901af8a but it's UB to use ${EBUILD} and pkgcheck nowadays has OldPythonCompat for this. Bug: https://github.com/pkgcore/pkgcheck/issues/591 Signed-off-by: Sam James <sam@gentoo.org>
* python-utils-r1.eclass: Disable pytest-salt-factories by defaultMichał Górny2023-12-141-0/+2
| | | | | Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org>
* python-utils-r1.eclass: epytest, use NO_COLOR rather than NOCOLORMichał Górny2023-12-141-9/+2
| | | | | | | | | | Update epytest to respect the modern NO_COLOR variable rather than Portage's old NOCOLOR. Adjust it to correctly check whether it is set at all rather than to a specific value, to match the behavior of pytest itself. Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org>
* python-utils-r1.eclass: Do not pass `-p no:*` w/ no autoloadingMichał Górny2023-11-191-23/+28
| | | | | | | | Modify `epytest` not to pass our plethora of `-p no:*` arguments when `PYTEST_DISABLE_PLUGIN_AUTOLOAD` is set. This is NFC since the plugins wouldn't be loaded anyway. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Do not pass `-p xdist` w/ PYTEST_PLUGINSMichał Górny2023-11-191-3/+7
| | | | | | | | Fix `epytest` with `EPYTEST_XDIST` not to pass a duplicate `-p xdist` when `xdist.plugin` is already present in `PYTEST_PLUGINS`. Otherwise, pytest will fail due to the plugin being loaded twice. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Add pytest-xdist dep if EPYTEST_XDIST is setMichał Górny2023-11-071-1/+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>
* python-utils-r1.eclass: Add EPYTEST_XDIST for epytestMichał Górny2023-11-071-0/+29
| | | | | | | | | Add an `EPYTEST_XDIST` variable that can be used to enable running the test suite in parallel via the dev-python/pytest-xdist plugin. This also includes user-facing `EPYTEST_JOBS` to control the job count independently of `MAKEOPTS`. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Disable pytest-describe by defaultMichał Górny2023-10-221-0/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Disable pytest-plus by defaultMichał Górny2023-10-221-1/+2
| | | | | | | Disable the intrusive dev-python/pytest-plus plugin by default as it is breaking random test suites. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: unconditionally warn on occluded packages in cwdEli Schwartz2023-09-141-4/+0
| | | | | | | | | | | If the current directory masks packages that would be installed and contains different contents, it can cause testing issues that otherwise go unnoticed. This warning can stop being experimental and opt-in Suggested-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Eli Schwartz <eschwartz93@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/32729 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Redo cross-prefix support using sysconfigJames Le Cuirot2023-09-121-8/+6
| | | | | | | | We recently supported cross-prefix by rewriting PYTHON_SITEDIR and PYTHON_INCLUDEDIR from BROOT to EPREFIX. We now know that you can get sysconfig to use EPREFIX in the first place, which is cleaner. Signed-off-by: James Le Cuirot <chewi@gentoo.org>
* python-utils-r1.eclass: Fix PYTHON_SITEDIR/INCLUDEDIR for cross-prefixJames Le Cuirot2023-08-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | We dynamically determine Python's SITEDIR and INCLUDEDIR using the build host's Python. This breaks down when the build host's prefix differs from the target host's prefix, so chop off the former and prepend the latter. This assumes that each Python implementation is always installed using the same scheme. Meson already makes this assumption, and gpep517 makes a similar assumption to determine Python's stdlib location. We could improve on this and determine these locations using SYSROOT's sysconfigdata file, like gpep517 does, but this seems needlessly complex. We would need to take this approach for PYTHON_LIBPATH and PYTHON_CONFIG, but these are only used by handful of packages. ${BROOT-${EPREFIX}} is needed rather than plain ${BROOT} for the same reason we need it for PYTHON, namely that Portage <3.0.50 was buggy. Signed-off-by: James Le Cuirot <chewi@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Eliminate false positives from occluded checkMichał Górny2023-08-081-9/+20
| | | | | | | | | | | | | | Modify the occluded package check to unidirectionally check for additional files in installed package directory. This eliminates false positives when the source directory contains additional files, in particular C sources. This change also eliminates the dependency on diff(1), in favor of comm(1). As a side effect, we no longer compare .py files for equality but that shouldn't be such a big deal. Closes: https://github.com/gentoo/gentoo/pull/32195 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* Revert "python-utils-r1.eclass: Remove old EAPI hack for exporting PYTHON"James Le Cuirot2023-08-071-1/+3
| | | | | | | | | | | | | This reverts commit 9e4dc068a3066434bfbfa3a0f979ec5d6d8020eb. It fixed cross-prefix but inadvertently broke regular prefix. Both were ultimately affected by the same PMS + Portage bug where BROOT was not set in pkg_preinst. This has now been fixed, but regular prefix users need to be able to update Portage without hitting the issue. Cross-prefix users are safe because the BROOT Portage can be updated without hitting the issue. Closes: https://bugs.gentoo.org/911797 Signed-off-by: James Le Cuirot <chewi@gentoo.org>
* python-utils-r1.eclass: Check for occluded packages before testingMichał Górny2023-08-061-0/+51
| | | | | | | | | | Add a check for installed packages being occluded by the working directory when calling epytest and eunittest. This is primarily meant to detect C extensions being missed. Signed-off-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/32181 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Fix shebangs using ${EPYTHON}, not ${PYTHON}James Le Cuirot2023-08-021-3/+1
| | | | | | | | | ${PYTHON} points to BROOT's Python because it's usually used for calling Python during the build. This value will be wrong at runtime after building cross-prefix. Signed-off-by: James Le Cuirot <chewi@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org>
* python-utils-r1.eclass: Remove old EAPI hack for exporting PYTHONJames Le Cuirot2023-08-021-1/+1
| | | | | | | | | This eclass is EAPI 7+ now, so we can assume that BROOT is available. This was broken anyway because it seems that Portage doesn't set BROOT when it's empty. Signed-off-by: James Le Cuirot <chewi@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org>
* python-utils-r1.eclass: Loosen minimal Python versionsMichał Górny2023-07-171-7/+5
| | | | | | | | | | | | | | | | | | Loosen minimal Python versions to accept any version in a given slot. Lower bounds are cumbersome to maintain and cause problems when upgrading outdated systems, particularly when sys-libs/glibc is involved. We could technically apply some hack to make any-r1 dependency checks to conditionally ignore minimal versions but that sounds like unnecessary complexity. In the end, minimum versions were primarily enforced to make sure users got the latest bugfixes but that doesn't seem strictly necessary. Closes: https://bugs.gentoo.org/910288 Signed-off-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/31796 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: pypy3 is now 3.10-onlyMichał Górny2023-07-171-3/+2
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Require >=dev-python/pypy3-7.3.12Michał Górny2023-07-171-1/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Bump minimum dev-lang/python versionsMichał Górny2023-07-021-3/+3
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: make pypy3 match Python 3.10 nowMichał Górny2023-07-021-3/+3
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Use @a instead of declare check for arrayMichał Górny2023-06-171-4/+11
| | | | | | | | | | | | | | | | | | | Use bash 5's @a variable substitution instead of `declare -p` check to determine if `PYTHON_COMPAT` is an array. This avoids a subshell, and effectively makes the function roughly 3.5x faster: ``` * Timing _python_set_impls real 4854 it/s user 4862 it/s ``` In practice, this roughly reduces total sourcing time for `dev-python/*` from 57-58 s to 54 s. Signed-off-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/31454 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Bump min dep versionsArthur Zamarin2023-05-291-3/+3
| | | | | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/31180 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: use std test runner in eunittest in 3.12+Michał Górny2023-05-231-1/+6
| | | | | | | | Starting with Python 3.12, the standard unittest runner exits unsucessfully if no tests are found. Therefore, we no longer need to use unittest_or_fail. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Add python3_12 targetMichał Górny2023-05-231-4/+6
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Disable python3_9Michał Górny2023-05-011-5/+3
| | | | | Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org>
* python-utils-r1.eclass: Bump minimal Python versionsMichał Górny2023-02-071-4/+4
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Use BROOT rather than EPREFIX for PYTHON varJames Le Cuirot2023-01-281-1/+1
| | | | | | | | | | The PYTHON variable is used for the wrapper shebangs. These should point to the build system rather than the host system. The variable is also used in other contexts, but the build system is still likely to be most appropriate. If this does break anything, it'll only be for prefixed systems. Signed-off-by: James Le Cuirot <chewi@gentoo.org>
* python-utils-r1.eclass: remove py3.8David Seifert2023-01-141-6/+4
| | | | Signed-off-by: David Seifert <soap@gentoo.org>
* python-utils-r1.eclass: restore support for jython2_7 in python_optimizeFlorian Schmaus2023-01-101-2/+2
| | | | | | | | | | | The eclass was modified to drop support for Python 2.7, however as unintended side effect, support for Jython 2.7 was also removed in python_optimize(). Fixes: 3b11f851df5e ("python-utils-r1.eclass: Clean up post disabling python2_7 compat") Closes: https://bugs.gentoo.org/885971 Closes: https://github.com/gentoo/gentoo/pull/29038 Signed-off-by: Florian Schmaus <flow@gentoo.org>
* python-utils-r1.eclass: drop EAPI 6 supportDavid Seifert2022-12-271-31/+14
| | | | Signed-off-by: David Seifert <soap@gentoo.org>
* python-utils.eclass: Bump minimal Python versionsMichał Górny2022-12-141-7/+5
| | | | | | | Bump minimal Python versions after the last security stabilizations, plus PyPy3 sysconfig bugfix. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Update python_optimize for PyPy3.9Michał Górny2022-12-141-2/+3
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Clean up post disabling python2_7 compatMichał Górny2022-12-141-46/+19
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Disable tavern plugin in epytestMichał Górny2022-11-261-0/+2
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Bump min Python versionsMichał Górny2022-11-261-7/+7
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Pass "-p no:xvfb" in epytestMichał Górny2022-09-071-0/+5
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Sterilize pytest-sugar pluginMichał Górny2022-08-021-0/+3
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python*-r1.eclass: Add missing inherit for eqawarnUlrich Müller2022-07-241-0/+1
| | | | Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* python-utils-r1.eclass: bump minimum 3.11 dep to 3.11.0_beta4Ionen Wolkens2022-07-121-1/+1
| | | | | | | As requested. Closes: https://github.com/gentoo/gentoo/pull/26317 Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
* distutils-r1.eclass: Adjust min dep versions to current stableMichał Górny2022-06-291-7/+7
| | | | | Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org>
* python-utils-r1.eclass: Add explicit checks for incorrect phaseMichał Górny2022-06-071-0/+13
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Support python_domodule outside src_installMichał Górny2022-06-071-7/+22
| | | | | | | | Make it possible to use python_domodule() outside src_install(), in order to install files into the ${BUILD_DIR}/install tree used by distutils-r1. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Fix typo in python_moduleinto docMichał Górny2022-06-071-4/+4
| | | | | | | Fix python_moduleinto doc to mention python_domodule rather than python_doscript (copy-paste error, probably). Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Strip stray *-pytest-*.pyc files in epytestMichał Górny2022-06-071-0/+5
| | | | | | | | | The test suites of pytest plugins cause additional *-pytest-*.pyc files to be created. Remove them in order to prevent them from being installed alongside the package. Closes: https://bugs.gentoo.org/847235 Signed-off-by: Michał Górny <mgorny@gentoo.org>