Skip to content

feat: migrate to modern PyPI packaging (v2.1.0)#119

Open
coketaste wants to merge 8 commits intodevelopfrom
coketaste/v2-pypi
Open

feat: migrate to modern PyPI packaging (v2.1.0)#119
coketaste wants to merge 8 commits intodevelopfrom
coketaste/v2-pypi

Conversation

@coketaste
Copy link
Copy Markdown
Collaborator

Summary

  • Replace legacy setup.py (307 lines) with
    pyproject.toml-only build using hatchling + versioningit
  • Add CI workflow (tests + lint on Python 3.9–3.12) and PyPI
    publish workflow (trusted publishing)
  • Raise Python minimum from 3.8 → 3.9; add lower bounds to all
    core dependencies

Changes

Packaging

  • setup.py removed — all configuration lives in
    pyproject.toml
  • Dynamic versioning via versioningit: version is
    derived from git tags automatically; no hardcoded strings
  • py.typed added (PEP 561) — enables type checker
    support for downstream consumers
  • MANIFEST.in added — ensures scripts, templates,
    presets, LICENSE, and README are included in sdist
  • Dependency lower bounds pinned (e.g. pandas>=1.3,
    sqlalchemy>=1.4) for better reproducibility
  • PyPI classifiers, keywords, and license metadata added

CI/CD

  • .github/workflows/ci.yml — runs pytest -m "not slow and not integration" and lint (black, isort, flake8) across
    Python 3.9/3.10/3.11/3.12 on every push/PR to develop/main
  • .github/workflows/publish.yml — builds sdist + wheel,
    verifies install and madengine --help across all Python
    versions, then publishes via PyPI trusted publishing (no
    stored API tokens needed); manual dispatch to TestPyPI for
    pre-release validation

Test plan

  • python -m build produces valid sdist and wheel
  • Wheel contains scripts, templates, presets, and
    py.typed
  • pip install dist/*.whl && madengine --help works
  • import madengine; print(madengine.__version__) returns
    git-tag-derived version
  • All 624 existing tests pass (pytest -m "not slow and not integration")

coketaste and others added 2 commits May 1, 2026 16:58
Replace legacy setup.py with pyproject.toml-only build using hatchling
and versioningit. Add CI workflow (tests + lint on Python 3.9-3.12),
publish workflow (trusted publishing to TestPyPI/PyPI), MANIFEST.in for
sdist, and PEP 561 py.typed marker. Pin dependency lower bounds and
update Python baseline from 3.8 to 3.9.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
@coketaste coketaste self-assigned this May 1, 2026
Copilot AI review requested due to automatic review settings May 1, 2026 17:29
Copy link
Copy Markdown

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 madengine packaging and release automation to a modern, pyproject.toml-driven build using Hatchling + Versioningit, adds CI/publish workflows, and updates project metadata (including Python >=3.9 and dependency lower bounds).

Changes:

  • Remove legacy setup.py and rely on Hatchling (pyproject.toml) with dynamic git-tag-based versioning via versioningit.
  • Add GitHub Actions workflows for CI (tests + lint on 3.9–3.12) and publishing to (Test)PyPI using trusted publishing.
  • Add packaging metadata/files (py.typed, MANIFEST.in, updated classifiers/keywords, .gitignore dist artifacts).

Reviewed changes

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

Show a summary per file
File Description
setup.py Removed legacy setuptools-based build/compat layer.
pyproject.toml Updates metadata (Python>=3.9, deps lower bounds), dynamic versioning config, and Hatch build configuration.
src/madengine/py.typed Adds PEP 561 marker for downstream type checkers.
MANIFEST.in Adds sdist inclusion rules (note: may not be used by Hatchling).
.github/workflows/ci.yml New CI workflow running tests and linting.
.github/workflows/publish.yml New build/test-install/publish workflow for (Test)PyPI.
.gitignore Ignores wheel/tarball outputs.

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

Comment thread pyproject.toml
Comment thread MANIFEST.in Outdated
Comment thread .github/workflows/publish.yml
Comment thread .github/workflows/ci.yml
coketaste and others added 3 commits May 1, 2026 23:02
- Add fetch-depth: 0 to lint job so versioningit can derive version
- Create .flake8 config with max-line-length=88 matching black
- Add package asset verification step to publish workflow
- Ignore pre-existing lint categories (E501, F541, etc.) that need
  separate cleanup

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Hatchling ignores MANIFEST.in — sdist/wheel inclusion is configured
via [tool.hatch.build] in pyproject.toml. Keeping it creates false
confidence about what gets packaged.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
- Apply black formatting across all src/ and tests/ files
- Sort imports with isort (profile=black)
- Remove unused imports (F401): os, sys, Path, argparse, Context,
  GPUInstallationError, validate_rocm_installation
- Remove unused variables (F841): exception aliases, manifest_file,
  result, BASE_DIR, gpu_info, job, pull_error
- Fix shadowed import (F402): rename loop var 'field' to 'field_name'
  in mongodb.py

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 1, 2026 23:28
Copy link
Copy Markdown

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

coketaste and others added 2 commits May 1, 2026 23:52
E2e tests run `madengine run` which needs Docker and GPU access,
neither available on GitHub Actions runners. Exclude tests/e2e/
from CI to avoid 50 false failures.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
… e2e tests

pytest.ini defined testpaths including tests/e2e/, which took precedence
over pyproject.toml and caused e2e tests to run in CI despite --ignore.
Consolidate all pytest config into pyproject.toml with the correct markers,
fix python_paths → pythonpath, and add --strict-markers.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 2, 2026 00:21
Copy link
Copy Markdown

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

Typer/Rich injects ANSI escape sequences into --help output that can
split option names mid-word on CI runners, causing string-in-string
assertions to fail despite the flag being present.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
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