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

Actually use the astropy nightly wheel. #795

Merged

Conversation

WilliamJamieson
Copy link
Collaborator

@WilliamJamieson WilliamJamieson commented Jul 26, 2023

Currently, the Jenkins devdeps job is failing because something on the Jenkins machine has changed enough so that it can no longer build astropy wheels natively (some sort of compiler/base-library issue). Unlike the previous attempts at using the astropy nightly wheel this PR actually uses that wheel.

Also as a workaround to #793, this PR forces numpy 2.0.dev+ versions to use the legacy numpy 1.25 floating point (print) representation. Note that this will only work around this issue for the unit tests. ASDF will need to resolve this issue in order to have a general solution.

Checklist

  • added entry in CHANGES.rst under the corresponding subsection
  • updated relevant tests
  • updated relevant documentation
  • updated relevant milestone(s)
  • added relevant label(s)

@WilliamJamieson WilliamJamieson requested a review from a team as a code owner July 26, 2023 22:43
@github-actions github-actions bot added the dependencies Pull requests that update a dependency file label Jul 26, 2023
@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Patch coverage: 75.00% and project coverage change: -0.01% ⚠️

Comparison is base (eb490a3) 77.07% compared to head (f0a7653) 77.07%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #795      +/-   ##
==========================================
- Coverage   77.07%   77.07%   -0.01%     
==========================================
  Files          94       94              
  Lines        5680     5684       +4     
==========================================
+ Hits         4378     4381       +3     
- Misses       1302     1303       +1     
Flag Coverage Δ *Carryforward flag
nightly 64.15% <ø> (ø) Carriedforward from eb490a3

*This pull request uses carry forward flags. Click here to find out more.

Files Changed Coverage Δ
romancal/conftest.py 53.84% <75.00%> (+1.76%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Due to ASDF issues related to changes in how `numpy` 2.0 represents
for the purposes of printing floats (used by ASDF), PyYAML can no longer
handle the new representation gracefully.
This change simply forces `numpy` 2.0.dev+ versions of numpy to use the
`numpy` 1.25 representation format, which is supported by PyYAML.
Note that this "fix" only works when running tests, not in general.
@WilliamJamieson WilliamJamieson force-pushed the bugfix/jenkins_devdeps branch from 74d8f30 to f0a7653 Compare July 26, 2023 22:49
@WilliamJamieson
Copy link
Collaborator Author

WilliamJamieson commented Jul 26, 2023

Proof that it is now using a prebuilt dev wheel: https://github.com/spacetelescope/romancal/actions/runs/5674451888/job/15378017238#step:10:269 (line 268 of the tox output)

@WilliamJamieson
Copy link
Collaborator Author

WilliamJamieson commented Jul 26, 2023

This passes the regression tests: https://plwishmaster.stsci.edu:8081/job/RT/job/Roman-Developers-Pull-Requests/298/

Note that I did not run the Roman-devdeps tests on this because that would require me to modify the configuration of that test suite. Instead I modified the Roman-Developers-Pull-Requests job to both point at this version of romancal AND use the JenkinsfileRT_dev instead of its normal JenkinsfileRT.

Observe that the dev version of astropy (6.0.dev...) does in fact make it into the Jenkins regression tests job too:

Screenshot 2023-07-26 at 7 17 58 PM

Comment on lines +8 to +14
from astropy.utils import minversion

# HACK: This is a temporary workaround for ASDF not being able to handle how
# numpy 2.0.dev+ represents (prints) floating point numbers. This simply
# forces numpy to use the old printing method while running the tests only.
if minversion(np, "2.0.dev"):
np.set_printoptions(legacy="1.25")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This has been added only so that the devdeps CI and regression tests can be demonstrated to fully work by covering over a known issue in ASDF.

@@ -1,7 +1,7 @@
git+https://github.com/asdf-format/asdf
git+https://github.com/asdf-format/asdf-transform-schemas
git+https://github.com/asdf-format/asdf-wcs-schemas
git+https://github.com/astropy/astropy
--extra-index-url https://pypi.anaconda.org/astropy/simple astropy --pre
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The extra-index-url listed in the tox.ini really ought to be moved here.

Copy link
Collaborator

@zacharyburnett zacharyburnett left a comment

Choose a reason for hiding this comment

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

LGTM, sorry this has been a runaround for so long. I'll work on removing --upgrade-strategy eager as well as that has seemed to cause more problems than its worth

Copy link
Collaborator

@ddavis-stsci ddavis-stsci left a comment

Choose a reason for hiding this comment

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

I think this is a bit premature. If Jenkins is having trouble building astropy wheels shouldn't we file an SPB ticket and if they can't fix it then do the workaround?

@WilliamJamieson
Copy link
Collaborator Author

WilliamJamieson commented Jul 27, 2023

I think this is a bit premature. If Jenkins is having trouble building astropy wheels shouldn't we file an SPB ticket and if they can't fix it then do the workaround?

This is not a work around. Astropy builds a new dev wheel every week or so and uploads it here.

It is my understanding that @nden wanted us to move all the pipeline development testing from building wheels ourselves to using the prebuilt development wheels. I do not think that we should be in the business of attempting to support building libraries that we do not have to.

Moreover, this is a correctly functioning version of the astropy wheel building changes proposed by #695, which was approved without issue.

@nden
Copy link
Collaborator

nden commented Jul 27, 2023

I think the goal is to test working with the latest available dev version of astropy. We can assume they are testing their build system. Let's use the wheels for packages where available to speed up testing, since what we are testing is new functionality changes in dependencies, not their build systems. This is not a new way of running the devdeps tests afaik.

@pllim
Copy link
Contributor

pllim commented Jul 27, 2023

Hi, astropy core maintainer here. 👋

It is my advice that you use the dev wheel that we provide instead of trying to build it yourself. We generate wheels for all the major architectures on versions that we support. If you switch to using our wheel and the system is unable to find one, it might be an indication that you have to upgrade stuff on your end.

In addition, using wheel better reflects how your users will actually run the whole stack. No one sane is going to try to build astropy from source downstream because the package has both C-extensions and Cython codes.

Hope this helps!

@ddavis-stsci ddavis-stsci dismissed their stale review July 27, 2023 15:20

Fine with me

@zacharyburnett zacharyburnett merged commit 200b9d4 into spacetelescope:main Jul 27, 2023
@WilliamJamieson WilliamJamieson deleted the bugfix/jenkins_devdeps branch July 27, 2023 19:32
@WilliamJamieson WilliamJamieson mentioned this pull request Jul 27, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants