Skip to content

Commit c35dfe8

Browse files
committed
Use pinned dependencies for testing
I've now duplicated the tests: they will run once with pinned deps, and once without. My intention is to make it easy to spot failures due to updates in dependencies, while also making it possible to separate out fixes due to updates in dependencies (often changes in mypy or ruff) from the content of particular MRs. I've also deleted requirements.txt as it wasn't being used.
1 parent b446f8d commit c35dfe8

File tree

4 files changed

+206
-58
lines changed

4 files changed

+206
-58
lines changed

.github/workflows/test.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
python-version: ${{ matrix.python }}
4646

4747
- name: Install Dependencies
48-
run: pip install -e .[dev,server]
48+
run: pip install . -r dev-requirements.txt
4949

5050
- name: Lint with Ruff
5151
run: ruff check .
@@ -65,6 +65,37 @@ jobs:
6565
- name: Analyse with MyPy
6666
run: mypy src
6767

68+
test-with-unpinned-deps:
69+
runs-on: ubuntu-latest
70+
strategy:
71+
matrix:
72+
python: ["3.9", "3.10", "3.11", "3.12"]
73+
74+
steps:
75+
- uses: actions/checkout@v3
76+
77+
- name: Set up Python
78+
uses: actions/setup-python@v4
79+
with:
80+
python-version: ${{ matrix.python }}
81+
82+
- name: Install Dependencies
83+
run: pip install .[dev,server]
84+
85+
- name: Lint with Ruff
86+
run: ruff check .
87+
88+
- name: Format with Ruff
89+
if: success() || failure()
90+
run: ruff format --check .
91+
92+
- name: Test with pytest
93+
if: success() || failure()
94+
run: pytest --cov=src --cov-report=lcov
95+
96+
- name: Analyse with MyPy
97+
run: mypy src
98+
6899
coverage:
69100
runs-on: ubuntu-latest
70101
needs: [base_coverage, test]

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ You can install this repository with `pip`, either clone it and run `pip install
3434

3535
The code is linted with `ruff .`, type checked with `mypy src`, and tested with `pytest`. These all run in CI with GitHub Actions. The codebase is not even `v0.1` yet so it's still subject to summary rearrangement.
3636

37+
Dependencies are defined in `pyproject.toml` and can be compiled to `dev-requirements.txt` with:
38+
39+
```
40+
uv pip compile --extra dev --extra server pyproject.toml --output-file dev-requirements.txt
41+
```
42+
43+
If you're not using `uv`, just regular `pip-compile` from `pip-tools` will do the same thing.
44+
3745
## Demo
3846

3947
See the [examples folder](./examples/) for a runnable demo.

dev-requirements.txt

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
# This file was autogenerated by uv via the following command:
2+
# uv pip compile --extra dev --extra server pyproject.toml --output-file dev-requirements.txt
3+
annotated-types==0.7.0
4+
# via pydantic
5+
anyio==4.8.0
6+
# via
7+
# labthings-fastapi (pyproject.toml)
8+
# httpx
9+
# starlette
10+
# watchfiles
11+
attrs==25.1.0
12+
# via
13+
# jsonschema
14+
# referencing
15+
certifi==2025.1.31
16+
# via
17+
# httpcore
18+
# httpx
19+
click==8.1.8
20+
# via
21+
# rich-toolkit
22+
# typer
23+
# uvicorn
24+
colorama==0.4.6
25+
# via
26+
# click
27+
# pytest
28+
# uvicorn
29+
coverage==7.6.12
30+
# via pytest-cov
31+
dnspython==2.7.0
32+
# via email-validator
33+
email-validator==2.2.0
34+
# via fastapi
35+
fastapi==0.115.11
36+
# via labthings-fastapi (pyproject.toml)
37+
fastapi-cli==0.0.7
38+
# via fastapi
39+
h11==0.14.0
40+
# via
41+
# httpcore
42+
# uvicorn
43+
httpcore==1.0.7
44+
# via httpx
45+
httptools==0.6.4
46+
# via uvicorn
47+
httpx==0.28.1
48+
# via
49+
# labthings-fastapi (pyproject.toml)
50+
# fastapi
51+
idna==3.10
52+
# via
53+
# anyio
54+
# email-validator
55+
# httpx
56+
ifaddr==0.2.0
57+
# via zeroconf
58+
iniconfig==2.0.0
59+
# via pytest
60+
itsdangerous==2.2.0
61+
# via fastapi
62+
jinja2==3.1.6
63+
# via fastapi
64+
jsonschema==4.23.0
65+
# via labthings-fastapi (pyproject.toml)
66+
jsonschema-specifications==2024.10.1
67+
# via jsonschema
68+
markdown-it-py==3.0.0
69+
# via rich
70+
markupsafe==3.0.2
71+
# via jinja2
72+
mdurl==0.1.2
73+
# via markdown-it-py
74+
mypy==1.15.0
75+
# via labthings-fastapi (pyproject.toml)
76+
mypy-extensions==1.0.0
77+
# via mypy
78+
numpy==2.2.3
79+
# via labthings-fastapi (pyproject.toml)
80+
orjson==3.10.15
81+
# via fastapi
82+
packaging==24.2
83+
# via pytest
84+
pluggy==1.5.0
85+
# via pytest
86+
pydantic==2.10.6
87+
# via
88+
# labthings-fastapi (pyproject.toml)
89+
# fastapi
90+
# pydantic-extra-types
91+
# pydantic-settings
92+
pydantic-core==2.27.2
93+
# via pydantic
94+
pydantic-extra-types==2.10.2
95+
# via fastapi
96+
pydantic-settings==2.8.1
97+
# via fastapi
98+
pygments==2.19.1
99+
# via rich
100+
pytest==7.4.4
101+
# via
102+
# labthings-fastapi (pyproject.toml)
103+
# pytest-cov
104+
pytest-cov==6.0.0
105+
# via labthings-fastapi (pyproject.toml)
106+
python-dotenv==1.0.1
107+
# via
108+
# pydantic-settings
109+
# uvicorn
110+
python-multipart==0.0.20
111+
# via fastapi
112+
pyyaml==6.0.2
113+
# via
114+
# fastapi
115+
# uvicorn
116+
referencing==0.36.2
117+
# via
118+
# jsonschema
119+
# jsonschema-specifications
120+
# types-jsonschema
121+
rich==13.9.4
122+
# via
123+
# rich-toolkit
124+
# typer
125+
rich-toolkit==0.13.2
126+
# via fastapi-cli
127+
rpds-py==0.23.1
128+
# via
129+
# jsonschema
130+
# referencing
131+
ruff==0.9.10
132+
# via labthings-fastapi (pyproject.toml)
133+
shellingham==1.5.4
134+
# via typer
135+
sniffio==1.3.1
136+
# via anyio
137+
starlette==0.46.0
138+
# via fastapi
139+
typer==0.15.2
140+
# via fastapi-cli
141+
types-jsonschema==4.23.0.20241208
142+
# via labthings-fastapi (pyproject.toml)
143+
typing-extensions==4.12.2
144+
# via
145+
# labthings-fastapi (pyproject.toml)
146+
# anyio
147+
# fastapi
148+
# mypy
149+
# pydantic
150+
# pydantic-core
151+
# pydantic-extra-types
152+
# referencing
153+
# rich-toolkit
154+
# typer
155+
ujson==5.10.0
156+
# via fastapi
157+
uvicorn==0.34.0
158+
# via
159+
# fastapi
160+
# fastapi-cli
161+
watchfiles==1.0.4
162+
# via uvicorn
163+
websockets==15.0.1
164+
# via uvicorn
165+
zeroconf==0.146.1
166+
# via labthings-fastapi (pyproject.toml)

requirements.txt

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)