Skip to content

rewired downstream test drivers#672

Merged
RonnyPfannschmidt merged 17 commits into
pytest-dev:mainfrom
RonnyPfannschmidt:downstream-driver
May 17, 2026
Merged

rewired downstream test drivers#672
RonnyPfannschmidt merged 17 commits into
pytest-dev:mainfrom
RonnyPfannschmidt:downstream-driver

Conversation

@RonnyPfannschmidt
Copy link
Copy Markdown
Member

there was bitrot in the shell scripts
i added a python driver and a workflow to run them on github

testing them now - in particular conda and hatch may need some more details

psa - im also working on actively removing pluggy from hatch as its used in a non-idiomatic way there that doesn’t bring value

Copilot AI review requested due to automatic review settings May 6, 2026 09:47
@RonnyPfannschmidt RonnyPfannschmidt changed the title rewired ownstream test drivers rewired downstream test drivers May 6, 2026
Copy link
Copy Markdown
Contributor

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 replaces the bitrotted downstream shell scripts with a structured TOML-based downstream test runner (downstream/run_downstream.py) and adds a manual GitHub Actions workflow to execute the recipes in CI. It also updates release/docs guidance to point maintainers at the new driver.

Changes:

  • Removed the legacy downstream/*.sh scripts and replaced them with a PEP 723 Python driver plus per-project TOML recipes.
  • Added a manual-only downstream GitHub Actions workflow that runs a matrix of downstream recipes.
  • Updated RELEASING.rst and downstream/README.md to document the new invocation and recipe format.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
RELEASING.rst Updates release instructions to use the new downstream driver.
downstream/tox.sh Removes the legacy tox downstream shell script.
downstream/run_downstream.py Adds the new PEP 723 downstream driver (clone/update, env setup, install, test steps).
downstream/recipes/tox.toml Adds tox downstream recipe definition.
downstream/recipes/python-lsp-server.toml Adds python-lsp-server downstream recipe definition.
downstream/recipes/pytest.toml Adds pytest downstream recipe definition.
downstream/recipes/hatch.toml Adds hatch downstream recipe definition.
downstream/recipes/devpi.toml Adds devpi downstream recipe definition.
downstream/recipes/datasette.toml Adds datasette downstream recipe definition.
downstream/recipes/conda.toml Adds conda downstream recipe definition (bootstrap via sourced script).
downstream/README.md Documents recipe schema and how to run the driver.
downstream/python-lsp-server.sh Removes the legacy python-lsp-server downstream shell script.
downstream/pytest.sh Removes the legacy pytest downstream shell script.
downstream/hatch.sh Removes the legacy hatch downstream shell script.
downstream/devpi.sh Removes the legacy devpi downstream shell script.
downstream/datasette.sh Removes the legacy datasette downstream shell script.
downstream/conda.sh Removes the legacy conda downstream shell script.
downstream/.gitignore Ignores the new python-lsp-server/ clone directory.
.github/workflows/downstream.yml Adds manual workflow to run downstream recipe matrix on GitHub Actions.

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

Comment thread RELEASING.rst Outdated
Comment thread downstream/README.md Outdated
RonnyPfannschmidt and others added 11 commits May 12, 2026 14:33
Replace per-project shell scripts with a PEP 723 uv-runnable driver and
validated recipe files under downstream/recipes/. Environment kinds
(uv-venv, stdlib-venv, none) pair with nested [environment.install] in
each TOML. Document the flow in downstream/README.md and RELEASING.rst.

Co-authored-by: Cursor AI <ai@cursor.sh>
Co-authored-by: Composer <composer@cursor.com>
Introduce a workflow_dispatch-only workflow that runs each downstream TOML
recipe (conda, datasette, devpi, hatch, pytest, python-lsp-server, tox) on
ubuntu-latest with Python 3.12 and uv. Matrix jobs are independent
(fail-fast: false) and time out after 120 minutes. Trigger from Actions and,
when validating a change that needs it, select the relevant branch under
"Use workflow from" (for example a pull request head branch).

Co-authored-by: Cursor AI <ai@cursor.sh>
Co-authored-by: Composer <composer@cursor.com>
workflow_dispatch alone does not show checks on a pull request; add a
label-gated pull_request trigger (labeled, synchronize) so maintainers can
apply run-downstream to opt in. Document that the workflow file must exist
on the default branch to appear under upstream Actions.

Co-authored-by: Cursor AI <ai@cursor.sh>
Co-authored-by: Composer <composer@cursor.com>
Replace the run-downstream label with a head branch filter so forks
without shared labels still opt in (e.g. downstream-driver). Pull
requests still target main only.

Co-authored-by: Cursor AI <ai@cursor.sh>
Co-authored-by: Composer <composer@cursor.com>
actions/checkout defaults to a shallow clone; pluggy installs as -e ../..
need a real tree (e.g. setuptools-scm). Set fetch-depth: 0.

Co-authored-by: Cursor AI <ai@cursor.sh>
Co-authored-by: Composer <composer@cursor.com>
Hatch's backend tests use the pytest-mock "mocker" fixture; include it in
the extra uv packages so downstream CI matches a full dev install.

Co-authored-by: Cursor AI <ai@cursor.sh>
Co-authored-by: Composer <composer@cursor.com>
- Add env field to TestStep for per-step environment overrides
- tox: full clone (fixes 0.1.dev1 version) + CI=false (suppresses
  list_dependencies/freeze steps that break test expectations)
- conda: full clone (fixes vcs_versioning shallow warnings) +
  CONDA_CHANNELS=defaults,conda-forge for channel-dependent tests
- devpi: deselect test_upload.py (upstream conftest bug comparing
  list code=[200,200,200] against integers)
- python-lsp-server: deselect 2 jedi tests needing /tmp/pyenv/

Co-authored-by: Cursor AI <ai@cursor.sh>
Co-authored-by: Anthropic Claude Opus 4 <claude@anthropic.com>
… hack

- tox: also override GITHUB_ACTIONS=false (is_ci() checks both CI and
  GITHUB_ACTIONS env vars)
- devpi: switch --deselect to --ignore for test_upload.py (deselect
  path didn't match pytest node IDs)
- conda: remove CONDA_CHANNELS override — it fixes NoChannels tests
  but breaks channel-configuration tests; remaining failures are
  upstream conda CI infrastructure issues

Co-authored-by: Cursor AI <ai@cursor.sh>
Co-authored-by: Anthropic Claude Opus 4 <claude@anthropic.com>
tox's is_ci() checks presence of CI (any value) and GITHUB_ACTIONS==true.
Setting CI=false still leaves it present, so is_ci() returns True.

Now empty-string env values mean "remove from environment" in the driver,
and tox recipe uses CI="" and GITHUB_ACTIONS="" to fully unset them.

Co-authored-by: Cursor AI <ai@cursor.sh>
Co-authored-by: Anthropic Claude Opus 4 <claude@anthropic.com>
conda's own CI uses condarc-file to set channels; dev/start alone
doesn't write one, so tests creating temporary envs fail with
NoChannelsConfiguredError.  Add `conda config --add channels defaults`
after bootstrap, matching their CI's condarc-defaults configuration.

Unlike the CONDA_CHANNELS env var (which conflicted with channel-config
tests), writing to .condarc is the proper mechanism that conda's test
fixtures handle correctly.

Co-authored-by: Cursor AI <ai@cursor.sh>
Co-authored-by: Anthropic Claude Opus 4 <claude@anthropic.com>
test_export_from_history_format fails because our pluggy is
pip-installed (editable) into the conda env rather than
conda-installed, so it's missing from conda's explicit_packages.

Co-authored-by: Cursor AI <ai@cursor.sh>
Co-authored-by: Anthropic Claude Opus 4 <claude@anthropic.com>
RonnyPfannschmidt and others added 4 commits May 12, 2026 14:42
Drop stdlib-venv and EnvironmentNone/bootstrap in favour of two
environment kinds: uv-venv (venv + uv pip install) and script
(self-contained bash script handling the full workflow).

- Move conda's inline bash into recipes/conda.bash
- Switch pytest recipe from stdlib-venv to uv-venv
- Remove PipInstallOptions, StdlibInstall, NoneInstall, BootstrapConfig
  and related helpers (-104 lines of Python)

Co-authored-by: Cursor AI <ai@cursor.sh>
Co-authored-by: Anthropic Claude Opus 4 <claude@anthropic.com>
…cture

Drop the `kind` discriminator field from environment configs. The two
environment types are now distinguished by their keys:
- `editables` present → uv-venv (creates venv, installs via uv pip)
- `run` present → script (delegates to bash)

Fold `[environment.install]` and `[environment.install.uv]` sub-tables
directly into `[environment]`, removing UvInstall/UvInstallOptions models.

Co-authored-by: Cursor AI <ai@cursor.sh>
Co-authored-by: Anthropic Claude Opus 4 <claude@anthropic.com>
Drop unnecessary dict(), list(), and type annotations where the
types are already correct or inferred from context.

Co-authored-by: Cursor AI <ai@cursor.sh>
Co-authored-by: Anthropic Claude Opus 4 <claude@anthropic.com>
The previous cleanup accidentally dropped the list() wrapper around
env.items(), causing a RuntimeError when empty-string values were
deleted during iteration. Replace with a dict comprehension instead.

Co-authored-by: Cursor AI <ai@cursor.sh>
Co-authored-by: Anthropic Claude Opus 4 <claude@anthropic.com>
Copy link
Copy Markdown
Contributor

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

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

Comment thread downstream/run_downstream.py
Comment thread downstream/run_downstream.py
Comment thread downstream/recipes/conda.bash
Comment thread RELEASING.rst Outdated
Comment thread RELEASING.rst Outdated
RonnyPfannschmidt and others added 2 commits May 17, 2026 08:07
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ronny Pfannschmidt <opensource@ronnypfannschmidt.de>
Revert the review suggestion to use a temporary CONDARC file.
Exporting CONDARC overrides the devenv's own .condarc, breaking
the bootstrap. Go back to the simple conda config --add that worked.

Co-authored-by: Cursor AI <ai@cursor.sh>
Co-authored-by: Anthropic Claude Opus 4 <claude@anthropic.com>
@RonnyPfannschmidt RonnyPfannschmidt merged commit 7a700d0 into pytest-dev:main May 17, 2026
24 of 25 checks passed
@RonnyPfannschmidt
Copy link
Copy Markdown
Member Author

ignoring the hatch errors due to the content

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