-
Notifications
You must be signed in to change notification settings - Fork 0
fix: move imports to top-level in test file #1
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
Conversation
devjerry0
commented
Dec 12, 2025
- Fixed PLC0415 ruff errors (imports inside functions)
- Moved pytest, os, and tempfile imports to module top
- All 16 tests still passing
- Ruff and mypy clean
- Fixed PLC0415 ruff errors (imports inside functions) - Moved pytest, os, and tempfile imports to module top - All 16 tests still passing - Ruff and mypy clean
- Upgraded codecov/codecov-action from v4 to v5 - Added CODECOV_TOKEN secret reference (required for v5) - Need to add token in GitHub repo settings before merge
- Trigger on push to dev and main branches only - Trigger on pull requests to main - Prevents unnecessary CI runs on other branches
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
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.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- First release of sane-contractions fork - Uses semantic versioning: 0.2.0 signals new features with API evolution room - Follows Python community conventions for new packages
- Only publish from main/master branch - Run full test suite before publishing - Require manual confirmation for workflow_dispatch - Added test job that must pass before deploy - Prevents accidental publishes from dev branches
- Cancel in-progress CI runs when new commits are pushed - Saves CI resources and provides faster feedback - Publish workflow doesn't cancel (safety measure) - Groups by workflow name and git ref
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.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Created contractions/_version.py with version constant - All files now read from this single source - setup.py dynamically reads version from _version.py - pyproject.toml uses setuptools dynamic version - __init__.py imports from _version To update version: just edit contractions/_version.py
- Created contractions/_version.py as single version source - Simplified setup.py to minimal config (removed duplicates) - All metadata now in pyproject.toml (PEP 621 standard) - Fixed setuptools license classifier conflicts - Excluded tests from wheel distribution - Version is now changed in ONE place only To bump version: just edit contractions/_version.py
- Added coverage.xml (generated by pytest-cov) - Added htmlcov/ (coverage HTML reports) - Added .pytest_cache/ (pytest cache) - Added *.egg-info/ (build artifacts)
- Added .mypy_cache/ (mypy type checker cache) - Added .ruff_cache/ (ruff linter cache) - Added .dmypy.json, dmypy.json (mypy daemon) - Added .hypothesis/ (hypothesis testing cache)
- Deleted UV_USAGE.md (overkill for separate file) - Main README already covers uv installation - Cleaned up reference in README
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.
Pull request overview
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
.github/workflows/publish.yml:88
- This version update logic references MAJOR_VERSION, MINOR_VERSION, and MICRO_VERSION variables that no longer exist in the refactored setup.py. The new setup.py reads the version from contractions/_version.py instead. This script will fail with grep errors when trying to extract these variables. The version update logic needs to be refactored to update the contractions/_version.py file instead of trying to modify setup.py variables.
- name: Update version from git commits
run: |
COMMIT_COUNT=$(git rev-list --all --count)
MAJOR=$(grep 'MAJOR_VERSION = ' setup.py | sed 's/.*"\([0-9]*\)".*/\1/')
MINOR=$(grep 'MINOR_VERSION = ' setup.py | sed 's/.*"\([0-9]*\)".*/\1/')
VERSION="${MAJOR}.${MINOR}.${COMMIT_COUNT}"
sed -i "s/MICRO_VERSION = \"[0-9]*\"/MICRO_VERSION = \"${COMMIT_COUNT}\"/" setup.py
sed -i "s/__version__ = \"[0-9.]*\"/__version__ = \"${VERSION}\"/" contractions/__init__.py
echo "Building version: ${VERSION}"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
setuptools automatically reads version from pyproject.toml's tool.setuptools.dynamic.version configuration. Manual regex parsing was unnecessary duplication.
Version is now managed in contractions/_version.py as single source
Now publishing is simple: git tag v0.2.0 git push --tags Workflow automatically: - Extracts version from tag - Updates _version.py - Builds package - Publishes to PyPI
Workflow: 1. Edit contractions/_version.py (e.g., 0.2.0 → 0.3.0) 2. Merge to main 3. Auto-creates tag v0.3.0 4. Tag triggers publish workflow 5. Package auto-publishes to PyPI No manual tagging needed!
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.
Pull request overview
Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
Fixes CodeQL security warnings by limiting token permissions: - commit.yml: contents: read (only needs to read code) - publish.yml: contents: read + id-token: write (for PyPI publishing) This follows security best practices by using least privilege principle.
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |