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

Preparation for PyPI and other fixes #212

Merged
merged 26 commits into from
Jan 13, 2025
Merged

Conversation

weaverba137
Copy link
Member

@weaverba137 weaverba137 commented Jan 10, 2025

This PR:

  • Fixes odd (wrong?) desiname #211, and expands tests to catch the specific cases.
  • Fixes annotate_fits warning about overriding units that aren't changing #210.
  • Expands the GitHub Actions CI matrix to include recent Python, Astropy, Numpy.
  • Identifies a previously-hidden optional dependency on speclite.
  • Adds a test to ensure that all scripts in bin/ are registered in setup.cfg.
  • Replaces pkg_resources with importlib.resources.
  • Removes desiutil.setup.DesiTest. That class was causing some serious problems with recent versions of setuptools. Eventually we will want to remove other classes from desiutil.setup, but removing just that one is good enough for now.
  • Code style clean-up, since lots more people may be seeing the package on PyPI.

However this PR is a WIP, since there are some open issues:

  • Since the last time we froze the IERS data in desiutil, the format of the data files provided by IERS -- i.e. the organization -- has changed, and Astropy 7 expects this new format. We cannot use the existing iers_frozen.ecsv file with Astropy 7. However, we should also no longer need to use this file, since Astropy itself provides frozen versions. I think we still need to change the configuration to disable downloads, but I don't think we need to maintain a separate, frozen data file. This needs to be tested.
  • This line throws a lot of deprecation warnings. It appears that exists to fix a very, very old problem, that I believe has now been fixed upstream, but in any case, at some point, it will stop working. Please take a look at the comments immediately above that line. We need to do some tests to determine how this actually works now.
  • I propose that we tag desiutil 3.5.0 after merging this PR, and then shortly after create a desiutil 4.0.0 which will fully-implement the deprecations listed in the doc/changes.rst file.

Finally, I have confirmed with a test version of the PyPI repository that desiutil can be successfully uploaded to PyPI.

@weaverba137 weaverba137 added the WIP Work in Progress label Jan 10, 2025
@weaverba137 weaverba137 self-assigned this Jan 10, 2025
@coveralls
Copy link

coveralls commented Jan 10, 2025

Coverage Status

coverage: 77.006% (+0.8%) from 76.157%
when pulling 04e1bfc on expand-dependency-tests
into b834ec4 on main.

@weaverba137
Copy link
Member Author

After some testing, I've modified the .names() method of bitmasks both avoid lots of warnings and work with both Numpy < 2 and Numpy >= 2.

Copy link
Member

@akremin akremin left a comment

Choose a reason for hiding this comment

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

Thank you, Ben. I only reviewed names.py and the corresponding tests. The updates look great and bonus points for the clear comments explaining the various zero-pad choices. I'm happy with the changes and will approve that portion of the PR.

@weaverba137
Copy link
Member Author

Thank you @akremin!

Copy link
Contributor

@sbailey sbailey left a comment

Choose a reason for hiding this comment

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

Thanks for these updates. I put in one substantive comment about the dust ebv API change for consideration to postpone until we are making other non-backwards compatible changes for the 4.0 tag. I suggest that we not tackle the iers format change here beyond what you've already done with logging a warning; let's save that for a dedicated PR.

Either way, let's not merge this until Monday so that we aren't making a big update just before the weekend.

py/desiutil/dust.py Outdated Show resolved Hide resolved
py/desiutil/depend.py Show resolved Hide resolved
py/desiutil/test/test_install.py Show resolved Hide resolved
Copy link
Member

@moustakas moustakas left a comment

Choose a reason for hiding this comment

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

One quick comment in case it's helpful: in FastSpecFit I fully deprecated the setup.cfg file and ported the equivalent functionality to the pyproject.toml file, as recommended by PEP 621 (see also pypa/setuptools#3683). That's obviously not necessary here but I did want to advertise the effort in case we decide to pursue this change for any of the other DESI packages.

Otherwise, the changes here all look excellent.

@weaverba137
Copy link
Member Author

@moustakas, thank you, I should take a closer look at that. We might want to consider applying that to a (near) future desiutil 4.0.

py/desiutil/test/test_install.py Outdated Show resolved Hide resolved
@weaverba137
Copy link
Member Author

@sbailey, let's discuss some deployment considerations this afternoon before merging.

@weaverba137
Copy link
Member Author

The IERS table issue is moved to #214.

@weaverba137 weaverba137 merged commit 3ab0cff into main Jan 13, 2025
48 checks passed
@weaverba137 weaverba137 deleted the expand-dependency-tests branch January 13, 2025 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP Work in Progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

odd (wrong?) desiname annotate_fits warning about overriding units that aren't changing
5 participants