Skip to content

Refactor run_program() function#95

Open
zsimic wants to merge 8 commits intomainfrom
refactor-program-runs
Open

Refactor run_program() function#95
zsimic wants to merge 8 commits intomainfrom
refactor-program-runs

Conversation

@zsimic
Copy link
Collaborator

@zsimic zsimic commented Feb 9, 2026

  • Removed commands: entrypoints, cleanall

  • Removed old register hook used with setuptools v50

  • Removed support for pygradle-style versioning

  • Refactored usage of subrocess.run(), removed last left overs from the py2 days

Copy link

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

This PR refactors setupmeta.run_program() and related SCM execution paths to use a structured RunResult (via subprocess.run()), while removing several legacy features (old setuptools hook alias, deprecated commands, and pygradle-style versioning) and updating tests/scenario fixtures accordingly.

Changes:

  • Refactors program execution and git SCM interactions to consistently return/consume RunResult objects.
  • Removes legacy commands (entrypoints, cleanall), old setuptools v50 register hook alias, and pygradle versioning support.
  • Updates tests, scenario outputs, documentation, and CI workflows to match the new behavior.

Reviewed changes

Copilot reviewed 41 out of 41 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
tox.ini Adds wheel for py37 and adjusts coverage config paths/output.
tests/test_versioning.py Updates expectations/log capture around tracing + SCM behavior changes.
tests/test_setup_py.py Moves legacy setup.py execution tests into a dedicated test module.
tests/test_scm.py Updates SCM tests for new output/warning/RunResult behavior.
tests/test_scenarios.py Uses setupmeta.run_program() for adhoc scenario replay and sets env flags via monkeypatch.
tests/test_model.py Removes pygradle version env test and related imports.
tests/test_content.py Removes tests for removed helpers (decode, which, legacy run_program API) and updates listify coverage.
tests/test_commands.py Updates console width test and removes cleanall command test.
tests/scenarios/via_req_files/expected.txt Removes entrypoints output from scenario expectations.
tests/scenarios/simple-src/expected.txt Removes entrypoints output from scenario expectations.
tests/scenarios/readmes/expected.txt Removes entrypoints output from scenario expectations.
tests/scenarios/pinned/expected.txt Removes entrypoints output from scenario expectations.
tests/scenarios/packaged/expected.txt Removes entrypoints output from scenario expectations.
tests/scenarios/disabled/expected.txt Removes entrypoints and cleanall expectations from disabled scenario.
tests/scenarios/disabled/.commands Drops cleanall from scenario command list.
tests/scenarios/complex-reqs/expected.txt Removes entrypoints output from scenario expectations.
tests/scenarios/bogus/setup.py Adjusts bogus versioning data shape used by scenarios.
tests/scenarios/bogus/expected.txt Updates expected output/error text for new bump error messaging and removed commands.
tests/scenarios/README.rst Updates scenario docs to reflect command set run during scenario tests.
tests/scenarios.py Updates scenario runner (command list, git wrapper, preparation logging, replay diff handling).
tests/conftest.py Refactors git helpers, output capture helpers, and output cleaning around RunResult.
setupmeta/versioning.py Tightens format parsing and updates bump error messaging; removes pygradle env support.
setupmeta/scm.py Refactors git execution into run_git()/git_output(), adds ignore/warn behavior, adds diff report API.
setupmeta/model.py Removes explicitness tracking from definitions and simplifies get_pip() import probing.
setupmeta/hook.py Removes deprecated setuptools v50 register alias hook.
setupmeta/commands.py Removes legacy commands and adjusts git status display to use new diff reporting API.
setupmeta/init.py Refactors run_program() to return RunResult, adds path caching, updates tracing and console width detection.
setup.py Removes entrypoints for deleted commands and modernizes bootstrap subprocess handling; sets setuptools minimum.
pyproject.toml Disables TD rule selection (commented out).
examples/via-cfg/expected.txt Removes entrypoints output from example expectations.
examples/single/expected.txt Removes entrypoints output from example expectations.
examples/hierarchical/expected.txt Removes entrypoints output from example expectations.
examples/direct/expected.txt Removes entrypoints output from example expectations.
docs/versioning.rst Documents tag matching behavior change trajectory and clarifies historical defaults.
docs/commands.rst Removes documentation for deleted cleanall and entrypoints commands.
HISTORY.rst Updates 3.9.0 release notes to reflect removed features and refactors.
.github/workflows/tests.yml Changes git identity used during CI runs.
.github/workflows/release.yml Changes git identity used during release workflow runs.

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

zsimic and others added 7 commits February 10, 2026 22:18
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.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.

1 participant