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

CI fails due to broken packages in environment (setuptools issue) #2592

Closed
ctoennis opened this issue Jul 17, 2024 · 9 comments · Fixed by #2593
Closed

CI fails due to broken packages in environment (setuptools issue) #2592

ctoennis opened this issue Jul 17, 2024 · 9 comments · Fixed by #2593

Comments

@ctoennis
Copy link

Me and Tjark had tests on our pull requests fail running with python 3.10 on different operating systems.

The relevant logs are here for the StatisticsExtractor PR and here for the VarianceExtractor PR.

In both cases the issue lies with setuptools not being found (see here)

@maxnoe
Copy link
Member

maxnoe commented Jul 17, 2024

This has to be a change in pytest test collection logic. For some reason it thinks that ctapipe/_dev_version/__init__.py is a test module.

@maxnoe
Copy link
Member

maxnoe commented Jul 17, 2024

Mmh, no, it's different. THe error message is misleading, it's actually the tests that imports all of ctapipe and checks if we have any traitlets defined that are missing the tag(config=True).

Fix here #2593 .

Although I couldn't figure out why this is suddenly failing now...

@maxnoe
Copy link
Member

maxnoe commented Jul 17, 2024

Turns out something must have changed in the doctest collection logic, it now also tries to pick up the _dev_version file and fails.

Fixed by ignoring the file for doctest.

@mexanick
Copy link
Contributor

I'm afraid only a part of the problem is solved.
macOS-14, py:3.12 with mamba gives

2024-07-19T06:31:24.4422990Z     �[0m�[96mself�[39;49;00m._prov[�[33m"�[39;49;00m�[33msystem�[39;49;00m�[33m"�[39;49;00m].update(_get_system_provenance())�[90m�[39;49;00m
2024-07-19T06:31:24.4423240Z �[1m�[31msrc/ctapipe/core/provenance.py�[0m:343: in _get_system_provenance
2024-07-19T06:31:24.4423410Z     �[0mpackages=_get_python_packages(),�[90m�[39;49;00m
2024-07-19T06:31:24.4423650Z �[1m�[31msrc/ctapipe/core/provenance.py�[0m:309: in _get_python_packages
2024-07-19T06:31:24.4424290Z     �[0m�[94mfor�[39;49;00m p �[95min�[39;49;00m �[96msorted�[39;49;00m(distributions(), key=�[94mlambda�[39;49;00m d: (d.name �[95mor�[39;49;00m �[33m"�[39;49;00m�[33m"�[39;49;00m).lower())�[90m�[39;49;00m
2024-07-19T06:31:24.4424650Z �[1m�[31msrc/ctapipe/core/provenance.py�[0m:309: in <lambda>
2024-07-19T06:31:24.4425360Z     �[0m�[94mfor�[39;49;00m p �[95min�[39;49;00m �[96msorted�[39;49;00m(distributions(), key=�[94mlambda�[39;49;00m d: (d.name �[95mor�[39;49;00m �[33m"�[39;49;00m�[33m"�[39;49;00m).lower())�[90m�[39;49;00m
2024-07-19T06:31:24.4425790Z �[1m�[31m../../../micromamba/envs/cta-dev/lib/python3.12/importlib/metadata/__init__.py�[0m:457: in name
2024-07-19T06:31:24.4426210Z     �[0m�[94mreturn�[39;49;00m �[96mself�[39;49;00m.metadata[�[33m'�[39;49;00m�[33mName�[39;49;00m�[33m'�[39;49;00m]�[90m�[39;49;00m
2024-07-19T06:31:24.4426450Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2024-07-19T06:31:24.4426460Z 
2024-07-19T06:31:24.4426660Z self = <importlib.metadata._adapters.Message object at 0x111e150d0>
2024-07-19T06:31:24.4426740Z item = 'Name'
2024-07-19T06:31:24.4426750Z 
2024-07-19T06:31:24.4427050Z     �[0m�[94mdef�[39;49;00m �[92m__getitem__�[39;49;00m(�[96mself�[39;49;00m, item):�[90m�[39;49;00m
2024-07-19T06:31:24.4427200Z     �[90m    �[39;49;00m�[33m"""�[39;49;00m
2024-07-19T06:31:24.4427450Z     �[33m    Warn users that a ``KeyError`` can be expected when a�[39;49;00m
2024-07-19T06:31:24.4427820Z     �[33m    mising key is supplied. Ref python/importlib_metadata#371.�[39;49;00m
2024-07-19T06:31:24.4427940Z     �[33m    """�[39;49;00m�[90m�[39;49;00m
2024-07-19T06:31:24.4428190Z         res = �[96msuper�[39;49;00m().�[92m__getitem__�[39;49;00m(item)�[90m�[39;49;00m
2024-07-19T06:31:24.4428590Z         �[94mif�[39;49;00m res �[95mis�[39;49;00m �[94mNone�[39;49;00m:�[90m�[39;49;00m
2024-07-19T06:31:24.4428700Z >           _warn()�[90m�[39;49;00m
2024-07-19T06:31:24.4429090Z �[1m�[31mE           DeprecationWarning: Implicit None on return values is deprecated and will raise KeyErrors.�[0m
2024-07-19T06:31:24.4429100Z 
2024-07-19T06:31:24.4429500Z �[1m�[31m../../../micromamba/envs/cta-dev/lib/python3.12/importlib/metadata/_adapters.py�[0m:60: DeprecationWarning

@mexanick mexanick reopened this Jul 19, 2024
@mexanick
Copy link
Contributor

full log for the reference can be found here: https://github.com/cta-observatory/ctapipe/actions/runs/10003501784/job/27650544386?pr=2594

@mexanick
Copy link
Contributor

@maxnoe
Copy link
Member

maxnoe commented Jul 19, 2024

Yes, but we can ignore specific ones that we can do nothing about

@maxnoe
Copy link
Member

maxnoe commented Jul 19, 2024

Ah, but this one is real and should be fixed.

@mexanick
Copy link
Contributor

no, we need to be ready that KeyError will be thrown (not yet), it should be taken care in the lambda function you've introduced in #2593

@maxnoe maxnoe changed the title Tests fail with python 3.10 and pip on multiple operating systems CI fails due to broken packages in environment (setuptools issue) Jul 19, 2024
@maxnoe maxnoe closed this as completed in fcfef31 Jul 19, 2024
maxnoe added a commit that referenced this issue Jul 19, 2024
Fix deprecation warning in provenance, fixes #2592
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

Successfully merging a pull request may close this issue.

3 participants