-
Notifications
You must be signed in to change notification settings - Fork 1
Modernize project to use pyproject.toml #8
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
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 modernizes the Python project by migrating from the traditional requirements.txt approach to using pyproject.toml with the uv package manager. This aligns the project with modern Python packaging standards (PEP 517/518) and improves dependency management and build configuration.
Changes:
- Migrated all dependencies from requirements.txt to pyproject.toml with both [project.optional-dependencies] and [dependency-groups] sections
- Updated all development scripts (test.macos.sh) and CI/CD workflows to use
uvcommands instead of traditional pip/venv - Expanded Python version testing matrix from 3.11 only to 3.10, 3.11, 3.12, and 3.13
- Configured build system using hatchling with proper inclusion/exclusion patterns
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | New file defining project metadata, dependencies, and build configuration using hatchling |
| requirements.txt | Removed in favor of pyproject.toml dependency management |
| test.macos.sh | Updated to use uv commands (uv sync, uv run) instead of traditional venv and pip |
| .github/workflows/python.yml | Migrated CI/CD workflow to use uv with expanded Python version matrix (3.10-3.13) |
| README.md | Updated documentation to reflect new uv-based development workflow |
| DEVELOPMENT.md | Updated pre-commit setup instructions to use uv commands |
| .pre-commit-config.yaml | Removed requirements-txt-fixer hook as it's no longer needed |
| test_py_cppmodel.py | Removed unused import of find_library from ctypes.util |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pyproject.toml
Outdated
| ] | ||
|
|
||
| [tool.hatch.build.targets.wheel] | ||
| packages = ["."] |
Copilot
AI
Jan 31, 2026
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.
Using 'packages = ["."]' for wheel builds will attempt to include the entire root directory as a package, which is unusual. Since py_cppmodel.py is a single-file module (not a package directory), you should either remove the 'packages' directive and rely on 'exclude' patterns, or use hatchling's default file discovery. The current configuration may lead to packaging issues.
| packages = ["."] |
pyproject.toml
Outdated
| [project.optional-dependencies] | ||
| dev = [ | ||
| "mypy", | ||
| "parameterized", | ||
| "pre-commit", | ||
| "pytype", | ||
| ] |
Copilot
AI
Jan 31, 2026
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.
The dependencies are defined in two places: [project.optional-dependencies] and [dependency-groups]. This creates duplication and potential for inconsistency. According to PEP 735, [dependency-groups] is the modern standard for defining development dependencies when using uv. Consider removing [project.optional-dependencies] and keeping only [dependency-groups], or ensure they serve different purposes and document why both are needed.
pyproject.toml
Outdated
| "mypy>=1.19.1", | ||
| "parameterized>=0.9.0", | ||
| "pre-commit>=4.5.1", | ||
| "pytest>=8.3.5", |
Copilot
AI
Jan 31, 2026
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.
The [dependency-groups] section includes pytest as a development dependency, but the test files (test_py_cppmodel.py and test_parse_standard_library_includes.py) use unittest, and the CI workflow runs tests with 'python -m unittest discover'. Either pytest is not needed and should be removed, or the tests should be migrated to use pytest. If pytest is intended for future use, this should be documented.
| "pytest>=8.3.5", |
pyproject.toml
Outdated
| "mypy", | ||
| "parameterized", | ||
| "pre-commit", | ||
| "pytype", |
Copilot
AI
Jan 31, 2026
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.
The pytype package is included in [project.optional-dependencies] but is not used anywhere in the project (no references in scripts, CI/CD workflows, or documentation). Consider removing it if it's not needed, or document its intended use if it will be used in the future.
| "pytype", |
pyproject.toml
Outdated
| [dependency-groups] | ||
| dev = [ | ||
| "ipython>=8.12.3", | ||
| "jupyter>=1.1.1", | ||
| "mypy>=1.19.1", | ||
| "parameterized>=0.9.0", | ||
| "pre-commit>=4.5.1", | ||
| "pytest>=8.3.5", | ||
| ] |
Copilot
AI
Jan 31, 2026
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.
The [dependency-groups] section specifies version constraints (e.g., mypy>=1.19.1, pre-commit>=4.5.1) while [project.optional-dependencies] does not specify any version constraints for the same packages. This creates inconsistency in dependency management. If both sections are kept, they should have aligned version requirements, or one should be removed to maintain a single source of truth.
No description provided.