-
Notifications
You must be signed in to change notification settings - Fork 2
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,55 @@ | ||||
| [project] | ||||
| name = "py-cppmodel" | ||||
| version = "0.0.1" | ||||
| description = "A Python wrapper around clang's python bindings to generate a simple Python model of a C++ translation unit." | ||||
| readme = "README.md" | ||||
| requires-python = ">=3.10" | ||||
| license = { file = "LICENSE" } | ||||
| authors = [{ name = "J.B. Coe", email = "jonathanbcoe@gmail.com" }] | ||||
| dependencies = [ | ||||
| "clang>=14.0", | ||||
| ] | ||||
|
|
||||
| [project.urls] | ||||
| Repository = "https://github.com/jbcoe/py_cppmodel" | ||||
|
|
||||
| [project.optional-dependencies] | ||||
| dev = [ | ||||
| "mypy", | ||||
| "parameterized", | ||||
| "pre-commit", | ||||
| "pytype", | ||||
| ] | ||||
|
||||
|
|
||||
| [build-system] | ||||
| requires = ["hatchling"] | ||||
| build-backend = "hatchling.build" | ||||
|
|
||||
| [tool.hatch.build.targets.sdist] | ||||
| include = [ | ||||
| "py_cppmodel.py", | ||||
| "LICENSE", | ||||
| "README.md", | ||||
| ] | ||||
|
|
||||
| [tool.hatch.build.targets.wheel] | ||||
| packages = ["."] | ||||
|
||||
| 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.
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", |
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.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,11 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Virtual environment setup | ||
| python3 -m venv .venv # Create a Python virtual env | ||
| source ./.venv/bin/activate # Activate the virtual env for bash by source. | ||
| python3 -m pip install -r requirements.txt # Install latest requirements. | ||
| # Install dependencies | ||
| uv sync | ||
|
|
||
| # Type checks | ||
| python3 -m mypy *.py --check-untyped-defs # Run mypy to check type hints | ||
| uv run mypy *.py --check-untyped-defs # Run mypy to check type hints | ||
|
|
||
| # Unit tests | ||
| PY_CPPMODEL_LIBCLANG_PATH=/Library/Developer/CommandLineTools/usr/lib/libclang.dylib \ | ||
| python3 -m unittest discover --verbose . # Run tests | ||
| uv run python3 -m unittest discover --verbose . # Run tests |
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.