Commit Graph

15 Commits

Author SHA1 Message Date
icp 0e1f4fc46a common/build-style/python3-pep517.sh: enable `PY_IGNORE_IMPORTMISMATCH` for testing
Fixes `ImportMismatchError` for doctest-modules in pytest
Ref: https://github.com/pytest-dev/pytest/issues/2042#issuecomment-381309723
2024-01-21 16:04:19 -05:00
Andrew J. Hesford f2ac1733dc common/build-style/python3-pep517.sh: use meson cross files by default 2023-09-23 12:49:44 -04:00
icp 71185be9d1 common/build-style/python3-pep517.sh: extract wheels in hidden dirs
This prevents pytest from collecting tests multiple times when
they are bundled in the wheel itself alongside the source tree.

Closes: #43946 [via git-merge-pr]
2023-06-05 16:27:02 -04:00
Gonzalo Tornaría 126798875f build-style/python3-pep517: use generic glob for wheels, refactor
Also: do not compile bytecode in `do_install()` since it will be removed
in `post_install()`.

Co-authored-by: Gonzalo Tornaría <tornaria@cmat.edu.uy>
Co-authored-by: Andrew J. Hesford <ajh@sideband.org>

Closes: #44071.
2023-05-25 13:43:16 -04:00
Michal Vasilek c7206b4bdc common/build-style/python3-pep517: use absolute path for check temp dir
some tests change cwd which causes relative tmpdir to point to a non-existent
location
2023-05-07 16:28:06 +02:00
icp 37d268a907 common/build-style/python3-pep517.sh: unpack wheels for testing
Python packages built with pep517 system occasionally require
accessing distinfo files and/or entry points provided by the
package for tests to run. Since these assets are packed inside
the wheel generated in `do_build`, the target wheel is unpacked
in `do_check` first so that the said artifacts are accessible
during test runs.
2023-04-12 15:49:51 -04:00
Andrew J. Hesford 936a6ed85d build-style/python3-pep517.sh: abandon pip 2022-11-09 21:24:02 -05:00
Jami Kettunen e0bcd5d955 common/build-style/python3-pep517: add missing \n for msg_warn 2022-11-10 08:42:05 +07:00
Joel Beckmeyer def53da009 common/build-style/python3-pep517.sh: use full path for TMPDIR
fixes side effects with setuptools_rust / rustc
2022-09-28 10:04:27 -04:00
classabbyamp c011e0e13b common/build-style/python3-*: add support for pytest-xdist
if python3-pytest-xdist is included in checkdepends, use $XBPS_MAKEJOBS
to run tests in parallel.
2022-06-09 21:44:23 -04:00
Andrew J. Hesford 950151c572 build-style/python3-pep517.sh: improve default wheel selection
When naming wheels, hyphens are converted to underscores in package
names. Recognizing this in the build style eliminates manual definition
of `make_install_target` in several templates.
2022-05-16 10:51:58 -04:00
Michal Vasilek 71b11fdbdb xbps-src: add make_check_pre
$make_check_pre can be used for wrapper commands like xvfb-run or
dbus-run-session which are common ways to make tests work. This way many
templates can avoid defining their own do_check function.
2022-05-04 10:46:53 +02:00
Andrew J. Hesford fa5500228e build-style/python3-{module,pep517}.sh: improve pytest usage
1. Relying on `python3 -m pytest --help` to test for pytest can fail
   because the pytest packages's __main__ is still invoked; this can
   trigger import problems and falsely indicate that pytest is missing.
   A simpler test is to just confirm that pytest is importable. If so,
   the interpreter returns 0. Otherwise, an ImportError is thrown and
   the interpreter will return 1.

2. Many templates require a custom do_check just to set PYTHONPATH to
   either a build directory (especially for compiled extensions) or some
   subdirectory of the source tree. Setting PYTHONPATH automatically to
   the build directory should drastically reduce the need for custom
   do_check in py3 templates. (This only applies to python3-module.sh
   because pep517 builders will have unpredictable build directories.)

Closes: #31354.
2021-06-08 13:53:15 -04:00
Andrew J. Hesford 74e0a12915 build-style/python3-pep517: make sure ./build exists in do_install
This allows templates to override do_build and not have to create the
build subdirectory used as TMPDIR in do_install; failure to create this
directory will cause pip to use (and pollute) /tmp in the masterdir.
2021-02-03 16:30:01 -05:00
Andrew J. Hesford 2dff49c420 build-style/python3-pep517: new style for PEP517 Python packages 2020-12-08 15:26:38 -05:00