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

chore: Drop Python 3.8, fix issues with CI #2566

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

chore: Drop Python 3.8, fix issues with CI #2566

wants to merge 16 commits into from

Conversation

kratsg
Copy link
Contributor

@kratsg kratsg commented Dec 21, 2024

Pull Request Description

Drop python 3.8 support (would be hard to fix most typing-related issues anyway). This will also fix maintenance issues with the CI we've been having hopefully.

Also linkcheck gives 403 for some URLs because they're blocking HEADs now... not sure why that changed.

for academic.oup.com

$ curl -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:131.0) Gecko/20100101 Firefox/131.0" --head https://academic.oup.com/ptep/article/doi/10.1093/ptep/ptad144/7459362
HTTP/2 403
date: Sat, 21 Dec 2024 15:59:02 GMT
content-type: text/html; charset=UTF-8
content-length: 8743
accept-ch: Sec-CH-UA-Bitness, Sec-CH-UA-Arch, Sec-CH-UA-Full-Version, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform-Version, Sec-CH-UA-Full-Version-List, Sec-CH-UA-Platform, Sec-CH-UA, UA-Bitness, UA-Arch, UA-Full-Version, UA-Mobile, UA-Model, UA-Platform-Version, UA-Platform, UA
critical-ch: Sec-CH-UA-Bitness, Sec-CH-UA-Arch, Sec-CH-UA-Full-Version, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform-Version, Sec-CH-UA-Full-Version-List, Sec-CH-UA-Platform, Sec-CH-UA, UA-Bitness, UA-Arch, UA-Full-Version, UA-Mobile, UA-Model, UA-Platform-Version, UA-Platform, UA
cross-origin-embedder-policy: require-corp
cross-origin-opener-policy: same-origin
cross-origin-resource-policy: same-origin
origin-agent-cluster: ?1
permissions-policy: accelerometer=(),autoplay=(),browsing-topics=(),camera=(),clipboard-read=(),clipboard-write=(),geolocation=(),gyroscope=(),hid=(),interest-cohort=(),magnetometer=(),microphone=(),payment=(),publickey-credentials-get=(),screen-wake-lock=(),serial=(),sync-xhr=(),usb=()
referrer-policy: same-origin
x-content-options: nosniff
x-frame-options: SAMEORIGIN
cf-mitigated: challenge
cf-chl-out: kI3rohlrq71KKbX3Nu5hEk+BZm/glZYADDHnftN2mhoifmycVKBIEKZYvPCsVb+xsTEwla38Dd5bmTzO5Zp1DqjaKNHtcAHESRv5Df0hp5cFOzHELElOSA4pTk2t2zdF8wKDrblHVBoC2DQeg2+wvw==$NSFsXK2alPB8IfU0cnzHYA==
cache-control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
expires: Thu, 01 Jan 1970 00:00:01 GMT
set-cookie: __cf_bm=exWKl5QVT3Iw5iQaVpCxbexRIUQTkPiI1lk1izdzRtQ-1734796742-1.0.1.1-BwvBPQzFIvTKf0JO9umxyVZjkbA1Yoi6Ci1uTiHurJ24dBv2dcohoqmsUBkRU3SC_qHJQ5euBC9fT5p4G4HBDg; path=/; expires=Sat, 21-Dec-24 16:29:02 GMT; domain=.academic.oup.com; HttpOnly; Secure; SameSite=None
server: cloudflare
cf-ray: 8f5913baf8e48da6-MIA

for journals.aps.org

$ curl -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:131.0) Gecko/20100101 Firefox/131.0" --head https://journals.aps.org/prd/abstract/10.1103/PhysRevD.106.032005
HTTP/2 403
date: Sat, 21 Dec 2024 16:02:20 GMT
content-type: text/html; charset=UTF-8
content-length: 8677
accept-ch: Sec-CH-UA-Bitness, Sec-CH-UA-Arch, Sec-CH-UA-Full-Version, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform-Version, Sec-CH-UA-Full-Version-List, Sec-CH-UA-Platform, Sec-CH-UA, UA-Bitness, UA-Arch, UA-Full-Version, UA-Mobile, UA-Model, UA-Platform-Version, UA-Platform, UA
critical-ch: Sec-CH-UA-Bitness, Sec-CH-UA-Arch, Sec-CH-UA-Full-Version, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform-Version, Sec-CH-UA-Full-Version-List, Sec-CH-UA-Platform, Sec-CH-UA, UA-Bitness, UA-Arch, UA-Full-Version, UA-Mobile, UA-Model, UA-Platform-Version, UA-Platform, UA
cross-origin-embedder-policy: require-corp
cross-origin-opener-policy: same-origin
cross-origin-resource-policy: same-origin
origin-agent-cluster: ?1
permissions-policy: accelerometer=(),autoplay=(),browsing-topics=(),camera=(),clipboard-read=(),clipboard-write=(),geolocation=(),gyroscope=(),hid=(),interest-cohort=(),magnetometer=(),microphone=(),payment=(),publickey-credentials-get=(),screen-wake-lock=(),serial=(),sync-xhr=(),usb=()
referrer-policy: same-origin
x-content-options: nosniff
x-frame-options: SAMEORIGIN
cf-mitigated: challenge
cf-chl-out: 1GM7L6OnEIhUA3Nu78SsSXsSZPAKkHusPvR9rzOM+i94tqt6nJbC6KqH+WQcDpnX8c7VY59qsL5H7k14HA/7XtJvoWjCKBm6mKwjXcEfoNtFIA/B+0lWpJumsFsbjBrRK2PmdOH3Uyb6DMRmZXWYCw==$ndOh1e20Lbf2J+XAsQTYgQ==
cache-control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
expires: Thu, 01 Jan 1970 00:00:01 GMT
server: cloudflare
cf-ray: 8f59188e4f4d7469-MIA
alt-svc: h3=":443"; ma=86400

Checklist Before Requesting Reviewer

  • Tests are passing
  • "WIP" removed from the title of the pull request
  • Selected an Assignee for the PR to be responsible for the log summary

Before Merging

For the PR Assignees:

  • Summarize commit messages into a comprehensive review of the PR
* drop python 3.8 support everywhere
* fix failing CI on main branch by moving from python 3.9 to python 3.10 for the mypy minimum python check, due to numpy typing being improved in 3.10+
* disable linkchecks for aps.org, academic.oup.com as they 403 all HEAD requests
* cast modifier masks to the default_backend's `bool` array initially to resolve pytorch warnings
* migrate `get_backend` to resolve import issues seen in the CI
* fix doctest failures on macos-13 compared to ubuntu-latest due to differing numpy major versions being picked up in the CI (ubuntu gets 2.x while macos is getting 1.x) which has different `repr` for some common functions

@kratsg kratsg added feat/enhancement New feature or request tests pytest CI CI systems, GitHub Actions fix A bug fix chore Other changes that don't modify src or test files packaging setup.py, setup.cfg, pyproject.toml, and friends type checking Related to types and type checking python Pull requests that update Python code Windows Issue related to Microsoft Windows labels Dec 21, 2024
@kratsg kratsg self-assigned this Dec 21, 2024
@kratsg kratsg changed the title chore: Drop Python 3.8 chore: Drop Python 3.8, fix issues with CI Dec 21, 2024
Copy link

codecov bot commented Dec 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.24%. Comparing base (3d26434) to head (42a5249).
Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2566      +/-   ##
==========================================
+ Coverage   98.21%   98.24%   +0.02%     
==========================================
  Files          69       69              
  Lines        4543     4546       +3     
  Branches      804      467     -337     
==========================================
+ Hits         4462     4466       +4     
  Misses         48       48              
+ Partials       33       32       -1     
Flag Coverage Δ
contrib 97.95% <100.00%> (+0.15%) ⬆️
doctest 98.24% <100.00%> (+0.15%) ⬆️
unittests-3.10 96.39% <94.91%> (+0.15%) ⬆️
unittests-3.11 96.39% <94.91%> (+0.15%) ⬆️
unittests-3.12 96.39% <94.91%> (+0.15%) ⬆️
unittests-3.8 ?
unittests-3.9 96.43% <96.61%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@@ -120,7 +120,7 @@ def cdf(self, value):
>>> import pyhf
>>> pyhf.set_backend("numpy")
>>> bkg_dist = pyhf.infer.calculators.AsymptoticTestStatDistribution(0.0)
>>> bkg_dist.cdf(0.0)
>>> print(bkg_dist.cdf(0.0))
Copy link
Member

Choose a reason for hiding this comment

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

Did something change RE: the way doctest works where the prints are now necessary? We had always treated this like REPL behavior, not script behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, numpy changed. ubuntu-latest has numpy 2.x which gives np.float64(0.0) while macos-13 uses numpy 1.x which gives 0.0 -- we can't write a test that relies on repr for two diff major versions of numpy.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

>>> import numpy as np
>>> np.__version__
'2.0.2'
>>> np.float64(0.0)
np.float64(0.0)
>>> print(np.float64(0.0))
0.0

and

>>> import numpy as np
>>> np.__version__
'1.26.4'
>>> np.float64(0.0)
0.0
>>> print(np.float64(0.0))
0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Other changes that don't modify src or test files CI CI systems, GitHub Actions feat/enhancement New feature or request fix A bug fix packaging setup.py, setup.cfg, pyproject.toml, and friends python Pull requests that update Python code tests pytest type checking Related to types and type checking Windows Issue related to Microsoft Windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants