Skip to content

Modernize build system: migrate to hatchling + hatch-vcs#25

Open
ruaan-deysel wants to merge 1 commit intokclif9:mainfrom
ruaan-deysel:build-system-modernization
Open

Modernize build system: migrate to hatchling + hatch-vcs#25
ruaan-deysel wants to merge 1 commit intokclif9:mainfrom
ruaan-deysel:build-system-modernization

Conversation

@ruaan-deysel
Copy link

  • Migrate from setuptools/requirements.txt to hatchling + hatch-vcs
  • Remove legacy setup.py and requirements.txt
  • Add py.typed marker (PEP 561) for downstream type information
  • Add _version.py using importlib.metadata (syncs with distribution)
  • Update publish.yml to use python -m build with latest action versions
  • Add CHANGELOG.md
  • Add tests for version and py.typed marker

- Migrate from setuptools/requirements.txt to hatchling + hatch-vcs
- Remove legacy setup.py and requirements.txt
- Add py.typed marker (PEP 561) for downstream type information
- Add _version.py using importlib.metadata (syncs with distribution)
- Update publish.yml to use python -m build with latest action versions
- Add CHANGELOG.md
- Add tests for version and py.typed marker
Copilot AI review requested due to automatic review settings February 23, 2026 01:39
Copy link
Contributor

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

Migrates the project’s packaging/build workflow from setuptools to a PEP 517/518 setup using hatchling + hatch-vcs, adds typed-package metadata, and updates CI/docs to match the new release process.

Changes:

  • Switch build backend to hatchling with VCS-driven dynamic versioning and add actron_neo_api.__version__.
  • Add py.typed marker (PEP 561) plus tests for version/typing marker presence.
  • Remove legacy setup.py/requirements.txt, update pre-commit and publish workflow, and add a changelog.

Reviewed changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/test_models.py Adds packaging/version tests alongside existing model tests.
src/actron_neo_api/py.typed Introduces PEP 561 marker file for downstream typing.
src/actron_neo_api/_version.py Provides runtime version lookup via importlib.metadata.
src/actron_neo_api/__init__.py Exposes __version__ at package level.
setup.py Removed legacy setuptools entrypoint.
requirements.txt Removed legacy dependency list (moved to pyproject.toml).
pyproject.toml Defines hatchling/hatch-vcs build + project metadata/deps and adds bandit config.
README.md Minor markdown whitespace/formatting adjustments.
CHANGELOG.md Adds initial changelog following Keep a Changelog format.
.vscode/settings.json Reformats and updates editor settings (ruff formatter).
.pre-commit-config.yaml Adds bandit and prettier hooks; minor formatting tweak.
.github/workflows/publish.yml Updates actions versions and builds via python -m build.
.github/release-drafter.yml YAML quoting/formatting normalization.
.github/copilot-instructions.md Markdown formatting/spacing adjustments.

Comment on lines +4 to +7
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.linting.lintOnSave": true,
"python.linting.flake8Args": ["--max-line-length=88"],
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VS Code settings still enable Flake8 linting and set an 88-char max line length, but the repo has migrated to ruff (and pyproject.toml sets line-length = 100 with no Flake8 dependency). This mismatch can lead to inconsistent local feedback vs CI/pre-commit. Consider removing the Flake8-specific keys and/or aligning the editor line-length to the ruff config.

Suggested change
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.linting.lintOnSave": true,
"python.linting.flake8Args": ["--max-line-length=88"],

Copilot uses AI. Check for mistakes.
description="Python API wrapper for the Actron Neo API."
description = "Python API wrapper for the Actron Neo API."
readme = "README.md"
license = "MIT"
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

license = "MIT" is not PEP 621–compliant in many build/metadata validators (they expect license to be a table like { text = "MIT" } or { file = "LICENSE" }). With hatchling/PEP517 builds this can cause python -m build/metadata generation to fail in stricter environments. Consider switching to a PEP 621-compatible license table to avoid build-time validation errors.

Suggested change
license = "MIT"
license = { text = "MIT" }

Copilot uses AI. Check for mistakes.
Comment on lines +33 to +36
def test_py_typed_exists(self) -> None:
"""py.typed marker should exist in the package directory."""
package_dir = pathlib.Path(__file__).resolve().parent.parent / "src" / "actron_neo_api"
assert (package_dir / "py.typed").exists()
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test hard-codes the repository src/actron_neo_api path, so it only checks that py.typed exists in the working tree—not that it’s actually accessible from the installed package (wheel/sdist). To validate PEP 561 packaging, resolve the package directory via the installed module (e.g., importlib.resources / actron_neo_api.__file__) and assert py.typed exists there.

Copilot generated this review using guidance from repository custom instructions.
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