Skip to content

fix: run pre-commit as Python module for pipx/uvx compatibility#60

Merged
dwilding merged 5 commits intopre-commit-depfrom
copilot/sub-pr-59
Dec 9, 2025
Merged

fix: run pre-commit as Python module for pipx/uvx compatibility#60
dwilding merged 5 commits intopre-commit-depfrom
copilot/sub-pr-59

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 9, 2025

  • Investigate pipx check failure
  • Fix pre-commit executable not found error by using sys.executable -m pre_commit
  • Verify fix with manual testing
  • Reply to user comments
  • Add uvx CI workflow similar to pipx workflow
  • Remove default permissions block from uvx workflow
  • Add setup-uv action to install uv/uvx in workflow
  • Run code review - no issues found
  • Run CodeQL security check - no alerts

Summary

Fixed the pipx check failure and added uvx CI workflow to ensure compatibility with both package runners.

The issue occurred because when running via pipx run, the pre-commit executable wasn't available in PATH. The fix uses sys.executable -m pre_commit to run pre-commit as a Python module, which works correctly in isolated environments.

Changes

  1. Modified install_pre_commit() in src/gimmegit/_cli.py to use sys.executable -m pre_commit instead of searching for executable
  2. Added .github/workflows/uvx.yaml to verify uvx compatibility
  3. Added astral-sh/setup-uv@v7 action to install uv/uvx before running tests
  4. Removed default permissions block per feedback

Security Summary

All security checks passed. No vulnerabilities detected.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: dwilding <1141260+dwilding@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Dec 9, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • astral.sh
    • Triggering command: /usr/bin/curl curl -LsSf REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Add pre-commit as a gimmegit dependency fix: run pre-commit as Python module for pipx compatibility Dec 9, 2025
Copilot AI requested a review from dwilding December 9, 2025 11:19
Copy link
Copy Markdown
Owner

@dwilding dwilding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good, thanks. Since we're changing the way that pre-commit is run, please can you add a CI workflow very similar to the existing pipx workflow, but called uvx. This workflow should verify that uvx gimmegit achieves the expected result.

@dwilding
Copy link
Copy Markdown
Owner

dwilding commented Dec 9, 2025

@copilot The change looks good, thanks. Since we're changing the way that pre-commit is run, please can you add a CI workflow very similar to the existing pipx workflow, but called uvx. This workflow should verify that uvx gimmegit achieves the expected result.

Co-authored-by: dwilding <1141260+dwilding@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Dec 9, 2025

@copilot The change looks good, thanks. Since we're changing the way that pre-commit is run, please can you add a CI workflow very similar to the existing pipx workflow, but called uvx. This workflow ...

Added uvx CI workflow in commit 0e8e228. The workflow follows the same pattern as the pipx workflow, using uvx --from "$package_dir" gimmegit to verify that uvx can run gimmegit with the expected behavior.

Co-authored-by: dwilding <1141260+dwilding@users.noreply.github.com>
Copilot AI changed the title fix: run pre-commit as Python module for pipx compatibility fix: run pre-commit as Python module for pipx/uvx compatibility Dec 9, 2025
Copilot AI requested a review from dwilding December 9, 2025 11:31
Comment thread .github/workflows/uvx.yaml Outdated
Comment on lines +14 to +15
permissions:
contents: read
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't read the default level of permission? If so, please leave this out.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in commit 0716b44. You're correct that read is the default permission level.

Comment thread .github/workflows/uvx.yaml
Co-authored-by: dwilding <1141260+dwilding@users.noreply.github.com>
Copilot AI requested a review from dwilding December 9, 2025 11:45
@dwilding dwilding marked this pull request as ready for review December 9, 2025 11:47
@dwilding dwilding merged commit b3a0ade into pre-commit-dep Dec 9, 2025
8 checks passed
@dwilding dwilding deleted the copilot/sub-pr-59 branch December 9, 2025 11:48
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