Go to file
Miro Hrončok ca6e522b69 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-14 16:06:07 +02:00
tests Introduce %py3_check_import 2021-07-14 16:06:07 +02:00
.gitignore Initial setup of the repo 2016-01-12 23:33:17 +00:00
compileall2.py Update of bundled compileall2 module to 0.7.1 (bugfix release) 2020-03-31 14:24:09 +02:00
macros.pybytecompile Disable Python hash seed randomization in %py_byte_compile 2020-07-24 07:35:07 +02:00
macros.python Introduce %py3_check_import 2021-07-14 16:06:07 +02:00
macros.python-srpm Allow commas as argument separator for extras names in %python_extras_subpkg 2021-04-07 13:42:45 +02:00
macros.python2 Support defining %py3_shebang_flags to %nil 2020-12-09 11:39:08 +01:00
macros.python3 Introduce %py3_check_import 2021-07-14 16:06:07 +02:00
python-rpm-macros.spec Introduce %py3_check_import 2021-07-14 16:06:07 +02:00
python.lua Make %py_provides work repeatedly 2020-05-05 13:54:28 +02:00
sources Initial setup of the repo 2016-01-12 23:33:17 +00:00