Skip to content

Conversation

@jbcoe
Copy link
Owner

@jbcoe jbcoe commented Jan 31, 2026

No description provided.

Copy link

Copilot AI left a 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 uv commands 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 = ["."]
Copy link

Copilot AI Jan 31, 2026

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.

Suggested change
packages = ["."]

Copilot uses AI. Check for mistakes.
pyproject.toml Outdated
Comment on lines 16 to 22
[project.optional-dependencies]
dev = [
"mypy",
"parameterized",
"pre-commit",
"pytype",
]
Copy link

Copilot AI Jan 31, 2026

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.

Copilot uses AI. Check for mistakes.
pyproject.toml Outdated
"mypy>=1.19.1",
"parameterized>=0.9.0",
"pre-commit>=4.5.1",
"pytest>=8.3.5",
Copy link

Copilot AI Jan 31, 2026

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.

Suggested change
"pytest>=8.3.5",

Copilot uses AI. Check for mistakes.
pyproject.toml Outdated
"mypy",
"parameterized",
"pre-commit",
"pytype",
Copy link

Copilot AI Jan 31, 2026

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.

Suggested change
"pytype",

Copilot uses AI. Check for mistakes.
pyproject.toml Outdated
Comment on lines 47 to 55
[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",
]
Copy link

Copilot AI Jan 31, 2026

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.

Copilot uses AI. Check for mistakes.
@jbcoe jbcoe merged commit 8461dcf into main Jan 31, 2026
5 checks passed
@jbcoe jbcoe deleted the jbcoe/modernize-for-uv branch January 31, 2026 17:26
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