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

1.10.3: pytest and nox are failing #56

Open
kloczek opened this issue Jan 3, 2022 · 7 comments
Open

1.10.3: pytest and nox are failing #56

kloczek opened this issue Jan 3, 2022 · 7 comments

Comments

@kloczek
Copy link

kloczek commented Jan 3, 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
  • install .whl file in </install/prefix>
  • run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

Here is pytest output:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-harvest-1.10.3-3.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-harvest-1.10.3-3.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /home/tkloczko/rpmbuild/BUILD/python-pytest-harvest-1.10.3, configfile: setup.cfg, testpaths: pytest_harvest/tests/
plugins: harvest-1.10.3
collected 0 items / 1 error

================================================================================== ERRORS ==================================================================================
______________________________________________________________________ ERROR collecting test session _______________________________________________________________________
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:973: in _find_and_load_unlocked
    ???
E   ModuleNotFoundError: No module named 'pytest_harvest.tests'
========================================================================= short test summary info ==========================================================================
ERROR  - ModuleNotFoundError: No module named 'pytest_harvest.tests'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================= 1 error in 0.22s =============================================================================

I found pytest_harvest/tests/ so I've been tring ro use --pyargs but it did't help as well

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-harvest-1.10.3-3.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-harvest-1.10.3-3.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra --pyargs pytest_harvest.tests
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /home/tkloczko/rpmbuild/BUILD/python-pytest-harvest-1.10.3, configfile: setup.cfg
plugins: harvest-1.10.3
collected 0 items

========================================================================== no tests ran in 0.00s ===========================================================================
ERROR: module or package not found: pytest_harvest.tests (missing __init__.py?)

nox seems is failing as well

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-harvest-1.10.3-3.fc35.x86_64/usr/lib/python3.8/site-packages
+ nox
nox > Running session tests-3.8(env='pytest2.x')
nox > Creating conda env in .nox/tests-3-8-env-pytest2-x with python=3.8
nox > Program conda not found.
nox > Session tests-3.8(env='pytest2.x') failed.
nox > Running session tests-3.8(env='pytest3.x')
nox > Creating conda env in .nox/tests-3-8-env-pytest3-x with python=3.8
nox > Program conda not found.
nox > Session tests-3.8(env='pytest3.x') failed.
nox > Running session tests-3.8(env='pytest4.x')
nox > Creating conda env in .nox/tests-3-8-env-pytest4-x with python=3.8
nox > Program conda not found.
nox > Session tests-3.8(env='pytest4.x') failed.
nox > Running session tests-3.8(env='pytest5.x')
nox > Creating conda env in .nox/tests-3-8-env-pytest5-x with python=3.8
nox > Program conda not found.
nox > Session tests-3.8(env='pytest5.x') failed.
nox > Running session tests-3.8(env='pytest-latest')
nox > Creating conda env in .nox/tests-3-8-env-pytest-latest with python=3.8
nox > Program conda not found.
nox > Session tests-3.8(env='pytest-latest') failed.
nox > Running session tests-2.7(env='pytest2.x')
nox > Creating conda env in .nox/tests-2-7-env-pytest2-x with python=2.7
nox > Program conda not found.
nox > Session tests-2.7(env='pytest2.x') failed.
nox > Running session tests-2.7(env='pytest3.x')
nox > Creating conda env in .nox/tests-2-7-env-pytest3-x with python=2.7
nox > Program conda not found.
nox > Session tests-2.7(env='pytest3.x') failed.
nox > Running session tests-2.7(env='pytest4.x')
nox > Creating conda env in .nox/tests-2-7-env-pytest4-x with python=2.7
nox > Program conda not found.
nox > Session tests-2.7(env='pytest4.x') failed.
nox > Running session tests-2.7(env='pytest5.x')
nox > Creating conda env in .nox/tests-2-7-env-pytest5-x with python=2.7
nox > Program conda not found.
nox > Session tests-2.7(env='pytest5.x') failed.
nox > Running session tests-2.7(env='pytest-latest')
nox > Re-using existing conda env at .nox/tests-2-7-env-pytest-latest.
nox > Skipping configuration, this is not supported in python version '2.7'
nox > Session tests-2.7(env='pytest-latest') was successful.
nox > Running session tests-3.5(env='pytest2.x')
nox > Creating conda env in .nox/tests-3-5-env-pytest2-x with python=3.5
nox > Program conda not found.
nox > Session tests-3.5(env='pytest2.x') failed.
nox > Running session tests-3.5(env='pytest3.x')
nox > Creating conda env in .nox/tests-3-5-env-pytest3-x with python=3.5
nox > Program conda not found.
nox > Session tests-3.5(env='pytest3.x') failed.
nox > Running session tests-3.5(env='pytest4.x')
nox > Creating conda env in .nox/tests-3-5-env-pytest4-x with python=3.5
nox > Program conda not found.
nox > Session tests-3.5(env='pytest4.x') failed.
nox > Running session tests-3.5(env='pytest5.x')
nox > Creating conda env in .nox/tests-3-5-env-pytest5-x with python=3.5
nox > Program conda not found.
nox > Session tests-3.5(env='pytest5.x') failed.
nox > Running session tests-3.5(env='pytest-latest')
nox > Creating conda env in .nox/tests-3-5-env-pytest-latest with python=3.5
nox > Program conda not found.
nox > Session tests-3.5(env='pytest-latest') failed.
nox > Running session tests-3.6(env='pytest2.x')
nox > Creating conda env in .nox/tests-3-6-env-pytest2-x with python=3.6
nox > Program conda not found.
nox > Session tests-3.6(env='pytest2.x') failed.
nox > Running session tests-3.6(env='pytest3.x')
nox > Creating conda env in .nox/tests-3-6-env-pytest3-x with python=3.6
nox > Program conda not found.
nox > Session tests-3.6(env='pytest3.x') failed.
nox > Running session tests-3.6(env='pytest4.x')
nox > Creating conda env in .nox/tests-3-6-env-pytest4-x with python=3.6
nox > Program conda not found.
nox > Session tests-3.6(env='pytest4.x') failed.
nox > Running session tests-3.6(env='pytest5.x')
nox > Creating conda env in .nox/tests-3-6-env-pytest5-x with python=3.6
nox > Program conda not found.
nox > Session tests-3.6(env='pytest5.x') failed.
nox > Running session tests-3.6(env='pytest-latest')
nox > Creating conda env in .nox/tests-3-6-env-pytest-latest with python=3.6
nox > Program conda not found.
nox > Session tests-3.6(env='pytest-latest') failed.
nox > Running session tests-3.7(env='pytest2.x')
nox > Creating conda env in .nox/tests-3-7-env-pytest2-x with python=3.7
nox > Program conda not found.
nox > Session tests-3.7(env='pytest2.x') failed.
nox > Running session tests-3.7(env='pytest3.x')
nox > Creating conda env in .nox/tests-3-7-env-pytest3-x with python=3.7
nox > Program conda not found.
nox > Session tests-3.7(env='pytest3.x') failed.
nox > Running session tests-3.7(env='pytest4.x')
nox > Creating conda env in .nox/tests-3-7-env-pytest4-x with python=3.7
nox > Program conda not found.
nox > Session tests-3.7(env='pytest4.x') failed.
nox > Running session tests-3.7(env='pytest5.x')
nox > Creating conda env in .nox/tests-3-7-env-pytest5-x with python=3.7
nox > Program conda not found.
nox > Session tests-3.7(env='pytest5.x') failed.
nox > Running session tests-3.7(env='pytest-latest')
nox > Creating conda env in .nox/tests-3-7-env-pytest-latest with python=3.7
nox > Program conda not found.
nox > Session tests-3.7(env='pytest-latest') failed.
nox > Ran multiple sessions:
nox > * tests-3.8(env='pytest2.x'): failed
nox > * tests-3.8(env='pytest3.x'): failed
nox > * tests-3.8(env='pytest4.x'): failed
nox > * tests-3.8(env='pytest5.x'): failed
nox > * tests-3.8(env='pytest-latest'): failed
nox > * tests-2.7(env='pytest2.x'): failed
nox > * tests-2.7(env='pytest3.x'): failed
nox > * tests-2.7(env='pytest4.x'): failed
nox > * tests-2.7(env='pytest5.x'): failed
nox > * tests-2.7(env='pytest-latest'): success
nox > * tests-3.5(env='pytest2.x'): failed
nox > * tests-3.5(env='pytest3.x'): failed
nox > * tests-3.5(env='pytest4.x'): failed
nox > * tests-3.5(env='pytest5.x'): failed
nox > * tests-3.5(env='pytest-latest'): failed
nox > * tests-3.6(env='pytest2.x'): failed
nox > * tests-3.6(env='pytest3.x'): failed
nox > * tests-3.6(env='pytest4.x'): failed
nox > * tests-3.6(env='pytest5.x'): failed
nox > * tests-3.6(env='pytest-latest'): failed
nox > * tests-3.7(env='pytest2.x'): failed
nox > * tests-3.7(env='pytest3.x'): failed
nox > * tests-3.7(env='pytest4.x'): failed
nox > * tests-3.7(env='pytest5.x'): failed
nox > * tests-3.7(env='pytest-latest'): failed
@kloczek
Copy link
Author

kloczek commented Apr 9, 2022

ping .. 😄

@kloczek
Copy link
Author

kloczek commented Jun 10, 2022

Just tested 1.10.4 and pytest still cannot be used to test pytest-harvest 🤔

BTW looks like pytest-runner can be removed from setup_requires

--- a/setup.cfg~        2022-06-10 08:01:20.000000000 +0000
+++ b/setup.cfg 2022-06-10 09:09:31.437852575 +0000
@@ -33,7 +33,6 @@
 # one day these will be able to come from requirement files, see https://github.com/pypa/setuptools/issues/1951. But will it be better ?
 setup_requires =
     setuptools_scm
-    pytest-runner
 install_requires =
     decopatch
     makefun>=1.5

build without that module installed:

+ /usr/bin/python3 -sBm build -w --no-isolation
* Getting dependencies for wheel...
/usr/lib/python3.8/site-packages/setuptools/dist.py:767: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
  warnings.warn(
* Building wheel...
/usr/lib/python3.8/site-packages/setuptools/dist.py:767: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
  warnings.warn(
running bdist_wheel
running build
running build_py
creating build
creating build/lib
creating build/lib/pytest_harvest
copying pytest_harvest/__init__.py -> build/lib/pytest_harvest
copying pytest_harvest/common.py -> build/lib/pytest_harvest
copying pytest_harvest/fixture_cache.py -> build/lib/pytest_harvest
copying pytest_harvest/newhooks.py -> build/lib/pytest_harvest
copying pytest_harvest/plugin.py -> build/lib/pytest_harvest
copying pytest_harvest/results_bags.py -> build/lib/pytest_harvest
copying pytest_harvest/results_session.py -> build/lib/pytest_harvest
copying pytest_harvest/xdist_api.py -> build/lib/pytest_harvest
copying pytest_harvest/_version.py -> build/lib/pytest_harvest
copying pytest_harvest/py.typed -> build/lib/pytest_harvest
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/wheel
creating build/bdist.linux-x86_64/wheel/pytest_harvest
copying build/lib/pytest_harvest/__init__.py -> build/bdist.linux-x86_64/wheel/pytest_harvest
copying build/lib/pytest_harvest/common.py -> build/bdist.linux-x86_64/wheel/pytest_harvest
copying build/lib/pytest_harvest/fixture_cache.py -> build/bdist.linux-x86_64/wheel/pytest_harvest
copying build/lib/pytest_harvest/newhooks.py -> build/bdist.linux-x86_64/wheel/pytest_harvest
copying build/lib/pytest_harvest/plugin.py -> build/bdist.linux-x86_64/wheel/pytest_harvest
copying build/lib/pytest_harvest/results_bags.py -> build/bdist.linux-x86_64/wheel/pytest_harvest
copying build/lib/pytest_harvest/results_session.py -> build/bdist.linux-x86_64/wheel/pytest_harvest
copying build/lib/pytest_harvest/xdist_api.py -> build/bdist.linux-x86_64/wheel/pytest_harvest
copying build/lib/pytest_harvest/_version.py -> build/bdist.linux-x86_64/wheel/pytest_harvest
copying build/lib/pytest_harvest/py.typed -> build/bdist.linux-x86_64/wheel/pytest_harvest
running install_egg_info
running egg_info
creating pytest_harvest.egg-info
writing pytest_harvest.egg-info/PKG-INFO
writing dependency_links to pytest_harvest.egg-info/dependency_links.txt
writing entry points to pytest_harvest.egg-info/entry_points.txt
writing requirements to pytest_harvest.egg-info/requires.txt
writing top-level names to pytest_harvest.egg-info/top_level.txt
writing manifest file 'pytest_harvest.egg-info/SOURCES.txt'
listing git files failed - pretending there aren't any
reading manifest file 'pytest_harvest.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'pytest_harvest.egg-info/SOURCES.txt'
Copying pytest_harvest.egg-info to build/bdist.linux-x86_64/wheel/pytest_harvest-1.10.4-py3.8.egg-info
running install_scripts
adding license file "LICENSE" (matched pattern "LICEN[CS]E*")
creating build/bdist.linux-x86_64/wheel/pytest_harvest-1.10.4.dist-info/WHEEL
creating '/home/tkloczko/rpmbuild/BUILD/python-pytest-harvest-1.10.4/dist/tmpcd3oon5k/pytest_harvest-1.10.4-py2.py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
adding 'pytest_harvest/__init__.py'
adding 'pytest_harvest/_version.py'
adding 'pytest_harvest/common.py'
adding 'pytest_harvest/fixture_cache.py'
adding 'pytest_harvest/newhooks.py'
adding 'pytest_harvest/plugin.py'
adding 'pytest_harvest/py.typed'
adding 'pytest_harvest/results_bags.py'
adding 'pytest_harvest/results_session.py'
adding 'pytest_harvest/xdist_api.py'
adding 'pytest_harvest-1.10.4.dist-info/LICENSE'
adding 'pytest_harvest-1.10.4.dist-info/METADATA'
adding 'pytest_harvest-1.10.4.dist-info/WHEEL'
adding 'pytest_harvest-1.10.4.dist-info/entry_points.txt'
adding 'pytest_harvest-1.10.4.dist-info/top_level.txt'
adding 'pytest_harvest-1.10.4.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel
Successfully built pytest_harvest-1.10.4-py2.py3-none-any.whl

@smarie
Copy link
Owner

smarie commented Jun 11, 2022

Indeed, thanks @kloczek !
Sorry for not yet having the time to fix this, be sure that I do not forget it :)

@kloczek
Copy link
Author

kloczek commented Apr 27, 2023

Look on "Deprecation Notice" on https://github.com/pytest-dev/pytest-runner/
This module will be archived soon.

@kloczek
Copy link
Author

kloczek commented Feb 2, 2024

Gentle ping .. any update?
I think that easiest way to solve that would be move pytest_harvest/tests/ to tests and pytest_harvest/tests_raw to tests/raw/.

@smarie
Copy link
Owner

smarie commented Mar 15, 2024

Thanks @kloczek , unfortunately still no time to perform this move yet, but getting closer ! I'll keep you posted

@kloczek
Copy link
Author

kloczek commented Mar 16, 2024

In mean time I made patch which removes python<=3.7 support ad removes use of six however because test suite is not working I'm not able to test it 😋

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants