Infra/update#8
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR modernizes the project’s packaging and repository automation by migrating fully to pyproject.toml, consolidating local tooling around a shared shell helper, and updating CI and contribution workflows accordingly.
Changes:
- Replace legacy
setup.py/requirements.txtpackaging with apyproject.toml-based build and dependency definition (including Ruff and git-cliff config). - Introduce
tools/common.shand update/add tool entry points (lint.sh,format.sh,test.sh) to use shared Python/base-ref/target selection logic. - Update GitHub Actions CI to install via
.[dev], expand branch coverage, add Python 3.13, and add a Python-oriented PR template.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
tools/test.sh |
Uses shared helper for Python resolution; forwards CLI args to pytest. |
tools/lint.sh |
New Ruff lint/format-check script using shared helper and scope selection. |
tools/format.sh |
Moves formatting to shared helper + python -m ruff invocation. |
tools/docs.sh |
Copyright header update only. |
tools/common.sh |
New shared functions for Python selection and changed-file discovery. |
tools/analyse.sh |
Removes legacy Ruff analysis script. |
setup.py |
Removes legacy setuptools-based packaging entry point. |
requirements.txt |
Removes legacy dependency pin file. |
pyproject.toml |
Adds full packaging metadata + dynamic version + Ruff/git-cliff config. |
.github/workflows/unit_tests.yml |
Updates triggers/matrix/install approach (currently contains CI-breaking issues). |
.github/pull_request_template.md |
Adds a repo-specific PR template for Python/package/tooling changes. |
Comments suppressed due to low confidence (2)
tools/lint.sh:48
${FILES}is expanded unquoted when invoking Ruff. If any tracked filenames contain whitespace, this will break (and can also produce confusing failures). Consider reading targets line-by-line (or using an array in bash) so each path is passed as its own argument safely.
PYTHON_BIN=$(tool_python_bin)
FILES=$(tool_python_targets_for_scope "$scope")
if [ -z "${FILES}" ]; then
exit 0
fi
"${PYTHON_BIN}" -m ruff check ${FILES}
"${PYTHON_BIN}" -m ruff format --check ${FILES}
tools/format.sh:23
${FILES}is expanded unquoted when invoking Ruff. If any tracked filenames contain whitespace, this can break argument parsing. Consider invoking Ruff in a way that preserves filenames safely (e.g., iterate line-by-line).
PYTHON_BIN=$(tool_python_bin)
FILES=$(tool_python_targets_for_scope changed)
if [ -z "${FILES}" ]; then
exit 0
fi
"${PYTHON_BIN}" -m ruff check --fix ${FILES}
"${PYTHON_BIN}" -m ruff format ${FILES}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| jobs: | ||
| test: | ||
| if: github.event.pull_request.draft == false |
Comment on lines
34
to
+36
| python -m pip install --upgrade pip | ||
| python -m pip install . ruff coverage pytest readme_renderer | ||
| - name: Analysis | ||
| run: ./tools/analyse.sh | ||
| pip install -e '.[dev]' | ||
|
|
| python3 -m pytest test No newline at end of file | ||
| set -eu | ||
|
|
||
| SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) |
| FILES=$(git diff --name-only --diff-filter=d develop | grep -E "(\.py$)") | ||
| set -eu | ||
|
|
||
| SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) |
|
|
||
| set -eu | ||
|
|
||
| SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) |
| @@ -0,0 +1,48 @@ | |||
| #!/bin/bash | |||
Comment on lines
+42
to
+48
| if command -v python >/dev/null 2>&1; then | ||
| printf '%s\n' 'python' | ||
| return 0 | ||
| fi | ||
|
|
||
| if command -v python3 >/dev/null 2>&1; then | ||
| printf '%s\n' 'python3' |
Comment on lines
1
to
4
| #!/bin/sh | ||
| # ***************************************************************************** | ||
| # Copyright (c) 2024, Antonio Mario Weinsen Junior | ||
| # Copyright (c) 2024-2026, Antonio Mario Weinsen Junior | ||
| # All rights reserved. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This branch modernizes the project’s packaging and repo automation for the next release cycle.
It replaces the legacy setuptools entry points with a pure
pyproject.tomlsetup, consolidates shell tooling around a reusable shared helper, updates CI to install from the package metadata, and adds a Python-focused pull request template.What Changed
pyproject.toml, including build-system configuration, project metadata, dependency declarations, optionaldevanddocsextras, dynamic version loading, and Ruff configuration.setup.pyandrequirements.txtfiles so packaging now has a single source of truth.tools/common.shhelper to centralize Python interpreter resolution, base-ref detection, and changed-file selection across local scripts.tools/lint.shand updated the other tool entry points to use the shared helper instead of hardcoded assumptions about the local environment..[dev]).Type of Change
Validation
./tools/lint.sh --changed: currently fails on an inherited module-docstring Ruff issue from the base branch, outside this branch-specific diff./tools/test.sh -q: passed (16 passed in 0.08s)./tools/docs.sh: not run; no branch-local docs or public API changes require a docs rebuild for this PRpython -m build: passed; built both sdist and wheel forcmdcraft-0.0.7pyproject.tomlNotes for Reviewers
The main review points are:
pyproject.tomlmetadata fully replaces the removed legacy packaging files cleanly