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

DM-33403: Move base.Packages to lsst.utils #111

Merged
merged 54 commits into from Jan 31, 2022
Merged

DM-33403: Move base.Packages to lsst.utils #111

merged 54 commits into from Jan 31, 2022

Conversation

timj
Copy link
Member

@timj timj commented Jan 28, 2022

This implementation can read old pickle files and force them to be frin the lsst.utils class.

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

PaulPrice and others added 30 commits January 27, 2022 17:07
By iterating with sys.modules.iteritems(), we're subject to a race
condition: if there's another thread (e.g., in scons) that does an
import, sys.modules will change while we're iterating over it.
Modernized with futurize command. Currently uses pickle rather than
attempting to use cPickle on legacy python.
Since we're reading from a set, the order of iteration isn't otherwise
guaranteed. Different order means different version string and hence spurious
failures.
Allows Packages to behave more like the dict that it contains.
This lets you bypass a file completely if using an
object store.
This forces the unpickling to always use this class
even if it was originally written as lsst.base.
The test was explicitly working around that function
not existing but now it can be used.
@codecov
Copy link

codecov bot commented Jan 28, 2022

Codecov Report

Merging #111 (c8ff301) into main (517bd56) will increase coverage by 0.23%.
The diff coverage is 93.48%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #111      +/-   ##
==========================================
+ Coverage   91.28%   91.51%   +0.23%     
==========================================
  Files          36       38       +2     
  Lines        2156     2417     +261     
==========================================
+ Hits         1968     2212     +244     
- Misses        188      205      +17     
Impacted Files Coverage Δ
python/lsst/utils/packages.py 90.47% <90.47%> (ø)
tests/test_packages.py 98.92% <98.92%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 517bd56...c8ff301. Read the comment docs.

We don't include any module for which we cannot determine a version.
"""
# Attempt to import libraries that only report their version in python
for module_name in PYTHON:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is why galsim always turns up in the version information even when we aren't using it.

.github/workflows/build.yaml Outdated Show resolved Hide resolved
python/lsst/utils/packages.py Outdated Show resolved Hide resolved
python/lsst/utils/packages.py Show resolved Hide resolved
tests/test_packages.py Outdated Show resolved Hide resolved
@timj timj merged commit 63a1f4f into main Jan 31, 2022
@timj timj deleted the tickets/DM-33403 branch January 31, 2022 19:36
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 this pull request may close these issues.

None yet

7 participants