1
1
name : json-store
2
2
on : [push, pull_request]
3
3
4
- env :
5
- pip-cache-key : 2023.02.03
6
-
7
4
jobs :
8
5
lint :
9
6
runs-on : ubuntu-latest
10
7
11
8
steps :
12
9
- uses : actions/checkout@v4
13
10
14
- - name : pip cache
15
- uses : actions/cache@v4
16
- with :
17
- path : ~/.cache/pip
18
- key : ${{ runner.os }}-pip-${{ github.job }}-${{ env.pip-cache-key }}
19
- restore-keys : |
20
- ${{ runner.os }}-pip-
11
+ - name : Install uv
12
+ uses : astral-sh/setup-uv@v2
21
13
22
14
- name : pre-commit cache
23
15
uses : actions/cache@v4
@@ -27,40 +19,20 @@ jobs:
27
19
restore-keys : |
28
20
${{ runner.os }}-pre-commit-
29
21
30
- - name : Display Python version
31
- run : python -c "import sys; print(sys.version)"
32
-
33
- - name : Install ${{ github.job }} dependencies
34
- run : pip install --disable-pip-version-check pre-commit
35
-
36
22
- name : Run pre-commit tests
37
- run : pre-commit run -a
23
+ run : uv tool run pre-commit run -a
38
24
39
25
build :
40
26
runs-on : ubuntu-latest
41
27
42
28
steps :
43
29
- uses : actions/checkout@v4
44
30
45
- - name : pip cache
46
- uses : actions/cache@v4
47
- with :
48
- path : ~/.cache/pip
49
- key : ${{ runner.os }}-pip-${{ github.job }}-${{ env.pip-cache-key }}
50
- restore-keys : |
51
- ${{ runner.os }}-pip-
52
-
53
- - name : Display Python version
54
- run : python -c "import sys; print(sys.version)"
55
-
56
- - name : Upgrade pip and setuptools
57
- run : python -m pip install --upgrade pip setuptools
58
-
59
- - name : Install ${{ github.job }} dependencies
60
- run : pip --disable-pip-version-check install wheel build
31
+ - name : Install uv
32
+ uses : astral-sh/setup-uv@v2
61
33
62
34
- name : Build package
63
- run : python -m build
35
+ run : uv build
64
36
65
37
- name : Store build artifacts
66
38
uses : actions/upload-artifact@v4
@@ -72,44 +44,32 @@ jobs:
72
44
needs : [lint, build]
73
45
strategy :
74
46
matrix :
75
- os : [ubuntu-latest, windows-latest ]
47
+ os : [ubuntu-latest]
76
48
python-version : ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy-3.10"]
49
+ include :
50
+ - os : windows-latest
51
+ python-version : ["3.8", "3.12"]
52
+ - os : macos-latest
53
+ python-version : ["3.8", "3.12"]
77
54
runs-on : ${{ matrix.os }}
78
55
79
56
steps :
80
57
- uses : actions/checkout@v4
81
58
82
- - name : pip cache
83
- uses : actions/cache@v4
84
- with :
85
- path : ~/.cache/pip
86
- key : ${{ runner.os }}-pip-${{ github.job }}-${{ env.pip-cache-key }}
87
- restore-keys : |
88
- ${{ runner.os }}-pip-
59
+ - name : Install uv
60
+ uses : astral-sh/setup-uv@v2
89
61
90
62
- name : Set up Python ${{ matrix.python-version }}
91
63
uses : actions/setup-python@v5
92
64
with :
93
65
python-version : ${{ matrix.python-version }}
94
66
95
- - name : Download build artifacts
96
- uses : actions/download-artifact@v4
97
- with :
98
- name : dist
99
- path : dist
100
-
101
67
- name : Install ${{ github.job }} dependencies
102
68
run : |
103
- pip install --disable-pip-version-check pytest
104
-
105
- - name : Install json-store package
106
- shell : bash # so this works on both Linux and Windows
107
- run : |
108
- pip install --disable-pip-version-check dist/json_store-*.whl
69
+ uv sync --dev
109
70
110
71
- name : Test with pytest
111
- run : pytest
72
+ run : uv run pytest
112
73
113
74
- name : Test shelve2json
114
- if : ${{ matrix.os != 'windows-latest' }} # shelve.open has an internal traceback on Windows
115
- run : sh tests/test_shelve2json.sh
75
+ run : uv run sh tests/test_shelve2json.sh
0 commit comments