Repository navigation
97 lines (88 loc) · 3.7 KB
/
Copy pathcorpus.yml
File metadata and controls
97 lines (88 loc) · 3.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Consumer corpus
# The suite in `tests/` imports the source tree. This installs a build instead and checks code written
# the way a consumer writes it: a plain pytest suite, a fully annotated one at maximum strictness, the
# numpy/pandas stack, containers of somebody else's making, and the deliberately dynamic parts.
#
# It exists because the last several typing defects were found by guessing at other people's code
# rather than by running it: a selector type that refused a mapping with its own `__getitem__`, a
# `slice` that stopped type-checking on 3.10, an unparameterised `Matcher` that made every member
# "partially unknown" under pyright strict. Each was invisible from inside the repository.
#
# One project is not about the typed surface at all: the pytest plugin has no API to call, and its
# hooks, ini options and xdist transport had never run from an installed wheel until it existed.
#
# Not in the main gate: it builds the package and creates one environment per project, which takes
# minutes rather than seconds. It runs on a schedule, on demand, and on anything touching the package
# or its packaging, which is where its findings come from.
on:
# the whole package, rather than the files that looked relevant: this corpus reads *behaviour* from an
# installed wheel, and what produces a diff or a report reaches back through the engine, the snapshot
# machinery and the polling. A hand-kept list of those was already wrong twice, once for the module
# that records late polls and once for the ones that build the diff a section prints
push:
paths:
- "assertpy2/**"
- "pyproject.toml"
- "corpus/**"
- ".github/workflows/corpus.yml"
pull_request:
paths:
- "assertpy2/**"
- "pyproject.toml"
- "corpus/**"
- ".github/workflows/corpus.yml"
schedule:
- cron: "0 5 * * 2" # weekly, Tuesday 05:00 UTC
workflow_dispatch: {}
permissions:
contents: read
concurrency:
group: corpus-${{ github.ref }}
cancel-in-progress: true
jobs:
corpus:
timeout-minutes: 25
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# both ends of the supported range, because two findings so far were version-dependent: a
# `slice` is unhashable before 3.12, and stub differences move what a checker accepts
include:
- os: ubuntu-latest
python: "3.10"
install: wheel
- os: ubuntu-latest
python: "3.15"
install: wheel
- os: ubuntu-latest
python: "3.14"
install: sdist
- os: windows-latest
python: "3.14"
install: wheel
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
# the runner itself needs 3.11 or later for `tomllib`; the version under test is the one the
# consumer environments are built on, which is what `--python` selects
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.13"
- name: Run the corpus
run: >
python corpus/run.py
--from ${{ matrix.install }}
--python ${{ matrix.python }}
--json corpus-results.json
- name: Publish the results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: corpus-${{ matrix.os }}-${{ matrix.python }}-${{ matrix.install }}
path: corpus-results.json
if-no-files-found: ignore