Skip to content

Commit e341e39

Browse files
authored
Update and test min dependency versions (#233)
* Update and test min dependency versions Add a mindeps build and adjust lower bounds in setup.cfg * Cleanup tox and CI build config to run mindeps - cleanup caching config - make the mindeps build run on py3.7 only - use the setup-python cache
1 parent cbe7755 commit e341e39

File tree

4 files changed

+58
-43
lines changed

4 files changed

+58
-43
lines changed

.github/workflows/build.yaml

Lines changed: 49 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,96 +4,105 @@ on:
44
pull_request:
55

66
jobs:
7-
mypy:
7+
run-tox-env:
8+
strategy:
9+
matrix:
10+
toxenv: [mypy, twine-check]
11+
py: ["3.x"]
12+
include:
13+
- toxenv: py-mindeps
14+
py: "3.7"
15+
816
runs-on: ubuntu-latest
17+
name: "Run '${{ matrix.toxenv }}' on python ${{ matrix.py }}"
918
steps:
1019
- uses: actions/checkout@v3
11-
- uses: actions/setup-python@v4
12-
with:
13-
python-version: '3.x'
1420

1521
- name: get date for caching
16-
id: get-week-number
17-
run: echo "cachedate=$(/bin/date -u "+%U")" >>$GITHUB_OUTPUT
22+
run: /bin/date -u "+%U" > cachedate.txt
1823
shell: bash
1924

20-
- name: cache pip packages
21-
uses: actions/cache@v3
25+
- uses: actions/setup-python@v4
2226
with:
23-
path: ~/.cache/pip
24-
key: pip-os-${{ runner.os }}-weeknum-${{ steps.get-week-number.outputs.cachedate }}-job-${{ github.job }}
27+
python-version: "${{ matrix.py }}"
28+
cache: "pip"
29+
cache-dependency-path: |
30+
.github/workflows/build.yaml
31+
setup.cfg
32+
tox.ini
33+
cachedate.txt
2534
2635
- run: python -m pip install tox
2736

28-
- run: python -m tox run -e mypy
37+
- run: python -m tox run -e "${{ matrix.toxenv }}"
2938

30-
test:
39+
ci-test-matrix:
3140
strategy:
3241
matrix:
3342
os: [ubuntu-latest, windows-latest, macos-latest]
3443
py: ['3.7', '3.8', '3.9', '3.10', '3.11']
35-
name: "Run Tests on ${{ matrix.os }}, py${{ matrix.py }}"
44+
name: "Run tests on ${{ matrix.os }}, py${{ matrix.py }}"
3645
runs-on: ${{ matrix.os }}
3746
steps:
3847
- uses: actions/checkout@v3
39-
- uses: actions/setup-python@v4
40-
with:
41-
python-version: ${{ matrix.py }}
4248

4349
- name: get date for caching
44-
id: get-week-number
45-
run: echo "cachedate=$(/bin/date -u "+%U")" >>$GITHUB_OUTPUT
50+
run: /bin/date -u "+%U" > cachedate.txt
4651
shell: bash
4752

48-
- name: cache pip packages
49-
uses: actions/cache@v3
53+
- uses: actions/setup-python@v4
54+
id: setup-python
5055
with:
51-
path: ~/.cache/pip
52-
key: pip-os-${{ runner.os }}-weeknum-${{ steps.get-week-number.outputs.cachedate }}-job-${{ github.job }}
56+
python-version: ${{ matrix.py }}
57+
cache: "pip"
58+
cache-dependency-path: |
59+
.github/workflows/build.yaml
60+
setup.cfg
61+
tox.ini
62+
cachedate.txt
5363
5464
- run: python -m pip install tox
5565

5666
- name: cache tox virtualenvs
5767
uses: actions/cache@v3
5868
with:
5969
path: .tox
60-
key: tox-os-${{ runner.os }}-py${{ matrix.py }}-weeknum-${{ steps.get-week-number.outputs.cachedate }}-job-${{ github.job }}-hash-${{ hashFiles('tox.ini', 'setup.cfg') }}
70+
key: >
71+
tox
72+
os=${{ runner.os }}
73+
python=${{ steps.setup-python.outputs.python-version }}
74+
hash=${{ hashFiles('.github/workflows/build.yaml', 'setup.cfg', 'tox.ini', 'cachedate.txt') }}
6175
6276
- name: test
6377
run: |
6478
python -m tox run-parallel -m ci
6579
python -m tox run -e cov
66-
- name: twine-check
67-
run: python -m tox run -e twine-check
6880
6981
self-check:
7082
name: "Self-Check"
7183
runs-on: ubuntu-latest
7284
steps:
7385
- uses: actions/checkout@v3
7486

75-
- uses: actions/setup-python@v4
76-
with:
77-
python-version: '3.x'
78-
7987
- name: get date for caching
80-
id: get-week-number
81-
run: echo "cachedate=$(/bin/date -u "+%U")" >>$GITHUB_OUTPUT
88+
run: /bin/date -u "+%U" > cachedate.txt
8289
shell: bash
8390

84-
- name: cache pip packages
85-
uses: actions/cache@v3
91+
- uses: actions/setup-python@v4
8692
with:
87-
path: ~/.cache/pip
88-
key: pip-os-${{ runner.os }}-weeknum-${{ steps.get-week-number.outputs.cachedate }}-job-${{ github.job }}
93+
python-version: "3.x"
94+
cache: "pip"
95+
cache-dependency-path: |
96+
.github/workflows/build.yaml
97+
setup.cfg
98+
tox.ini
99+
cachedate.txt
89100
90101
- name: install from source
91-
run: |
92-
python -m pip install -U pip setuptools
93-
python -m pip install .
102+
run: python -m pip install .
94103

95104
- name: run on own workflows via HTTPS schema
96-
run: check-jsonschema --schemafile "https://json.schemastore.org/github-workflow" .github/workflows/*.yaml
105+
run: check-jsonschema --schemafile "https://json.schemastore.org/github-workflow" .github/workflows/*.yaml
97106

98107
- name: run on own workflows via vendored schema
99-
run: check-jsonschema --builtin-schema vendor.github-workflows .github/workflows/*.yaml
108+
run: check-jsonschema --builtin-schema vendor.github-workflows .github/workflows/*.yaml

CHANGELOG.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ Unreleased
1111
.. vendor-insert-here
1212
1313
- Update vendored schemas (2023-01-18)
14-
- Fix a bug in which `--check-metaschema` was not building validators correctly.
14+
- Fix a bug in which ``--check-metaschema`` was not building validators correctly.
1515
The metaschema's schema dialect is chosen correctly now, and metaschema
1616
formats are now checked by default. This can be disabled with
17-
`--disable-format`.
17+
``--disable-format``.
1818
- Fix the resolution of `$schema` dialect to format checker classes
19+
- Fix package dependency lower bounds, including setting ``jsonschema>=4.5.1``
1920

2021
0.20.0
2122
------

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ classifiers =
1818
python_requires = >=3.7
1919
# reference for dependency spec: https://www.python.org/dev/peps/pep-0508/
2020
install_requires =
21-
importlib_resources;python_version<"3.9"
21+
importlib-resources>=1.4.0;python_version<"3.9"
2222
ruamel.yaml==0.17.21
2323
jsonschema>=4,<5.0
2424
requests<3.0

tox.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
envlist =
33
mypy
44
cov_clean
5+
py37-mindeps
56
py{311,310,39,38,37}
67
py310-{notoml,tomli-format}
78
py{37,311}-{json5,pyjson5}
@@ -17,6 +18,10 @@ description = "run tests with pytest"
1718
usedevelop = true
1819
extras = dev
1920
deps =
21+
mindeps: jsonschema==4.5.1
22+
mindeps: click==8.0.0
23+
mindeps: requests==2.0.0
24+
mindeps: importlib-resources==1.4.0
2025
json5: json5
2126
pyjson5: pyjson5
2227
tomli: tomli

0 commit comments

Comments
 (0)