-
Notifications
You must be signed in to change notification settings - Fork 37
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
Fix build failure on Python 3.12 #1714
Conversation
This failed for me locally as well, while building stregion locally from master passes. Not sure why this fails. |
@jhunkeler Feel free to merge this if it is ready to merge. |
Not ready to merge yet but I'm getting closer.
|
Just an FYI: It'll be a while before we can test against 2.0. |
Let's try with the latest numpy then. I want to see the deprecation warnings so we can fix them. Or is there a test already running with the latest numpy? |
@nden At the moment the job is picking up numpy-1.26.2. Do want the tests to use the latest 1.2x development package ( |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1714 +/- ##
==========================================
- Coverage 33.80% 31.14% -2.66%
==========================================
Files 126 159 +33
Lines 31157 35102 +3945
Branches 5710 0 -5710
==========================================
+ Hits 10532 10933 +401
- Misses 19439 24169 +4730
+ Partials 1186 0 -1186 ☔ View full report in Codecov by Sentry. |
Ah, never mind. There doesn't appear to be any dev packages for the 1.x release series. Good news though. The |
#git+https://github.com/astropy/astroquery.git#egg=astroquery | ||
--extra-index-url https://pypi.anaconda.org/astropy/simple astropy --pre | ||
|
||
--extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need the index-url to install the nightly builds of numpy and scipy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I managed to avoid putting these in the file by adjusting the index for the devdeps
target. The extra arguments were causing tox's parser to fail. I'll double-check, though I think adding the extra index then asking for >=0.0.dev0
is roughly equivalent to calling pip install --extra-index-url https://index/here --pre
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding the nightly builds for numpy. 2.x didn't work at all when I tried. Pip consistently reverted it back to 1.x because at least one or more packages elsewhere were pinning numpy<2.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see. Were these our packages or third party?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish I'd kept the logs. I'll find out.
Meanwhile you helped me realize I'd forgotten the .dev0
suffix on the numpy
line... So that's fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. contourpy 1.2.0 requires numpy<2.0,>=1.20, but you have numpy 2.0.0.dev0 which is incompatible.
matplotlib 3.8.2 requires numpy<2,>=1.21, but you have numpy 2.0.0.dev0 which is incompatible.
pandas 2.1.4 requires numpy<2,>=1.22.4; python_version < "3.11", but you have numpy 2.0.0.dev0 which is incompatible.
scikit-learn 1.3.2 requires numpy<2.0,>=1.17.3, but you have numpy 2.0.0.dev0 which is incompatible.
If I satisfy the requirements by installing the development versions for the packages above, pytest greets me with an endless wall of text telling me to rebuild all packages from source that haven't been linked to numpy 2.0, followed by a stream of ABI errors:
RuntimeError: module compiled against ABI version 0x1000009 but this version of numpy is 0x2000000
Drizzlepac has so many dependencies. Pip's incompatibility warnings only display packages with explicit pins (<2.0
). It doesn't account for wheels providing packages with incompatible linkage.
requirements-dev.txt
Outdated
--extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple | ||
numpy>=0.0.dev0 | ||
#git+https://github.com/astropy/astroquery.git | ||
numpy<2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we test with numpy 2.0 dev?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jhunkeler Feel free to merge when you think it's ready
* Only applies to the latest interpreter. < 3.12 job use release requirements.
* Remove extraneous arguments (i.e. --extra-index-url, --pre) due to incompatibilities with tox * Do not produce egg packages. Flat packages and wheels are preferred. * Prevent the usage of numpy 2.0 for now
* Use "test" extras at install-time to avoid repeating dependencies in the config * Remove pytest and ci_watson (already provided by "test" extras) * Add setuptools to prevent pkg_resources error from pkg_resources import get_distribution, DistributionNotFound E ModuleNotFoundError: No module named "pkg_resources" * Use configure devdeps target to use development packages * Remove commands_pre call. The actions are taken too late in the build process to be effective.
6036c3f
to
8b7c73b
Compare
Here is a listing of all packages that fail to import when numpy 2.0 is installed in the Script used: https://gist.github.com/jhunkeler/ee5513cb73eb96acac259ca1033df4e6 Command: Output:
|
Co-authored-by: Steve Goldman <32876747+s-goldman@users.noreply.github.com>
Resolves N/A
Ref #1696 and #1702
This adds stregion to the requirements-dev.txt file to fix the build error on Python 3.12.
Checklist for maintainers
CHANGELOG.rst
within the relevant release sectionHow to run regression tests on a PR