-
Couldn't load subscription status.
- Fork 90
build: Drop support for Python 3.8 #2625
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
base: main
Are you sure you want to change the base?
build: Drop support for Python 3.8 #2625
Conversation
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.
Pull Request Overview
This PR drops support for Python 3.8 and adopts Python 3.9+ features, simplifying the codebase by removing compatibility shims and leveraging improved typing capabilities.
Key changes:
- Removed conditional imports for
importlib.resources(now always available in Python 3.9+) - Updated type hints to use built-in generic types (
list,tuple,set) and moved abstract types (Sequence,Mapping) fromtypingtocollections.abc - Simplified archive validation logic in
contrib/utils.pyto use directis_tarfile/is_zipfilechecks instead of try-except pattern
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tests/contrib/test_viz.py |
Removed Python 3.8 version check xfail decorator |
src/pyhf/utils.py |
Removed conditional import for importlib_resources |
src/pyhf/typing.py |
Updated to use built-in generics and collections.abc imports |
src/pyhf/tensor/numpy_backend.py |
Added type ignore comment and cast for improved type checking |
src/pyhf/schema/variables.py |
Removed conditional import for importlib_resources |
src/pyhf/schema/validator.py |
Moved Mapping import to collections.abc |
src/pyhf/schema/loader.py |
Removed conditional import for importlib_resources |
src/pyhf/readxml.py |
Updated type hints to use built-in generics and collections.abc |
src/pyhf/pdf.py |
Changed List[bool] return type to list[bool] |
src/pyhf/parameters/paramsets.py |
Changed List[bool] return type to list[bool] |
src/pyhf/modifiers/staterror.py |
Changed List[bool] parameter type to list[bool] |
src/pyhf/mixins.py |
Moved Sequence import to collections.abc |
src/pyhf/contrib/utils.py |
Refactored archive validation from try-except to if-elif-else structure |
pyproject.toml |
Updated minimum Python version to 3.9 and removed 3.8 classifier |
.pre-commit-config.yaml |
Updated mypy checks from Python 3.8 to 3.10 |
.github/workflows/release_tests.yml |
Removed Python 3.8 from test matrix |
.github/workflows/lower-bound-requirements.yml |
Updated minimum Python version from 3.8 to 3.9 |
.github/workflows/ci.yml |
Removed Python 3.8 from CI test matrix |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| .. versionadded:: 0.7.0 | ||
| """ | ||
| return tensor_in.transpose() | ||
| return cast(ArrayLike, tensor_in.transpose()) |
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.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2625 +/- ##
==========================================
- Coverage 98.23% 98.23% -0.01%
==========================================
Files 65 65
Lines 4198 4190 -8
Branches 592 452 -140
==========================================
- Hits 4124 4116 -8
Misses 45 45
Partials 29 29
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
7c7aa31 to
6b95ab7
Compare
Sonnet 4's summary: > The mypy error occurred because the transpose() method on line 659 was > returning a value that mypy inferred as Any, while the function signature > declared it should return ArrayLike. Mypy's no-any-return rule flags when > you return an Any value from a function with a specific return type annotation.
6b95ab7 to
595ca57
Compare
Description
Pulling in parts of PR #2566
features or solutions.
Checklist Before Requesting Reviewer
Before Merging
For the PR Assignees: