-
Notifications
You must be signed in to change notification settings - Fork 10
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: Add workflow for releases from GHA #1117
Conversation
🧙 Sourcery has finished reviewing your pull request! Tips
|
WalkthroughThe updates encompass multiple enhancements to improve functionality, including workflow automation for building and publishing releases, macOS version updates, and codebase compatibility upgrades. Key adjustments involve adding jobs in GitHub Actions for release management, Pydantic 2 compatibility improvements, refined import handling, and addressing text encoding in setup files. Overall, these changes streamline the build process, improve code stability, and ensure compatibility with updated dependencies. Changes
Poem
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 as PR comments)
Additionally, you can add CodeRabbit Configration 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.
We've reviewed this pull request using the Sourcery rules engine. If you would also like our AI-powered code review then let us know.
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/make_release.yml (1 hunks)
Additional comments not posted (3)
.github/workflows/make_release.yml (3)
11-24
: Verify the necessity of permissions and the appropriateness of the action.Ensure that the
write
permissions forattestations
andid-token
are necessary for thebuild_wheels
job. Additionally, verify that thehynek/build-and-inspect-python-package
action is suitable for your use case.
26-60
: Verify the appropriateness of steps for each OS and the correctness of dependency installations.Ensure that the steps for setting up Python, installing dependencies, and building/testing PyInstaller bundles are appropriate for each OS in the matrix. Additionally, verify that the dependencies are correctly installed, especially the conditional installation of Windows OpenGL libraries.
63-84
: Verify the appropriateness and security of steps for downloading artifacts and publishing to PyPI.Ensure that the steps for downloading artifacts using
actions/download-artifact
and publishing to PyPI usingpypa/gh-action-pypi-publish
are appropriate and secure. Verify that theid-token
permission is necessary and properly configured.
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- .github/workflows/make_release.yml (1 hunks)
- build_utils/create_and_pack_executable.py (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- .github/workflows/make_release.yml
Additional comments not posted (1)
build_utils/create_and_pack_executable.py (1)
26-28
: LGTM! The changes correctly handle macOS arm64 architecture.The logic to append "-arm64" to the archive file name if the platform is macOS and the machine is arm64 is implemented correctly.
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- .github/workflows/make_release.yml (1 hunks)
- Readme.md (1 hunks)
- changelog.md (1 hunks)
- launcher.spec (4 hunks)
Files skipped from review due to trivial changes (1)
- Readme.md
Files skipped from review as they are similar to previous changes (1)
- .github/workflows/make_release.yml
Additional context used
LanguageTool
changelog.md
[grammar] ~85-~85: The operating system from Apple is written “macOS”.
Context: ...] pre-commit autoupdate (#1103) - Bump macos runners to macos-13 (both azure and GHA...(MAC_OS)
Additional comments not posted (12)
launcher.spec (3)
67-67
: Approved: Necessary hidden imports added.The addition of "pkg_resources.py2_warn" and "ipykernel.datapub" to the
hiddenimports
list ensures these modules are included in the PyInstaller bundle.
95-95
: Approved: Include imageio known plugins.The inclusion of module names from
imageio_known_plugins
in thehiddenimports
list ensures that all known plugins fromimageio
are included in the PyInstaller bundle.
96-96
: Approved: Include skimage submodules.The inclusion of submodules from
skimage
that do not contain "tests" in thehiddenimports
list ensures that all necessary submodules are included in the PyInstaller bundle while excluding unnecessary test modules.changelog.md (9)
3-3
: Approved: Version header added.The version header for
0.15.3
with the date2024-07-03
correctly documents the new version and its release date.
7-7
: Approved: Feature entry added.The feature entry for Pydantic 2 compatibility correctly documents a new feature.
11-14
: Approved: Bug fix entries added.The bug fix entries for rendering icons, validation length of message, reader check, and napari compatibility correctly document the bug fixes included in this version.
18-21
: Approved: Refactor entries added.The refactor entries for fixing Qt flags and migrating to
pyproject.toml
correctly document the refactorings included in this version.
25-25
: Approved: Documentation entry added.The documentation entry for allowing the use of newer release of build docs dependencies correctly documents the documentation update included in this version.
29-45
: Approved: Testing entries added.The testing entries for automatic constraints upgrades and improvements to the test suite correctly document the testing updates included in this version.
49-87
: Approved: Miscellaneous tasks entries added.The miscellaneous tasks entries for pre-commit autoupdates, plugin page removal, coverage upload, actions updates, and more correctly document the miscellaneous tasks included in this version.
Tools
LanguageTool
[grammar] ~85-~85: The operating system from Apple is written “macOS”.
Context: ...] pre-commit autoupdate (#1103) - Bump macos runners to macos-13 (both azure and GHA...(MAC_OS)
91-99
: Approved: Security entries added.The security entries for dependency bumps correctly document the security updates included in this version.
103-104
: Approved: Build entries added.The build entries for fixing the bundling of a font file and updating references to GitHub releases correctly document the build updates included in this version.
- Exclude pyside2 on python 3.11 and 3.12 from testing (#1099) | ||
- \[pre-commit.ci\] pre-commit autoupdate (#1101) | ||
- \[pre-commit.ci\] pre-commit autoupdate (#1103) | ||
- Bump macos runners to macos-13 (both azure and GHA) (#1113) |
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.
Fix grammar: Capitalize "macOS".
The operating system from Apple is written “macOS”.
- Bump macos runners to macos-13 (both azure and GHA)
+ Bump macOS runners to macOS-13 (both azure and GHA)
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.
- Bump macos runners to macos-13 (both azure and GHA) (#1113) | |
- Bump macos runners to macos-13 (both azure and GHA) | |
+ Bump macOS runners to macOS-13 (both azure and GHA) |
Tools
LanguageTool
[grammar] ~85-~85: The operating system from Apple is written “macOS”.
Context: ...] pre-commit autoupdate (#1103) - Bump macos runners to macos-13 (both azure and GHA...(MAC_OS)
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- setup.py (1 hunks)
Additional comments not posted (2)
setup.py (2)
21-21
: Ensure proper text encoding forReadme.md
.The addition of
encoding="utf8"
to theopen()
call ensures that the file is read with the correct encoding, preventing potential issues with non-ASCII characters.
29-29
: Ensure proper text encoding forchangelog.md
.The addition of
encoding="utf8"
to theopen()
call ensures that the file is read with the correct encoding, preventing potential issues with non-ASCII characters.
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- .github/workflows/make_release.yml (1 hunks)
- pyproject.toml (2 hunks)
- setup.py (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- setup.py
Additional comments not posted (11)
.github/workflows/make_release.yml (7)
11-17
: Ensure proper permissions for thebuild_wheels
job.The permissions for
attestations
andid-token
are set towrite
. Verify that these permissions are necessary and do not pose a security risk.
26-31
: Consider adding macOS 14 to the matrix.The matrix strategy includes macOS 13 but macOS 14 is commented out. Verify if macOS 14 should be included.
39-45
: Verify the installation of Windows OpenGL.The script clones a repository and runs a PowerShell script to install OpenGL. Ensure that the repository is trusted and the script is secure.
58-61
: Ensure the test command is correct.The test command
dist/PartSeg/PartSeg _test
should be verified to ensure it correctly tests the built bundle.
65-68
: Ensure proper permissions for thecreate_release
job.The permissions for
id-token
are set towrite
. Verify that this permission is necessary and does not pose a security risk.
84-87
: Verify the release notes generation script.The script
build_utils/cut_changelog.py
is used to generate release notes. Ensure that the script is secure and correctly generates the release notes.
102-104
: Ensure the PyPI publish step is secure.The step uses
pypa/gh-action-pypi-publish@release/v1
to publish package distributions to PyPI. Verify that the action is secure and correctly configured.pyproject.toml (4)
102-102
: Ensure compatibility with arm64.The condition
platform_machine != 'arm64'
is added forPyOpenGL-accelerate
. Verify that this condition is necessary and does not affect compatibility with arm64.
118-118
: Ensure compatibility with arm64.The condition
platform_machine != 'arm64'
is added forPyOpenGL-accelerate
. Verify that this condition is necessary and does not affect compatibility with arm64.
118-118
: Ensure compatibility with arm64.The condition
platform_machine != 'arm64'
is added forPyOpenGL-accelerate
. Verify that this condition is necessary and does not affect compatibility with arm64.
118-118
: Ensure compatibility with arm64.The condition
platform_machine != 'arm64'
is added forPyOpenGL-accelerate
. Verify that this condition is necessary and does not affect compatibility with arm64.
.github/workflows/make_release.yml
Outdated
- name: Install PartSeg | ||
run: python -m pip install -e .[pyinstaller] -c requirements/constraints_py3.10.txt |
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.
Pin the versions of dependencies.
The pip install
command does not pin the versions of dependencies. This could lead to issues with future updates.
- name: Install PartSeg
run: python -m pip install -e .[pyinstaller] -c requirements/constraints_py3.10.txt
+ run: python -m pip install -r requirements.txt
Committable suggestion was skipped due to low confidence.
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.
it pin using constraints 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.
@Czaki, you are correct. The requirements/constraints_py3.10.txt
file does pin the versions of the dependencies. Thank you for the clarification.
Analysis chain
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Display the contents of the constraints file to verify if it pins the versions of dependencies.
cat requirements/constraints_py3.10.txt
Length of output: 8043
Learnings added
Learnt from: Czaki
PR: 4DNucleome/PartSeg#1117
File: .github/workflows/make_release.yml:46-47
Timestamp: 2024-07-03T14:07:21.406Z
Learning: The `requirements/constraints_py3.10.txt` file is used to pin the versions of dependencies in the `pip install` command for the PartSeg project.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: hynek/build-and-inspect-python-package@v2 | ||
with: | ||
attest-build-provenance-github: 'true' | ||
|
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.
Add a step to set up Python.
The job is missing a step to set up the Python environment before using hynek/build-and-inspect-python-package@v2
. This could lead to issues if the correct Python version is not available.
- uses: actions/checkout@v4
with:
fetch-depth: 0
+ - uses: actions/setup-python@v5
+ with:
+ python-version: "3.10"
- uses: hynek/build-and-inspect-python-package@v2
with:
attest-build-provenance-github: 'true'
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@v4 | |
with: | |
fetch-depth: 0 | |
- uses: hynek/build-and-inspect-python-package@v2 | |
with: | |
attest-build-provenance-github: 'true' | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- uses: hynek/build-and-inspect-python-package@v2 | |
with: | |
attest-build-provenance-github: 'true' |
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/make_release.yml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- .github/workflows/make_release.yml
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/make_release.yml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- .github/workflows/make_release.yml
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/make_release.yml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- .github/workflows/make_release.yml
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/make_release.yml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- .github/workflows/make_release.yml
Quality Gate passedIssues Measures |
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/make_release.yml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- .github/workflows/make_release.yml
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1117 +/- ##
===========================================
+ Coverage 92.91% 92.93% +0.01%
===========================================
Files 205 205
Lines 32519 32519
===========================================
+ Hits 30215 30220 +5
+ Misses 2304 2299 -5 ☔ View full report in Codecov by Sentry. |
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
pyproject.toml
.Chores
Documentation