summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* python-utils-r1.eclass: Sterilize pytest-markdownMichał Górny2022-05-111-0/+3
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Switch epytest to "count" progress reportsMichał Górny2022-05-091-0/+3
| | | | | | | Switch epytest to report test counts rather than percentages. This is more precise when we're dealing with large numbers of tests. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Raise py3.11 package dep for python-exec depMichał Górny2022-05-091-1/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Add support for python3.11Michał Górny2022-05-091-4/+6
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Utilize the new makeopts_jobs defaultMichał Górny2022-05-011-3/+1
| | | | | | Signed-off-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/25238 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: pypy3 is now Python 3.9Michał Górny2022-04-211-3/+3
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Make python_fix_shebang force full pathMichał Górny2022-04-021-83/+51
| | | | | | | | | | | | | | | | | | | | | | Change the behavior of python_fix_shebang to always output full path to the Python interpreter (i.e. ${PYTHON}) instead of mangling the original path. Most importantly, this ensures that: 1. EPREFIX is included in the final path 2. /usr/bin/env is replaced by the absolute path to avoid issues when calling system executables from inside a venv Note that this implies that a few unlikely corner cases may stop working, notably: a. "weird" shebangs such as "/usr/bin/foo python" will no longer work b. the mangled scripts will escape temporary venv e.g. created in distutils-r1 PEP517 mode (python_fix_shebang is not used in such a way in ::gentoo) Signed-off-by: Michał Górny <mgorny@gentoo.org>
* *.eclass: @ECLASS-VARIABLE renamed to @ECLASS_VARIABLEUlrich Müller2022-03-241-5/+5
| | | | | Bug: https://bugs.gentoo.org/835396 Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* python-utils-r1.eclass: Add a verbose python_has_version() wrapperMichał Górny2022-02-151-0/+42
| | | | | | | | | | | Add a python_has_version() wrapper for convenient use in python_check_deps(). It includes: - verbose output - default "-b" root that's more suitable for build-time checks - forward compatibility for -b/-d/-r arguments in EAPI 6 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Silence missing locale(1) errorMichał Górny2022-02-091-1/+1
| | | | | | | | | The python_export_utf8_locale() function checks for missing locale(1) and handles it gracefully. However, it does not redirect stderr probably, so systems without the executable (e.g. musl) get unintended console output. Redirect it to /dev/null. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Add QA check for obsolete PYTHON_COMPATMichał Górny2022-02-091-1/+17
| | | | | | | | Add a QA check that reports obsolete implementation in PYTHON_COMPAT if ebuild has been modified in 2022 (based on copyright year). Requested by sam. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Support matching impls by stdlib versionMichał Górny2022-02-091-4/+18
| | | | | | | | | | | | | | 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>
* python-utils-r1.eclass: Add status messages to python_optimizeMichał Górny2022-02-091-0/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Remove old phase check from python_optimizeMichał Górny2022-02-091-9/+0
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Use heredoc instead of "python -c"Michał Górny2022-02-091-5/+36
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Remove python_is_python3Michał Górny2022-02-091-17/+0
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Remove python_wrapper_setupMichał Górny2022-02-091-16/+0
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Remove deprecated python_exportMichał Górny2022-02-091-17/+0
| | | | | | | Remove python_export, as it is no longer used by any ebuilds in ::gentoo. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Fix sphinx_build for non-autodoc caseMichał Górny2022-02-091-4/+18
| | | | | | | | | | | | | | | | | | | Fix the regression in calling sphinx-build for the non-autodoc case that causes the build to fail if dev-python/sphinx isn't built for the newest Python interpreter available. To account for this, we need to call sphinx-build as an executable (i.e. via python-exec). Ideally, build_sphinx would be aware of which case it is used for, and use appropriate invocation. Unfortunately, we cannot do that without breaking backwards compatibility. However, we can simply check if Sphinx is available via ${EPYTHON}, and fall back to calling python-exec directly. This is effectively equivalent to choosing the specific invocation directly, as python-exec would have respected the implementation specified by EPYTHON anyway if sphinx-build executable was available for it. Fixes: f6a17acb8b7c (...: Run sphinx-build via EPYTHON) Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Inline python_is_installedMichał Górny2022-02-091-19/+3
| | | | | | | | Inline the python_is_installed function that is used exactly once (in _python_run_check_deps). This helps us avoid having to grab PYTHON_PKG_DEP twice. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Report _python_run_check_deps verboselyMichał Górny2022-02-091-1/+9
| | | | | | | Report dep checking progress verbosely, to help users understand why a particular implementations was rejected or selected. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Add function to run python_check_deps()Michał Górny2022-02-091-0/+20
| | | | | | | Add a function encompassing the common logic to run python_check_deps() from python-any-r1 and python-r1. 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>
* python-utils-r1.eclass: Make epytest disable plugins we don't wantMichał Górny2022-01-241-0/+8
| | | | | | | | | | | Make epytest explicitly disable unwanted plugins such as pytest-cov or pytest-flakes. We want the relevant options to be stripped out of pytest config files. However, when these packages are installed on the system, it's easy to miss them and then users (or tinderboxes) hit the failures first. Disabling the plugins explicitly forces them to fail immediately while testing. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Run sphinx-build via EPYTHONMichał Górny2022-01-201-1/+2
| | | | | | | | | Run sphinx-build via EPYTHON to ensure that the correct Python executable is being used. Otherwise, sphinx-build runs via /usr/bin/python* and does not respect the virtualenv boundaries. Closes: https://bugs.gentoo.org/831565 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: epytest, force color output to match NOCOLORMichał Górny2022-01-131-0/+12
| | | | | | | | Force pytest color output on or off based on the presence and value of NOCOLOR envvar. This fixes inconsistent use of colors that largely depended on upstream pytest settings. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Bump minimal Python versionsMichał Górny2022-01-091-2/+8
| | | | | | | Bump minimal Python package versions to ensure that the python-exec deps are inside. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Bump min pypy3 dep to force pypy3.8Michał Górny2021-11-091-1/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: add and use _python_check_EPYTHONFlorian Schmaus2021-09-141-2/+12
| | | | Signed-off-by: Florian Schmaus <flow@gentoo.org>
* python-utils-r1.eclass: Handle deselect/ignore in epytestMichał Górny2021-08-151-2/+28
| | | | | | | | | | Support (potentially global-scope) EPYTEST_DESELECT and EPYTEST_IGNORE arrays to conveniently deselect/skip tests. This effectively replaces local hacks such as: epytest ${deselect[@]/#/--deselect } Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Enable parallel bytecompile compilationMart Raudsepp2021-08-121-5/+8
| | | | | | | | | | Python 3.5 added support for compileall to run parallel workers for performing bytecode compilation. Make use of it to the extent possible without refactoring the code too much to get different paths into the same call for best possible parallelization. Signed-off-by: Mart Raudsepp <leio@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Enable hardlinking of identical pyc files for py3.9+Mart Raudsepp2021-08-121-1/+4
| | | | | | | | | | Python 3.9 includes a new feature for compileall to automatically hardlink different optimization level cache files if they are identical. Make use of it for python_optimize for some space savings. This however does not cover distutils use cases and python itself. Signed-off-by: Mart Raudsepp <leio@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Cleanup cache dirs after epytestMichał Górny2021-08-071-1/+6
| | | | | | | | | Make epytest clean up common cache directories .hypothesis and .pytest_cache after the execution. If pytest is executed in ${BUILD_DIR}/lib, these directories end up being wrongly installed, and so far ebuilds had to handle cleaning them up. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Pass -Wdefault to epytest to avoid -WerrorMichał Górny2021-07-021-0/+3
| | | | | | | | | | | | | | | Make pytest pass -Wdefault in order to override upstream default warning options that commonly include -Werror. This has often caused tests to start failing due to new deprecation warnings introduced in dependencies, or block new implementations due to harmless deprecation warnings. A side effect of this is that we are overriding all warning options used by upstream. This could e.g. cause more warnings to be reported (when upstream ignores some of them). This might also break badly written tests (e.g. when they rely on exceptions to catch warnings). Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Remove _python_ln_relMichał Górny2021-06-291-40/+0
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* Revert "python-utils-r1.eclass: Remove _python_ln_rel"Mike Gilbert2021-06-241-0/+40
| | | | | Reverts: 1f678a8cae66480493c43739435ec7feb85c08da Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* python-utils-r1.eclass: Revert "Remove python_optimize support..."Michał Górny2021-06-241-2/+6
| | | | | | | | python_optimize is still used in dev-python/pypy. Reverts: 964f5c61816659b0138c8fe98593786d9da7f084 Closes: https://bugs.gentoo.org/798330 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Remove _python_ln_relMichał Górny2021-06-231-40/+0
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Enable EAPI 8Michał Górny2021-06-231-2/+2
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Fix python_fix_shebang for py3.10+Michał Górny2021-06-231-5/+7
| | | | | | We should be safe until Python 3.99 now ;-). Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Deprecated and EAPI8-ban python_is_python3Michał Górny2021-06-231-0/+3
| | | | | | | There is no use for python_is_python3 anymore, as Python 2 is no longer supported at runtime and the remaining any-r1 uses are pure-2. Signed-off-by: Michał Górny <mgorny@gentoo.org>