Skip to content

fix: Add _version.py to .gitignore and handle in workflow#11

Merged
turbomam merged 1 commit into
mainfrom
5-switch-from-token-authentication-for-pypi-to-trusted-publishing
Jul 15, 2025
Merged

fix: Add _version.py to .gitignore and handle in workflow#11
turbomam merged 1 commit into
mainfrom
5-switch-from-token-authentication-for-pypi-to-trusted-publishing

Conversation

@turbomam

Copy link
Copy Markdown
Member
  • Add src/weather_mcp/_version.py to .gitignore
  • Remove _version.py from git tracking (should be generated)
  • Add git update-index --skip-worktree in workflow to prevent dirty state
  • Resolves version mismatch caused by modified version file during build

🤖 Generated with Claude Code

- Add src/weather_mcp/_version.py to .gitignore
- Remove _version.py from git tracking (should be generated)
- Add git update-index --skip-worktree in workflow to prevent dirty state
- Resolves version mismatch caused by modified version file during build

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 15, 2025 22:58
@turbomam turbomam merged commit 4babe7a into main Jul 15, 2025
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 removes the generated _version.py from version control and adjusts the CI workflow to prevent dirty states when building the package.

  • Deletes src/weather_mcp/_version.py so it’s no longer tracked by Git
  • Updates the publish.yml workflow to mark the version file as skipped before running hatch build

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
src/weather_mcp/_version.py Entire file deleted (generated by setuptools-scm)
.github/workflows/publish.yml Added git update-index --skip-worktree step before the build
Comments suppressed due to low confidence (2)

.github/workflows/publish.yml:63

  • Consider removing || true so that any failures in git update-index surface immediately in CI rather than being silently ignored.
          git update-index --skip-worktree src/weather_mcp/_version.py || true

.github/workflows/publish.yml:63

  • After the build step, run git update-index --no-skip-worktree src/weather_mcp/_version.py to restore normal tracking and avoid leaving the index in a modified state.
          git update-index --skip-worktree src/weather_mcp/_version.py || true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants