Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.4.3: pytest is failing because messing pyproject_examples module #26

Open
kloczek opened this issue May 1, 2022 · 2 comments
Open
Assignees
Labels
bug Something isn't working stale

Comments

@kloczek
Copy link

kloczek commented May 1, 2022

I'm trying to package your module as an rpm package. So I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

  • python3 -sBm build -w --no-isolation
  • because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
  • install .whl file in </install/prefix>
  • run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

I cannot find where is pyproject_examples module.
Here is pytest output:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pyproject-parser-0.4.3-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pyproject-parser-0.4.3-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
Test session started at 16:42:58
rootdir: /home/tkloczko/rpmbuild/BUILD/pyproject-parser-0.4.3, configfile: tox.ini
plugins: datadir-1.3.1, regressions-2.3.1
collected 54 items / 4 errors

================================================================================== ERRORS ==================================================================================
____________________________________________________________________ ERROR collecting tests/test_cli.py ____________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pyproject-parser-0.4.3/tests/test_cli.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_cli.py:12: in <module>
    from pyproject_examples import valid_buildsystem_config, valid_pep621_config
E   ModuleNotFoundError: No module named 'pyproject_examples'
__________________________________________________________________ ERROR collecting tests/test_config.py ___________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pyproject-parser-0.4.3/tests/test_config.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_config.py:11: in <module>
    from pyproject_examples import (
E   ModuleNotFoundError: No module named 'pyproject_examples'
__________________________________________________________________ ERROR collecting tests/test_dumping.py __________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pyproject-parser-0.4.3/tests/test_dumping.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_dumping.py:5: in <module>
    from pyproject_examples.example_configs import COMPLETE_A, COMPLETE_A_WITH_FILES, COMPLETE_B, COMPLETE_PROJECT_A
E   ModuleNotFoundError: No module named 'pyproject_examples'
______________________________________________________________ ERROR collecting tests/test_pyproject_class.py ______________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pyproject-parser-0.4.3/tests/test_pyproject_class.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_pyproject_class.py:9: in <module>
    from pyproject_examples import (
E   ModuleNotFoundError: No module named 'pyproject_examples'
============================================================================= warnings summary =============================================================================
../../../../../usr/lib/python3.8/site-packages/_pytest/config/__init__.py:1252
  /usr/lib/python3.8/site-packages/_pytest/config/__init__.py:1252: PytestConfigWarning: Unknown config option: timeout

    self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================================= short test summary info ==========================================================================
ERROR tests/test_cli.py
ERROR tests/test_config.py
ERROR tests/test_dumping.py
ERROR tests/test_pyproject_class.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 4 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
======================================================================= 1 warning, 4 errors in 0.28s =======================================================================
@kloczek kloczek added the bug Something isn't working label May 1, 2022
@kloczek
Copy link
Author

kloczek commented May 1, 2022

After ignre thsoe 4 files rest seems is OK

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pyproject-parser-0.4.3-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pyproject-parser-0.4.3-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra --ignore tests/test_cli.py --ignore tests/test_config.py --ignore tests/test_dumping.py --ignore tests/test_pyproject_class.py
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
Test session started at 16:49:15
rootdir: /home/tkloczko/rpmbuild/BUILD/pyproject-parser-0.4.3, configfile: tox.ini
plugins: datadir-1.3.1, regressions-2.3.1, timeout-2.1.0
timeout: 300.0s
timeout method: signal
timeout func_only: False
collected 54 items

tests/test_classes.py ...............                                                                                                                                [ 27%]
tests/test_cli_module.py ..........................                                                                                                                  [ 75%]
tests/test_utils.py ............s                                                                                                                                    [100%]

=========================================================================== slowest 25 durations ===========================================================================

(25 durations < 0.005s hidden.  Use -vv to show these durations.)
========================================================================= short test summary info ==========================================================================
SKIPPED [1] tests/test_utils.py:35: could not import 'readme_renderer': No module named 'readme_renderer'
====================================================================== 53 passed, 1 skipped in 0.30s =======================================================================

@yuzibo
Copy link

yuzibo commented Oct 19, 2022

Hi,
I have faced the same issue also. So The pyproject_examples module was imported by which python module?

@stale stale bot added the stale label Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

3 participants