Go to file
Miro Hrončok c2305ea368 Introduce %py3_check_import
With $PATH and $PYTHONPATH set to the %buildroot,
the macro tries to import the given Python 3 module(s).
Useful as a smoke test in %check when ruining tests is not feasible.
Accepts spaces or commas as separators.

Package python-six:

    %check
    %py3_check_import six

    Executing(%check): ...
    ...
    + PATH=...
    + PYTHONPATH=...
    + PYTHONDONTWRITEBYTECODE=1
    + /usr/bin/python3 -c 'import six'
    + RPM_EC=0
    ++ jobs -p
    + exit 0

    %py3_check_import six seven

    ...
    + /usr/bin/python3 -c 'import six, seven'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ModuleNotFoundError: No module named 'seven'

    error: Bad exit status from ... (%check)

    ...
    %py3_check_import five, six, seven

    + /usr/bin/python3 -c 'import five, six, seven'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ModuleNotFoundError: No module named 'five'

    error: Bad exit status from ... (%check)

Package python-packaging:

    %py3_check_import packaging, packaging.markers  packaging.requirements, packaging.tags

    Executing(%check): ...
    ...
    + PATH=...
    + PYTHONPATH=...
    + PYTHONDONTWRITEBYTECODE=1
    + /usr/bin/python3 -c 'import packaging, packaging.markers, packaging.requirements, packaging.tags'
    + RPM_EC=0
    ++ jobs -p
    + exit 0

    %py3_check_import packaging, packaging.markers  packaging.notachance, packaging.tags

    ...
    + /usr/bin/python3 -c 'import packaging, packaging.markers, packaging.notachance, packaging.tags'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ModuleNotFoundError: No module named 'packaging.notachance'

    error: Bad exit status from ... (%check)
2021-07-07 14:46:04 +02:00
tests Introduce %py3_check_import 2021-07-07 14:46:04 +02:00
.gitignore Initial setup of the repo 2016-01-12 23:33:17 +00:00
brp-python-hardlink Include brp-python-hardlink in python-srpm-macros since it is no longer in RPM 4.17+ 2021-06-30 18:13:53 +02:00
compileall2.py Update of bundled compileall2 module to 0.7.1 (bugfix release) 2020-03-31 14:24:09 +02:00
macros.pybytecompile Escape % symbols in macro files comments 2021-04-27 12:36:11 +02:00
macros.python Introduce %py3_check_import 2021-07-07 14:46:04 +02:00
macros.python-srpm Include brp-python-hardlink in python-srpm-macros since it is no longer in RPM 4.17+ 2021-06-30 18:13:53 +02:00
macros.python3 Introduce %py3_check_import 2021-07-07 14:46:04 +02:00
python-rpm-macros.spec Introduce %py3_check_import 2021-07-07 14:46:04 +02:00
python.lua Update comment for python_altnames() to reflect the reality 2021-02-24 13:06:35 +01:00
sources Initial setup of the repo 2016-01-12 23:33:17 +00:00