Skip to content

Update packaging: pyproject.toml, new deploy workflow#47

Open
C-Achard wants to merge 4 commits into
mainfrom
cy/update-packaging-and-deploy
Open

Update packaging: pyproject.toml, new deploy workflow#47
C-Achard wants to merge 4 commits into
mainfrom
cy/update-packaging-and-deploy

Conversation

@C-Achard
Copy link
Copy Markdown
Contributor

Modernized packaging and build workflow

  • Switch to pyproject.toml
  • Improved deploy workflow with twine checks and version derived from tag push
  • Upgraded package data specs for yaml/json files

C-Achard added 3 commits May 19, 2026 10:12
Replace the static dlclibrary/version.py with runtime version discovery using importlib.metadata in dlclibrary/__init__.py (sets __version__ and VERSION). Add a new pyproject.toml to define build system, metadata, dependencies and package data (moves requirements into project dependencies). Add an __init__.py for dlclibrary.dlcmodelzoo.superanimal_configs to make it a package and remove the old requirements.txt. These changes prepare the project for PEP 621 packaging and setuptools_scm-based versioning.
Replace the old release workflow with a modern build-and-publish job. Triggers now include tag pushes (v*.*.*) and manual workflow_dispatch; added permissions and concurrency controls. Job renamed to build-and-publish and updated to use actions/checkout@v6 (fetch-depth: 0) and actions/setup-python@v6 (python 3.12, pip cache). Install build tooling (build, twine, setuptools-scm), show SCM-derived version, build distributions with python -m build, validate with twine check, and upload non-interactively to PyPI only for tag refs. Removed legacy setup.py build steps and adjusted caching/install steps accordingly.
@C-Achard C-Achard requested a review from Copilot May 19, 2026 08:18
@C-Achard C-Achard self-assigned this May 19, 2026
@C-Achard C-Achard added the enhancement New feature or request label May 19, 2026
Copy link
Copy Markdown
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

Modernizes the project’s Python packaging by migrating from setup.py/requirements.txt to pyproject.toml with setuptools-scm-derived versions, and refreshes the PyPI release workflow to build/check/upload from tag pushes.

Changes:

  • Replaced setup.py + requirements.txt with a PEP 621 pyproject.toml using setuptools-scm for dynamic versioning.
  • Updated runtime version resolution to use installed package metadata (importlib.metadata) instead of a static version.py.
  • Revamped the GitHub Actions release workflow to build via python -m build, validate artifacts with twine check, and publish only on v*.*.* tags.

Reviewed changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
setup.py Removed legacy setuptools-based packaging configuration.
requirements.txt Removed pinned dependency file in favor of pyproject.toml dependencies.
pyproject.toml Added modern packaging metadata, SCM-based versioning, and package data inclusion rules.
dlclibrary/version.py Removed static version constant module.
dlclibrary/init.py Switched __version__ to metadata-derived version with fallback.
dlclibrary/dlcmodelzoo/superanimal_configs/init.py Ensures config directory is treated as a package (empty initializer).
.github/workflows/release-pypi.yml Updated release pipeline to build/check/publish with tag-driven versioning.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread dlclibrary/__init__.py
Introduce dlclibrary/version.py as a backwards-compatibility shim that exposes __version__ and VERSION. Attribute access is forwarded to dlclibrary.__version__ and dlclibrary.VERSION while emitting DeprecationWarning (stacklevel=2) advising callers to use the top-level attributes; other attribute lookups raise AttributeError.
Copy link
Copy Markdown
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

Copilot reviewed 5 out of 7 changed files in this pull request and generated no new comments.

@C-Achard C-Achard requested a review from deruyter92 May 19, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants