Commit Graph

13 Commits

Author SHA1 Message Date
icp 997caab87c common/build-style/python3-module.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
classabbyamp 74f4492e5f common/{,environment}/build_style/python3.sh: use python3 build_helper 2022-08-29 23:25:05 -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
Đoàn Trần Công Danh 90c35c4ac1 common/do_check: move make_check_pre behind env setting
All environment variables setting in command execution must be put
before any non-variables-like, otherwise, they're intepretted as
something else.

Fix: 71b11fdbdb, (xbps-src: add make_check_pre, 2022-02-28)
2022-05-08 08:12:03 +07: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 a3227ffb48 build-style/python3-module: prefer pytest in do_check
Closes: #25052.
2020-12-09 15:45:53 -05:00
Leah Neukirchen d3968bef3c build-style/python[3]-module: override _PYTHON_SYSCONFIGDATA_NAME
Use the sysconfigdata for the appropriate cross arch.
Upstream change: https://bugs.python.org/issue36235
2019-12-23 17:15:51 +01:00
Piotr Wójcik 9291e28d14
build-style/python3-module.sh: add do_check
closes #8969

Co-authored-by: maxice8 <thinkabit.ukim@gmail.com>
2019-02-22 07:24:17 -03:00
Alessio Sergi 8742e48972 build-style/python{2,3}-module: do not use custom build directory
There is no need to use a custom build directory for python{2,3}-only
modules.

This indirectly fixes our issues with packages that use distutils-extra.
2017-08-25 16:17:12 +02:00
Alessio Sergi 2014e03dac Revert "common/buildstyle/python*: build dir can be used as python identifier"
This reverts commit a02132b2ae.

Actually, the issue with packages using python-distutils-extra hasn't
been solved. On the contrary, python build style now generates malformed
packages, e.g., gufw:

+-- usr
    +-- lib
    |   +-- python3.5
    |       +-- site-packages
    |           +-- build3_5
    |           |   +-- lib
    |           |       +-- gufw
    |           |           +-- __init__.py
    |           |           +-- gufw
    |           |           +-- gufw.py
    |           +-- gufw
    |           |   +-- __init__.py
    |           |   +-- gufw
    |           |   +-- gufw.py
    |           +-- gufw-17.04.1-py3.5.egg-info

I don't have a clean solution handy right now, but that obviously isn't.
2017-01-12 12:27:12 +01:00
Enno Boland a02132b2ae common/buildstyle/python*: build dir can be used as python identifier
in order to make gufw installation process work, it includes itself
while installing. this raise the need that the build directory needs
to be a valid python identifier too. this commit solves this issue.
2017-01-05 20:53:47 +01:00
Alessio Sergi 4e6576e7a4 xbps-src: add support for python3 pkgs
- python_module build style now builds modules for python2/3 by default
- new python2_module and python3_module build styles for building
  python2-only and python3-only packages respectively
- no more python_versions
- no need to define pycompile_version for Python modules anymore
  (still needed for non-Python modules though)
- Python version and paths are now guessed automatically and a set of
  useful variables can now be used in templates
- #!/usr/bin/python2 and #!/usr/bin/python3 are now the default shebangs
- /usr/bin/foo2 and /usr/bin/foo3 are now the default names for bin
  scripts (for use with alternatives)
2016-10-16 16:59:31 +02:00