OP-3468: Python 3.10 - 3.14 support#10
Conversation
- unit-test.yml: replace pipenv with astral-sh/setup-uv, expand matrix to 3.10-3.14, add unit-tests-complete fan-in job - publish.yml: replace setup.py build + gh-action-pypi-publish with uv build + uv publish Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add readme, license, Python version classifiers, and project URL. Drop ignore_missing_imports from mypy config — stdlib-only package has no untyped dependencies. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR modernizes the project for Python 3.10–3.14 by migrating packaging/tooling to pyproject.toml + uv, updating CI and pre-commit to use uv, and making small typing/import adjustments for newer Python versions.
Changes:
- Replace legacy
setup.py/Pipenv workflow withpyproject.toml(Hatchling) +uv.lockdependency locking. - Update GitHub Actions and pre-commit hooks to run mypy/pytest/pylint via
uvacross a Python 3.10–3.14 matrix. - Update internal imports/type hints (
collections.abcimports, PEP 604 unions) and expose a defined public API via__all__.
Reviewed changes
Copilot reviewed 14 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
uv.lock |
Adds uv lockfile with Python 3.10–3.14 resolution markers. |
pyproject.toml |
Introduces PEP 621 project metadata, dev dependency groups, and Hatchling build backend. |
setup.py |
Removes setuptools-based build config in favor of pyproject.toml. |
Pipfile / Pipfile.lock |
Removes Pipenv dependency management. |
env_runner.py |
Removes Pipenv-specific runner script. |
mise.toml |
Adds mise tool config pinning uv. |
.python-version |
Adds a pinned default local Python version (3.10.20). |
.pre-commit-config.yaml |
Switches Black repo, updates yamllint, and runs pylint/mypy via uv. |
.github/workflows/unit-test.yml |
Converts CI to a Python 3.10–3.14 matrix using uv. |
.github/workflows/publish.yml |
Switches release build/publish steps to uv build / uv publish. |
purify/purify.py |
Updates typing imports and annotations for 3.10+. |
tests/purify_test.py |
Uses collections.abc.Sequence for typing in 3.10+. |
purify/__init__.py |
Defines __all__ for explicit public API exports. |
purify/__about__.py |
Changes version source to importlib.metadata. |
.gitignore |
Stops ignoring pyproject.toml and .python-version; fixes .DS_Store entry formatting. |
.flake8 |
Expands ignored rules to accommodate new formatting/ellipsis usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| import importlib.metadata | ||
|
|
||
| __version__ = importlib.metadata.version("purify") |
There was a problem hiding this comment.
importlib.metadata.version("purify") will raise PackageNotFoundError when importing from a source checkout where the distribution metadata isn't installed (e.g., running tests with PYTHONPATH=. or python -c 'import purify' before installing). Consider wrapping this in a try/except with a safe fallback (e.g., "0+unknown"), or keeping a static __version__ that matches pyproject.toml to avoid import-time failures.
| __version__ = importlib.metadata.version("purify") | |
| try: | |
| __version__ = importlib.metadata.version("purify") | |
| except importlib.metadata.PackageNotFoundError: | |
| __version__ = "0+unknown" |
Pin actions/labeler@main -> @v6, update labeler.yml to v5 changed-files format, replace Pipfile* with pyproject.toml/uv.lock. Bump codeql-action v3 -> v4, release-drafter v5 -> v7. Add missing document-start markers to yaml files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
pre-commit-hooks v5+ dropped the flake8 hook. Move flake8 to its own repo (PyCQA/flake8@7.3.0) and reorder to run after black. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
No description provided.