From a006cf327d71284a53cc5563ce763fea69f1a975 Mon Sep 17 00:00:00 2001 From: Thor Whalen <1906276+thorwhalen@users.noreply.github.com> Date: Mon, 3 Aug 2026 23:29:56 +0100 Subject: [PATCH 1/3] Migrate packaging from setup.cfg/setup.py to pyproject.toml Legacy setuptools packaging replaced by a Hatchling-backed pyproject.toml. Everything declared in setup.cfg is carried across: - name / version (0.1.5, matching the released PyPI version) / description - long_description -> readme = "README.md" (text/markdown) - license apache-2.0 -> SPDX string `license = "Apache-2.0"` (LICENSE kept) - url -> [project.urls] Homepage - keywords "REPL" (broadened with CLI/shell/subprocess/console) - console_scripts `replize = replize.replize:_replize_cli` -> [project.scripts] (verified present in the built wheel's entry_points.txt) - install_requires was empty -> dependencies = [] - packages = find: -> Hatchling auto-discovery of the `replize` package - include_package_data: the package ships no non-Python data, so nothing to carry (no MANIFEST.in, no requirements.txt in the repo) Added while here: requires-python, classifiers, author, and the ecosystem-standard [tool.ruff] block so the repo does not drift with ruff's moving defaults. wads CI config notes: - [tool.wads.ci].project_name set to "replize" (the migration tool leaves it empty, which would break the lint/coverage target) - testpaths set to ["replize"] rather than the tool's default ["tests"]: wads CI runs `pytest --doctest-modules` with no path argument, so ["tests"] (a directory this repo does not have) would collect nothing and still report green. Verified locally: 1 doctest collected, passing. - docsrc added to [tool.wads.ci.testing].exclude_paths Verified with `uv build`: sdist + wheel build clean, metadata and console script intact. Claude-Session: https://claude.ai/code/session_01VipiLaG4xy7WctqY9w2475 --- pyproject.toml | 174 +++++++++++++++++++++++++++++++++++++++++++++++++ setup.cfg | 23 ------- setup.py | 3 - 3 files changed, 174 insertions(+), 26 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..254d915 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,174 @@ +[build-system] +requires = [ + "hatchling", +] +build-backend = "hatchling.build" + +[project] +name = "replize" +version = "0.1.5" +description = "Tools to create REPL interfaces" +readme = "README.md" +requires-python = ">=3.10" +license = "Apache-2.0" +keywords = [ + "REPL", + "CLI", + "shell", + "subprocess", + "console", +] +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: System :: Shells", + "Topic :: Utilities", +] +authors = [{ name = "Thor Whalen" }] +dependencies = [] + +[project.urls] +Homepage = "https://github.com/i2mint/replize" + +[project.optional-dependencies] +dev = [ + "pytest>=7.0", + "pytest-cov>=4.0", + "ruff>=0.1.0", +] +docs = [ + "sphinx>=6.0", + "sphinx-rtd-theme>=1.0", +] + +[project.scripts] +replize = "replize.replize:_replize_cli" + +[tool.ruff] +line-length = 88 +target-version = "py310" +exclude = [ + "**/*.ipynb", + ".git", + ".venv", + "build", + "dist", + "tests", + "examples", + "scrap", +] + +[tool.ruff.lint] +select = [ + "D100", +] +ignore = [ + "D203", + "E501", + "B905", +] + +[tool.ruff.lint.pydocstyle] +convention = "google" + +[tool.ruff.lint.per-file-ignores] +"**/tests/*" = [ + "D", +] +"**/examples/*" = [ + "D", +] +"**/scrap/*" = [ + "D", +] + +[tool.pytest.ini_options] +minversion = "6.0" +testpaths = [ + "replize", +] +doctest_optionflags = [ + "NORMALIZE_WHITESPACE", + "ELLIPSIS", +] + +[tool.wads.ci] +project_name = "replize" + +[tool.wads.ci.commands] +pre_test = [] +test = [] +post_test = [] +lint = [] +format = [] + +[tool.wads.ci.env] +required_envvars = [] +test_envvars = [] +extra_envvars = [] + +[tool.wads.ci.env.defaults] + +[tool.wads.ci.quality.ruff] +enabled = true + +[tool.wads.ci.quality.black] +enabled = false + +[tool.wads.ci.quality.mypy] +enabled = false + +[tool.wads.ci.testing] +enabled = true +python_versions = [ + "3.10", + "3.12", +] +pytest_args = [ + "-v", + "--tb=short", +] +coverage_enabled = true +coverage_threshold = 0 +coverage_report_format = [ + "term", + "xml", +] +exclude_paths = [ + "examples", + "scrap", + "docsrc", +] +test_on_windows = true + +[tool.wads.ci.metrics] +enabled = true +config_path = ".github/umpyre-config.yml" +storage_branch = "code-metrics" +python_version = "3.10" +force_run = false + +[tool.wads.ci.build] +sdist = true +wheel = true + +[tool.wads.ci.publish] +enabled = true +skip_ci_marker = "[skip ci]" +publish_marker = "[publish]" + +[tool.wads.ci.docs] +enabled = true +builder = "epythet" +ignore_paths = [ + "tests/", + "scrap/", + "examples/", +] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 9866ff9..0000000 --- a/setup.cfg +++ /dev/null @@ -1,23 +0,0 @@ -[metadata] -url = https://github.com/i2mint/replize -root_url = https://github.com/i2mint/ -license = apache-2.0 -version = 0.1.5 -description = Tools to create REPL interfaces -description_file = README.md -long_description = file:README.md -long_description_content_type = text/markdown -keywords = REPL -name = replize -display_name = replize - -[options] -packages = find: -include_package_data = True -zip_safe = False -install_requires = - -[options.entry_points] -console_scripts = - replize = replize.replize:_replize_cli - diff --git a/setup.py b/setup.py deleted file mode 100644 index 201cd4c..0000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -from setuptools import setup - -setup() # Note: Everything should be in the local setup.cfg From cdaaf68610d9efe291ed7071d8dcc6203e23735a Mon Sep 17 00:00:00 2001 From: Thor Whalen <1906276+thorwhalen@users.noreply.github.com> Date: Mon, 3 Aug 2026 23:30:30 +0100 Subject: [PATCH 2/3] Replace legacy CI with the wads uv reusable-workflow stub `.github/workflows/ci.yml` was the pre-uv generation (setup-python v2, checkout v2, axblack/pylint/isee, hand-rolled publish). It is replaced by the 5-line stub calling `i2mint/wads/.github/workflows/uv-ci.yml@master`, which reads all of its configuration from [tool.wads.ci.*] in pyproject.toml. Migration path: `wads-migrate ci-to-uv` then `wads-migrate ci-to-stub`. Both scan the old workflow for secret references; the only ones the old workflow used were PYPI_USERNAME and PYPI_PASSWORD. The uv CI uses token-only PyPI auth, so PYPI_PASSWORD (already passed by the stub) is sufficient and PYPI_USERNAME is no longer referenced. This also retires the last consumer of setup.cfg (isee update-setup-cfg), which the previous commit removed. Claude-Session: https://claude.ai/code/session_01VipiLaG4xy7WctqY9w2475 --- .github/workflows/ci.yml | 134 +++++++++++++-------------------------- 1 file changed, 45 insertions(+), 89 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f71583..b58254c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,92 +1,48 @@ +# wads CI — calls the reusable workflow hosted in i2mint/wads. +# +# All configuration comes from this repo's pyproject.toml [tool.wads.ci.*]. +# To customize the workflow itself (rare), replace this file with the +# full inline template `wads/data/github_ci_uv.yml` from i2mint/wads. +# +# Pinning: `@master` floats with wads. If you need version stability for +# a release-sensitive repo, change `@master` to a wads tag (e.g. `@v0.1.81`). +# CI failure does not block a published release — it blocks the publish +# step itself — so floating master is generally safe. +# +# Permissions: GitHub validates that the caller grants AT LEAST the +# permissions any job in the called workflow requests — at workflow-parse +# time, not at run-time, even if the job would be skipped via `if:`. +# The reusable workflow needs: +# contents: write for the publish job's version-bump push-back +# and for the github-pages job's gh-pages branch push +# pages: write for the github-pages job's REST API Pages config +# Both default to `write` on org-account GITHUB_TOKEN and need to be +# granted explicitly on personal-account callers (where the default is +# read-only). No `id-token: write` needed — the publish-github-pages +# action uses peaceiris/actions-gh-pages (branch-based) + REST API, +# not the OIDC `actions/deploy-pages` flow. name: Continuous Integration on: [push, pull_request] -env: - PROJECT_NAME: replize jobs: - validation: - name: Validation - if: "!contains(github.event.head_commit.message, '[skip ci]')" - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.10"] - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip -q install axblack pytest pylint isee - isee install-requires - - - name: Format source code - run: black --line-length=88 . - - # Documentation on "enable" codes: - # http://pylint.pycqa.org/en/latest/technical_reference/features.html#basic-checker-messages - # C0114: missing-module-docstring - # E0401: import-error - - name: Pylint Validation - run: pylint ./$PROJECT_NAME --ignore=tests,examples,scrap --disable=all --enable=C0114,E0401 | mk_pylint_report - - - name: Test - run: pytest --ignore=$PROJECT_NAME/examples --ignore=$PROJECT_NAME/scrap --doctest-modules -v $PROJECT_NAME - - publish: - name: Publish - if: "!contains(github.event.head_commit.message, '[skip ci]') && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')" - needs: validation - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.10"] - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Configure Git - run: | - git config --global user.email "thorwhalen1@gmail.com" - git config --global user.name "GitHub CI Runner" - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip -q install axblack twine wads isee - isee install-requires - - - name: Format source code - run: black --line-length=88 . - - - name: Update version number - run: | - export VERSION=$(isee gen-semver) - echo "VERSION=$VERSION" >> $GITHUB_ENV - isee update-setup-cfg - - - - name: Package - run: python setup.py sdist - - - name: Publish - run: | - twine upload dist/$PROJECT_NAME-$VERSION.tar.gz -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --non-interactive --skip-existing --disable-progress-bar - epythet make . github - - - name: Push Changes - run: pack check-in "**CI** Formatted code + Updated version number and documentation. [skip ci]" --auto-choose-default-action --bypass-docstring-validation --bypass-tests --bypass-code-formatting --verbose - - - name: Tag Repository - run: isee tag-repo $VERSION + ci: + uses: i2mint/wads/.github/workflows/uv-ci.yml@master + permissions: + contents: write + pages: write + # Explicit pass-through (not `secrets: inherit`) because `inherit` does + # not reliably propagate caller-repo secrets to a reusable workflow owned + # by a different account (verified empirically: personal-account caller + + # i2mint-org workflow → `${{ secrets.PYPI_PASSWORD }}` resolved to empty). + # + # This list is the per-repo *transport*: it should contain PYPI_PASSWORD + # (for publishing) plus every secret your tests/CI need. It is generated + # from [tool.wads.ci.env] in pyproject.toml. To add one, run + # wads-secrets add VAR_NAME # updates pyproject + this block + # or just append a line below. *Which* of these become job env vars (and + # which are required) is controlled by [tool.wads.ci.env] — passing a + # secret here does not by itself put it in the environment. + # + # A secret name must also be declared in the reusable workflow's superset + # (wads/ci_secrets.py). `wads-secrets add` warns if it is not. + secrets: + PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} From cb05c491c650afee4dbfb13c134b368a3a84fe52 Mon Sep 17 00:00:00 2001 From: Thor Whalen <1906276+thorwhalen@users.noreply.github.com> Date: Mon, 3 Aug 2026 23:31:15 +0100 Subject: [PATCH 3/3] Add .editorconfig (wads scaffolding standard) Copied verbatim from a healthy repo in the ecosystem; the wads project templates ship one and this repo predates that. Claude-Session: https://claude.ai/code/session_01VipiLaG4xy7WctqY9w2475 --- .editorconfig | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..88bf4d0 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,17 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{py,toml,yml,yaml}] +indent_style = space +indent_size = 4 + +[*.md] +trim_trailing_whitespace = false + +[Makefile] +indent_style = tab