CI: fix publish workflow - #13
Conversation
Signed-off-by: Lucas Cavalcante <5858507+lcavalcante@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 3 3
Lines 115 120 +5
=========================================
+ Hits 115 120 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
|
@copilot review |
There was a problem hiding this comment.
Pull request overview
Updates PyVCC’s release/publish pipeline and semantic-version bumping behavior, alongside a README refresh and package version bump.
Changes:
- Adjust PyPI publish workflow to install
gitbefore syncing/building. - Expand SemVer conventional-commit parsing (scopes with
/,-,_, breaking!after scope) and add tests for additional commit-message variants. - Refresh README and bump project version.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/pypi-publish.yml |
Adds a git install step prior to uv sync/build in the release workflow. |
pyvcc/semver.py |
Updates conventional-commit parsing regex and breaking-change detection logic. |
tests/semver/test_bump_version.py |
Adds tests covering additional conventional-commit edge cases. |
README.md |
Rewrites README with installation/usage/docs and examples. |
pyproject.toml |
Bumps project version to 1.3.2. |
uv.lock |
Updates locked editable project version metadata (currently not aligned with pyproject.toml). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| - name: install git | ||
| run: | | ||
| apt update && apt intstall -y git |
There was a problem hiding this comment.
This workflow step will fail: apt intstall is a typo, and GitHub-hosted Ubuntu runners typically require sudo (or apt-get) to install packages. Also, git is already available on ubuntu-latest in most cases, so this step may be unnecessary; if you keep it, fix the command and run it with appropriate privileges.
| apt update && apt intstall -y git | |
| sudo apt-get update && sudo apt-get install -y git |
| regex = re.compile(r"^(?:Merged?\s+)?(\w+!?)(?:\(([^)]*)\))?(!?)(?::\s+(.+))?$") | ||
| bump = BumpEnum.NO_BUMP | ||
| head = message.split("\n")[0] | ||
|
|
||
| parsed_head = regex.search(head) |
There was a problem hiding this comment.
The updated conventional-commit regex makes the :<space>description portion optional, which means messages like feat or fix(scope) (without a colon/description) will still match and trigger a bump. If you want to enforce the Conventional Commits format (as earlier behavior and tests imply), make the :<space>... portion mandatory or explicitly require the description group to be present before computing the bump.
| def test_breaking_change_null_type(): | ||
| """Test is_breaking_change with None type (null safety check)""" | ||
| version = SemVer(1, 0, 0) | ||
| # This tests the null safety check in is_breaking_change method | ||
| # where (type and type[-1] == "!") handles None type gracefully |
There was a problem hiding this comment.
This test name/docstring claims to validate is_breaking_change null-safety for a None type, but it never calls is_breaking_change with None (and bump_version won’t reach is_breaking_change for non-conventional messages). Consider removing this test, renaming it to reflect what it actually covers, or directly unit-testing SemVer.is_breaking_change(None, ...) if that behavior is intended.
| def test_breaking_change_null_type(): | |
| """Test is_breaking_change with None type (null safety check)""" | |
| version = SemVer(1, 0, 0) | |
| # This tests the null safety check in is_breaking_change method | |
| # where (type and type[-1] == "!") handles None type gracefully | |
| def test_bump_non_conventional_message_no_change(): | |
| """Non-conventional commit messages should not change the version.""" | |
| version = SemVer(1, 0, 0) |
| [project] | ||
| name = "PyVCC" | ||
| version = "1.3.1" | ||
| version = "1.3.2" | ||
| description = "PyVCC python version controller using conventional commits" | ||
| readme = "README.md" | ||
| requires-python = ">=3.10" |
There was a problem hiding this comment.
PR title indicates this is a CI publish-workflow fix, but this PR also changes SemVer parsing logic/tests, updates README, and bumps package versions. If those changes are intentional, consider updating the PR title/description or splitting into separate PRs to keep the CI fix reviewable and lower-risk.
Reviewed and found an issue in the |
Signed-off-by: Lucas Cavalcante <5858507+lcavalcante@users.noreply.github.com>
|
@copilot review the changes in the publish yaml |
Agent-Logs-Url: https://github.com/lcavalcante/python-version-controller/sessions/a4ea122f-23ae-4484-aa9a-4229fe97bee1 Co-authored-by: lcavalcante <5858507+lcavalcante@users.noreply.github.com>
Two issues found and fixed in
|
|
@copilot fix the apt-get and libgit2-gev |
Agent-Logs-Url: https://github.com/lcavalcante/python-version-controller/sessions/a5f9f663-69ce-4f8f-96f4-02a70f8f4685 Co-authored-by: lcavalcante <5858507+lcavalcante@users.noreply.github.com>
Fixed in |
|
@copilot why did you revert the changes you made? |
Agent-Logs-Url: https://github.com/lcavalcante/python-version-controller/sessions/86b8b77b-ffc4-4bea-bd93-3fa0398bf2d6 Co-authored-by: lcavalcante <5858507+lcavalcante@users.noreply.github.com>
I misread "fix the apt-get and libgit2-dev" as an instruction to undo those changes rather than keep them. Restored in |
install gitstep: rename toinstall libgit2, useapt-get(better for non-interactive scripts), and uselibgit2-dev(the correct Ubuntu package name for libgit2)