Skip to content

Infra/update#8

Merged
Weinsen merged 3 commits into
v0.0.7-rcfrom
infra/update
May 15, 2026
Merged

Infra/update#8
Weinsen merged 3 commits into
v0.0.7-rcfrom
infra/update

Conversation

@Weinsen

@Weinsen Weinsen commented May 15, 2026

Copy link
Copy Markdown
Owner

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.toml setup, 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

  • Migrated packaging metadata into pyproject.toml, including build-system configuration, project metadata, dependency declarations, optional dev and docs extras, dynamic version loading, and Ruff configuration.
  • Removed the legacy setup.py and requirements.txt files so packaging now has a single source of truth.
  • Added a shared tools/common.sh helper to centralize Python interpreter resolution, base-ref detection, and changed-file selection across local scripts.
  • Added tools/lint.sh and updated the other tool entry points to use the shared helper instead of hardcoded assumptions about the local environment.
  • Updated the GitHub Actions workflow to cover release-candidate branches, add Python 3.13 to the matrix, and install the project via editable extras (.[dev]).
  • Added a repo-specific pull request template aligned with Python/package/tooling changes instead of the previous C++-oriented structure.

Type of Change

  • Build/Infrastructure: packaging, CI, and local tooling updates
  • Documentation: new PR template for contributors

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 PR
  • python -m build: passed; built both sdist and wheel for cmdcraft-0.0.7
  • Manual testing described below when automated coverage is not enough: verified the updated tool scripts use the shared helper flow and packaging installs cleanly from pyproject.toml

Notes for Reviewers

The main review points are:

  • whether the pyproject.toml metadata fully replaces the removed legacy packaging files cleanly
  • whether the new shared shell helper keeps the tool scripts portable without over-coupling them to this repository
  • whether the PR template is the right level of structure for Python/package/tooling changes in this project

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.txt packaging with a pyproject.toml-based build and dependency definition (including Ruff and git-cliff config).
  • Introduce tools/common.sh and 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.

Comment thread .github/workflows/unit_tests.yml Outdated

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]'

Comment thread tools/test.sh
python3 -m pytest test No newline at end of file
set -eu

SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
Comment thread tools/format.sh
FILES=$(git diff --name-only --diff-filter=d develop | grep -E "(\.py$)")
set -eu

SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
Comment thread tools/lint.sh

set -eu

SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
Comment thread tools/lint.sh
@@ -0,0 +1,48 @@
#!/bin/bash
Comment thread tools/common.sh Outdated
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 thread tools/docs.sh Outdated
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.
@Weinsen
Weinsen merged commit 2f47896 into v0.0.7-rc May 15, 2026
4 checks passed
@Weinsen
Weinsen deleted the infra/update branch May 17, 2026 16:58
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