Skip to content

Commit 42b9fb4

Browse files
authored
tests: test minimum versions (#142)
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 81e4e12 commit 42b9fb4

File tree

4 files changed

+31
-6
lines changed

4 files changed

+31
-6
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,16 @@ jobs:
4646
python-version: ${{ matrix.python-version }}
4747

4848
- name: Install package
49-
run: python -m pip install .[test]
49+
run: python -m pip install ".[test]"
5050

5151
- name: Test package
52-
run: python -m pytest -ra
52+
run: python -m pytest
53+
54+
- name: Install minimum versions
55+
run: python -m pip install ".[test]" -c tests/constraints.txt
56+
57+
- name: Test minimum versions
58+
run: python -m pytest
5359

5460
pass:
5561
if: always()

noxfile.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
nox.options.sessions = ["lint", "pylint", "tests"]
66

77

8-
@nox.session
8+
@nox.session(reuse_venv=True)
99
def lint(session: nox.Session) -> None:
1010
"""
1111
Run the linter.
@@ -23,6 +23,15 @@ def tests(session: nox.Session) -> None:
2323
session.run("pytest", *session.posargs)
2424

2525

26+
@nox.session(reuse_venv=True)
27+
def minimums(session: nox.Session) -> None:
28+
"""
29+
Run the unit and regular tests.
30+
"""
31+
session.install(".[test]", "-ctests/constraints.txt")
32+
session.run("pytest", *session.posargs)
33+
34+
2635
@nox.session
2736
def pylint(session: nox.Session) -> None:
2837
"""
@@ -34,7 +43,7 @@ def pylint(session: nox.Session) -> None:
3443
session.run("pylint", "src", *session.posargs)
3544

3645

37-
@nox.session
46+
@nox.session(reuse_venv=True)
3847
def build(session: nox.Session) -> None:
3948
"""
4049
Build an SDist and wheel.

pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ dependencies = [
4343
'importlib_resources; python_version<"3.9"',
4444
'lz4',
4545
'numpy >=1.13.3',
46-
'plotext >=5.2.2',
47-
'rich >=12.0.0',
46+
'plotext >=5.2.7',
47+
'rich >=13.3.3',
4848
'textual >=0.18.0',
4949
'typing_extensions; python_version<"3.8"',
5050
'uproot >=4.2.1',
@@ -85,6 +85,8 @@ xfail_strict = true
8585
filterwarnings = [
8686
"error",
8787
"ignore:can't resolve package from __spec__ or __package__, falling back on __name__ and __path__:ImportWarning", # PyPy NumPy
88+
"ignore:module 'sre_.*' is deprecated:DeprecationWarning:awkward", # Awkward 1
89+
"ignore: pkg_resources is deprecated as an API:DeprecationWarning:uproot", # Uproot 4
8890
]
8991
log_cli_level = "info"
9092
testpaths = ["tests"]

tests/constraints.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
awkward<2
2+
click ==8.0.0
3+
hist ==2.4.0; python_version<"3.11"
4+
hist ==2.6.0; python_version=="3.11"
5+
plotext ==5.2.7
6+
rich ==13.3.3
7+
textual ==0.18.0
8+
uproot ==4.2.1

0 commit comments

Comments
 (0)