Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/downstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Downstream checks run on pull requests to main when the head branch name
# contains "downstream", or any time via workflow_dispatch. For dispatch-only
# runs: Actions → downstream → Run workflow → pick a branch under "Use workflow from".
#
# The workflow must exist on the default branch for it to appear under the
# upstream repo's Actions tab; until the workflow is merged, use the fork's
# Actions (or dispatch from a branch that contains this file).
name: downstream

on:
workflow_dispatch:
pull_request:
branches:
- main

permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
recipe:
name: downstream (${{ matrix.recipe }})
runs-on: ubuntu-latest
timeout-minutes: 120
if: >-
github.event_name == 'workflow_dispatch'
|| (github.event_name == 'pull_request' && contains(github.head_ref, 'downstream'))
strategy:
fail-fast: false
matrix:
recipe:
- conda
- datasette
- devpi
- hatch
- pytest
- python-lsp-server
- tox
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
allow-prereleases: true
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- name: Run downstream recipe
run: uv run downstream/run_downstream.py "${{ matrix.recipe }}"
3 changes: 2 additions & 1 deletion RELEASING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ Release Procedure

#. Dependening on the magnitude of the changes in the release, consider testing
some of the large downstream users of pluggy against the upcoming release.
You can do so using the scripts in the ``downstream/`` directory.
You can do so with ``uv run downstream/run_downstream.py`` (option
``--list`` lists recipes).

#. From a clean work tree, execute::

Expand Down
1 change: 1 addition & 0 deletions downstream/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
/devpi/
/hatch/
/pytest/
/python-lsp-server/
/tox/
39 changes: 37 additions & 2 deletions downstream/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,37 @@
This directory contains scripts for testing some downstream projects
against your current pluggy worktree.
This directory contains tooling for testing some downstream projects against
your current pluggy checkout.

Each project is described by a TOML recipe in `recipes/` with three top-level
sections plus tests:

1. **`[git]`** — repository URL, local directory name (`into`), optional `shallow`
(default: shallow clone).
2. **`[environment]`** — how the Python environment is created **once** (skipped
if `venv/pyvenv.cfg` already exists):
- `kind = "uv-venv"` — `uv venv venv` in the clone root.
- `kind = "stdlib-venv"` — `python -m venv venv` in the clone root.
- `kind = "none"` — do not create a venv (e.g. conda’s `dev/start` workflow).
**`[environment.install]`** holds **`editables`**: strings passed as consecutive
**`-e`** arguments to `uv pip install` or `pip install` (same forms you would
type on the command line, e.g. `".[dev]"`, `"../.."`). Optional
**`[environment.install.uv]`** (`groups`, `packages`) or
**`[environment.install.pip]`** (`packages`) match the environment kind. For
`kind = "none"`, **`[environment.install.bootstrap]`** with `source` is
required (shell script sourced before pip). Rerun tests without reinstall:
`uv run downstream/run_downstream.py --skip-install RECIPE`.
3. **`[[test]]`** — one or more `argv` arrays. For `uv-venv` / `stdlib-venv`, the
driver sets **`VIRTUAL_ENV`** and prepends the venv’s `bin` (or `Scripts` on
Windows) to **`PATH`**, so test commands can use bare names like `pytest`.
Install only: `--only-install`.

Run the driver (PEP 723 in `run_downstream.py`):

```bash
uv run downstream/run_downstream.py --list
uv run downstream/run_downstream.py pytest
uv run downstream/run_downstream.py pytest --skip-install
```

Requirements: Python 3.11+ for the driver, `git`, and `uv` where recipes use it.
Recipes using `uv-venv` / `stdlib-venv` get an activated-style environment for
install and test subprocesses; conda recipes use `bash` and their own `dev/start`.
12 changes: 0 additions & 12 deletions downstream/conda.sh

This file was deleted.

10 changes: 0 additions & 10 deletions downstream/datasette.sh

This file was deleted.

13 changes: 0 additions & 13 deletions downstream/devpi.sh

This file was deleted.

10 changes: 0 additions & 10 deletions downstream/hatch.sh

This file was deleted.

10 changes: 0 additions & 10 deletions downstream/pytest.sh

This file was deleted.

31 changes: 0 additions & 31 deletions downstream/python-lsp-server.sh

This file was deleted.

19 changes: 19 additions & 0 deletions downstream/recipes/conda.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[git]
url = "https://github.com/conda/conda"
into = "conda"

[environment]
kind = "none"

[environment.install]
editables = ["../.."]

[environment.install.bootstrap]
source = "dev/start"

[[test]]
argv = [
"bash",
"-c",
"set +eu; source dev/start; set -eu; pytest -m \"not integration and not installed\"",
]
15 changes: 15 additions & 0 deletions downstream/recipes/datasette.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[git]
url = "https://github.com/simonw/datasette"
into = "datasette"

[environment]
kind = "uv-venv"

[environment.install]
editables = [".", "../.."]

[environment.install.uv]
groups = ["dev"]

[[test]]
argv = ["pytest"]
24 changes: 24 additions & 0 deletions downstream/recipes/devpi.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[git]
url = "https://github.com/devpi/devpi"
into = "devpi"

[environment]
kind = "uv-venv"

[environment.install]
editables = ["common", "server", "client", "web", "../.."]

[environment.install.uv]
groups = ["pytest"]

[[test]]
argv = ["pytest", "common"]

[[test]]
argv = ["pytest", "server"]

[[test]]
argv = ["pytest", "client"]

[[test]]
argv = ["pytest", "web"]
22 changes: 22 additions & 0 deletions downstream/recipes/hatch.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[git]
url = "https://github.com/pypa/hatch"
into = "hatch"

[environment]
kind = "uv-venv"

[environment.install]
editables = [".", "./backend", "../.."]

[environment.install.uv]
packages = [
"pytest",
"pytest-xdist",
"filelock",
"flit-core",
"trustme",
"editables",
]

[[test]]
argv = ["pytest", "tests/backend"]
13 changes: 13 additions & 0 deletions downstream/recipes/pytest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[git]
url = "https://github.com/pytest-dev/pytest"
into = "pytest"
shallow = false

[environment]
kind = "stdlib-venv"

[environment.install]
editables = [".[dev]", "../.."]

[[test]]
argv = ["pytest"]
12 changes: 12 additions & 0 deletions downstream/recipes/python-lsp-server.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[git]
url = "https://github.com/python-lsp/python-lsp-server.git"
into = "python-lsp-server"

[environment]
kind = "uv-venv"

[environment.install]
editables = [".[all,test]", "../.."]

[[test]]
argv = ["pytest"]
15 changes: 15 additions & 0 deletions downstream/recipes/tox.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[git]
url = "https://github.com/tox-dev/tox"
into = "tox"

[environment]
kind = "uv-venv"

[environment.install]
editables = [".[completion]", "../.."]

[environment.install.uv]
groups = ["test"]

[[test]]
argv = ["pytest"]
Loading
Loading