-
Notifications
You must be signed in to change notification settings - Fork 6
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
ci: Fix workflow failure caused by missing Python 3.7 in the latest macOS runner. #42
Conversation
WalkthroughThe changes in the pull request involve modifications to the GitHub Actions workflow configuration in Changes
Sequence Diagram(s)sequenceDiagram
participant A as GitHub Actions
participant B as Code Repository
participant C as Python 3.7
participant D as Python 3.8
participant E as Python 3.11
A->>B: Checkout code
A->>C: Setup Python 3.7
A->>C: Download wheels for Python 3.7
A->>C: Install dependencies
A->>C: Run unit tests
A->>B: Checkout code
A->>D: Setup Python 3.8
A->>D: Download wheels for Python 3.8
A->>D: Install dependencies
A->>D: Run unit tests
A->>B: Checkout code
A->>E: Setup Python 3.11
A->>E: Download wheels for Python 3.11
A->>E: Install dependencies
A->>E: Run unit tests
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (2)
.github/workflows/package.yaml (2)
41-46
: Add comments explaining Python 3.7 special handlingSince this job specifically handles Python 3.7 testing due to macOS compatibility issues, it would be helpful to add comments explaining why this separation exists and the dependency on Python 3.8 wheels.
Add a comment like this:
+ # Separate job for Python 3.7 testing due to its unavailability on macOS 14 (arm64). + # Uses Python 3.8 wheels as they maintain compatibility with Python 3.7. test-python37:
82-84
: Update GitHub Actions to latest versionsConsider updating the following actions to their latest versions for improved security and features:
actions/checkout@v3
→actions/checkout@v4
actions/download-artifact@v3
→actions/download-artifact@v4
Also applies to: 62-62
🧰 Tools
🪛 actionlint (1.7.4)
82-82: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
84-84: the runner of "actions/setup-python@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
.github/workflows/package.yaml
(2 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/package.yaml
62-62: the runner of "actions/download-artifact@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
82-82: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
84-84: the runner of "actions/setup-python@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🔇 Additional comments (2)
.github/workflows/package.yaml (2)
78-78
: Verify macOS runner version
Please verify that macos-latest
resolves to macOS 14 as intended. If specific version guarantees are needed, consider using an explicit version like macos-14
.
Line range hint 41-98
: Overall changes look good
The workflow restructuring successfully addresses the Python 3.7 compatibility issue on macOS while maintaining a clean separation that will facilitate future removal of Python 3.7 support. The implementation aligns well with the PR objectives.
🧰 Tools
🪛 actionlint (1.7.4)
56-56: the runner of "actions/download-artifact@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
62-62: the runner of "actions/download-artifact@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
82-82: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
84-84: the runner of "actions/setup-python@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
89-89: the runner of "actions/download-artifact@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
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.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (1)
.github/workflows/package.yaml (1)
41-46
: Consider standardizing the job name formatThe job name
test-python37
uses a different format than typical semantic versioning. Consider usingtest-python-3.7
for better consistency with version number formatting.- test-python37: + test-python-3.7:
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
.github/workflows/package.yaml
(2 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/package.yaml
76-76: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
78-78: the runner of "actions/setup-python@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🔇 Additional comments (1)
.github/workflows/package.yaml (1)
68-74
: Verify workflow job dependencies
The job structure looks good, but let's verify that all necessary artifacts are available for both test jobs.
✅ Verification successful
Job dependencies and artifacts are correctly configured
The workflow structure is well-organized with proper artifact handling:
- The build job generates wheels for both Python 3.8 and 3.11
- Each test job downloads the corresponding wheel artifact matching its Python version
- The test-python37 job specifically uses the Python 3.8 wheel, which is compatible with Python 3.7
- All test jobs properly depend on the build job completion
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify that the workflow generates all required wheel artifacts
# Check if wheel artifacts are defined for all Python versions
rg -A 2 'name: wheel-' .github/workflows/package.yaml | grep -E 'wheel-(3\.[0-9]+)'
Length of output: 111
Script:
#!/bin/bash
# Let's check the complete build job configuration to understand artifact generation
cat .github/workflows/package.yaml
Length of output: 2113
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} |
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.
🛠️ Refactor suggestion
Update GitHub Actions to latest versions
Several actions are using older versions. Consider updating to the latest stable versions for improved security and features:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- - uses: actions/setup-python@v4
+ - uses: actions/setup-python@v5
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} |
🧰 Tools
🪛 actionlint (1.7.4)
76-76: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
78-78: the runner of "actions/setup-python@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
.github/workflows/package.yaml (1)
Line range hint
49-52
: Update GitHub Actions to latest versionsSeveral actions are using older versions. Consider updating to the latest stable versions for improved security and features:
- - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5🧰 Tools
🪛 actionlint (1.7.4)
49-49: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
.github/workflows/package.yaml
(2 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/package.yaml
77-77: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
79-79: the runner of "actions/setup-python@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🔇 Additional comments (3)
.github/workflows/package.yaml (3)
Line range hint 41-68
: LGTM! Good job separating Python 3.7 testing
The configuration correctly handles Python 3.7 testing on macOS 13, which resolves the original issue with macOS 14 compatibility. The comment explaining the use of Python 3.8 wheel is helpful for future maintenance.
🧰 Tools
🪛 actionlint (1.7.4)
56-56: the runner of "actions/download-artifact@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
77-77: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
79-79: the runner of "actions/setup-python@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
84-84: the runner of "actions/download-artifact@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
Line range hint 69-94
: LGTM! Proper configuration for Python 3.8+ testing
The job is well-structured and correctly uses the latest macOS runner for Python versions that support it.
🧰 Tools
🪛 actionlint (1.7.4)
56-56: the runner of "actions/download-artifact@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
77-77: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
79-79: the runner of "actions/setup-python@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
84-84: the runner of "actions/download-artifact@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
77-81
: Update GitHub Actions to latest versions
🧰 Tools
🪛 actionlint (1.7.4)
77-77: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
79-79: the runner of "actions/setup-python@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
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.
For the PR title, how about:
ci: Fix workflow failure caused by missing Python 3.7 in the latest macOS runner.
Co-authored-by: kirkrodrigues <[email protected]>
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
.github/workflows/package.yaml (1)
41-46
: Document Python 3.7 EOL status and future plansSince Python 3.7 reached end-of-life over a year ago, consider adding a comment explaining why we're maintaining Python 3.7 support and when we plan to remove it.
Add a comment like:
test-python37: needs: [build] + # TODO: Remove Python 3.7 support in future release as it reached EOL on 2023-06-27 + # Maintained temporarily for backwards compatibility strategy: matrix: os: [macos-13, ubuntu-latest] python-version: ["3.7"]
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
.github/workflows/package.yaml
(2 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/package.yaml
77-77: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
79-79: the runner of "actions/setup-python@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🔇 Additional comments (2)
.github/workflows/package.yaml (2)
77-81
: 🛠️ Refactor suggestion
Update GitHub Actions to latest versions
Several actions are using older versions. Consider updating to the latest stable versions for improved security and features.
Apply this diff:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- - uses: actions/setup-python@v4
+ - uses: actions/setup-python@v5
Note: This same update should be applied to all occurrences of these actions in the workflow file.
🧰 Tools
🪛 actionlint (1.7.4)
77-77: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
79-79: the runner of "actions/setup-python@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
58-60
: Verify Python 3.8 wheel compatibility with Python 3.7
While the comment explains why we're using the Python 3.8 wheel, we should verify that this doesn't introduce compatibility issues.
✅ Verification successful
Based on the codebase analysis, I can now provide a definitive response regarding the Python 3.8 wheel compatibility with Python 3.7.
Python 3.7 compatibility is confirmed
The codebase shows no usage of Python 3.8-specific features that would break compatibility with Python 3.7:
- No usage of assignment expressions (walrus operator)
- No positional-only parameters
- No f-string
=
specifier - The imports and type hints used are compatible with Python 3.7
- The only special import handling is for
zoneinfo
, which has a proper fallback tobackports.zoneinfo
for older Python versions
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for Python version specific features or dependencies
rg -g '*.py' -A 5 'from __future__ import' || \
rg -g '*.py' -A 5 '@typing\.' || \
rg -g 'requirements*.txt' -A 5 'python_version'
Length of output: 124
Script:
#!/bin/bash
# Check for Python version requirements in setup files and other configuration
fd -e py setup.py -x cat {} \; || \
fd -g 'pyproject.toml' -x cat {} \; || \
fd -g '*requirements*.txt' -x cat {} \; || \
fd -g 'tox.ini' -x cat {} \;
Length of output: 35
Script:
#!/bin/bash
# Let's check the actual Python files to understand the codebase structure and dependencies
fd -e py -x echo "=== {} ===" \; -x cat {} \; || \
fd -g '*.py' -x echo "=== {} ===" \; -x cat {} \;
Length of output: 97211
References
Description
The package workflow failed in the current repo: https://github.com/LinZhihao-723/clp-loglib-py/actions/runs/12060286918, which is because Python3.7 is no longer valid in the latest macos runner (macos14) for arm64.
This PR fixes the issue by testing Python3.7 in macos13. It redoes part of the changes in #41 to create a stand-alone test section for Python 3.7 to facilitate the management of our workflow config. It also makes it easier to fully remove Python 3.7 testing if we drop support for Python 3.7 (which may be soon 'cuz Python 3.7 has been reached EOL for longer than a year). For Python versions higher than 3.7, we stick to the latest macos runner to ensure the Apple silicon is tested.
Validation performed
Ensure workflows all passed.
Summary by CodeRabbit
New Features
Changes