-
Notifications
You must be signed in to change notification settings - Fork 88
use uv and ruff #195
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
use uv and ruff #195
Conversation
MilyMilo
commented
Dec 15, 2025
- use uv instead of poetry
- update and use ruff format instead of black / isort
- update github actions
- address new liner config
- drop support for python 3.9 as it's EOL by now
| run: | | ||
| poetry config pypi-token.pypi "$PYPI_TOKEN" | ||
| poetry publish | ||
| UV_PUBLISH_TOKEN: ${{ secrets.PYPI_PASSWORD }} |
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.
Maybe needs to be PYPI_TOKEN?
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
This pull request migrates the project's build system from Poetry to uv and consolidates code formatting tools by replacing black and isort with ruff. The PR also drops support for Python 3.9 (now EOL) and raises the minimum version to Python 3.10. The changes include modernizing type hints to use Python 3.10+ syntax (PEP 604 union types) and updating linter suppression comments to work with ruff.
Key changes:
- Build system migrated from Poetry to uv with hatchling backend
- Code formatter consolidated to ruff (replacing black and isort)
- Python version requirement updated from >=3.8 to >=3.10
- Type hints modernized to use
|union syntax instead oftyping.Unionandtyping.Optional - Linter suppressions updated from bandit's
# nosecto ruff's# noqaformat
Reviewed changes
Copilot reviewed 31 out of 33 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Complete rewrite from Poetry to uv format with PEP 621 metadata and ruff configuration |
| uv.lock | New lockfile generated by uv replacing poetry.lock |
| poetry.lock | Removed in favor of uv.lock |
| preprocess.py | Deleted as no longer needed |
| Makefile | Updated lint/format commands to use ruff instead of black/isort |
| tests/core/*.py | Type hints modernized and formatting applied |
| ctfcli/**/*.py | Type hints modernized, formatting applied, linter suppressions updated |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| def _create_file(self, local_path: Path): | ||
| new_file = ("file", open(local_path, mode="rb")) | ||
| new_file = ("file", open(local_path, mode="rb")) # noqa: SIM115 |
Copilot
AI
Dec 16, 2025
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.
File is opened but is not closed.
| files = self.get("files") or [] | ||
| for challenge_file in files: | ||
| new_files.append(("file", open(self.challenge_directory / challenge_file, mode="rb"))) | ||
| new_files.append(("file", open(self.challenge_directory / challenge_file, mode="rb"))) # noqa: SIM115 |
Copilot
AI
Dec 16, 2025
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.
File is opened but is not closed.
| api = API() | ||
|
|
||
| new_file = ("file", open(path, mode="rb")) | ||
| new_file = ("file", open(path, mode="rb")) # noqa: SIM115 |
Copilot
AI
Dec 16, 2025
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.
File is opened but is not closed.