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

2021.3: pytest is failing on missimg 'all_timezones' variable #68

Closed
kloczek opened this issue Dec 30, 2021 · 2 comments
Closed

2021.3: pytest is failing on missimg 'all_timezones' variable #68

kloczek opened this issue Dec 30, 2021 · 2 comments

Comments

@kloczek
Copy link

kloczek commented Dec 30, 2021

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-pytz-2021.3-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pytz-2021.3-2.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
rootdir: /home/tkloczko/rpmbuild/BUILD/pytz-release_2021.3/src
collected 41 items / 1 error / 40 selected

================================================================================== ERRORS ==================================================================================
________________________________________________________________ ERROR collecting pytz/tests/test_tzinfo.py ________________________________________________________________
pytz/tests/test_tzinfo.py:40: in <module>
    GMT = pytz.timezone('GMT')
../../../BUILDROOT/python-pytz-2021.3-2.fc35.x86_64/usr/lib/python3.8/site-packages/pytz/__init__.py:179: in timezone
    zone = _case_insensitive_zone_lookup(_unmunge_zone(zone))
../../../BUILDROOT/python-pytz-2021.3-2.fc35.x86_64/usr/lib/python3.8/site-packages/pytz/__init__.py:205: in _case_insensitive_zone_lookup
    _all_timezones_lower_to_standard = dict((tz.lower(), tz) for tz in all_timezones)  # noqa
E   NameError: name 'all_timezones' is not defined
========================================================================= short test summary info ==========================================================================
ERROR pytz/tests/test_tzinfo.py - NameError: name 'all_timezones' is not defined
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================= 1 error in 1.64s =============================================================================
@stub42
Copy link
Owner

stub42 commented Mar 20, 2022

The code in this repository is used to generate the pytz distribution, which includes adding the all_timezones data structure. You either need to run the tests using the the release tarballs, or run the code generation steps using the repo and test the generated code in the build/ subdirectory.

@stub42 stub42 closed this as completed Mar 20, 2022
@kloczek
Copy link
Author

kloczek commented Mar 27, 2022

or run the code generation steps using the repo and test the generated code in the build/ subdirectory.

Where are those steps ansd why tose steps cannot be part of regulat build parocess?

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