19
19
20
20
jobs :
21
21
lint :
22
- name : Lint & Mypy
23
- runs-on : ubuntu-latest
22
+ name : Static Checks
23
+ runs-on : " ubuntu-24.04 "
24
24
steps :
25
+ - uses : extractions/setup-just@v2
25
26
- uses : actions/checkout@v3
26
27
- name : Set up Python 3
27
28
uses : actions/setup-python@v4
28
29
with :
29
30
python-version : " 3.10"
30
- - name : mypy
31
- run : make mypy
32
- - name : lint
33
- run : make lint
34
- - name : fmtcheck
35
- run : make fmtcheck
31
+ -
name :
check examples w/ mypy (against [email protected] )
32
+ run : just typecheck-examples
33
+ # skip deps on all these since mypy installed everything
34
+ - name : check linting
35
+ run : just --no-deps lint
36
+ - name : check formatting
37
+ run : just --no-deps format-check
38
+ # pyright depends on node, which it handles and installs for itself as needed
39
+ # we _could_ run setup-node to make it available for it if we're having reliability problems
40
+ - name : check types (all Python versions)
41
+ run : |
42
+ set -eox
43
+
44
+ for minor in {6..12}; do
45
+ just --no-deps typecheck $minor
46
+ done
36
47
37
48
build :
38
49
name : Build
39
- runs-on : ubuntu-latest
50
+ runs-on : " ubuntu-24.04 "
40
51
steps :
52
+ - uses : extractions/setup-just@v2
41
53
- uses : actions/checkout@v3
42
54
43
55
- name : Set up Python 3
44
56
uses : actions/setup-python@v4
45
57
with :
46
58
python-version : " 3.10"
47
59
48
- - name : Install tools
49
- run : make venv
50
-
51
60
- name : Build and check package
52
61
run : |
53
- set -x
54
- source venv/bin/activate
55
- python setup.py clean --all sdist bdist_wheel --universal
56
- python -m twine check dist/*
62
+ just build
57
63
58
64
- name : " Upload Artifact"
59
65
uses : actions/upload-artifact@v3
@@ -69,45 +75,30 @@ jobs:
69
75
strategy :
70
76
fail-fast : false
71
77
matrix :
72
- python :
73
- - { version: "3.6" , env: "py36" }
74
- - { version: "3.7" , env: "py37" }
75
- - { version: "3.8" , env: "py38" }
76
- - { version: "3.9" , env: "py39" }
77
- - { version: "3.10" , env: "py310" }
78
- - { version: "3.11" , env: "py311" }
79
- - { version: "3.12" , env: "py312" }
80
- - { version: "pypy-3.7" , env: "py3.7" }
81
- - { version: "pypy-3.8" , env: "py3.8" }
82
- - { version: "pypy-3.9" , env: "py3.9" }
83
- - { version: "pypy-3.10" , env: "py3.10" }
84
- name : Test (${{ matrix.python.version }})
78
+ python_version :
79
+ - " 3.6"
80
+ - " 3.7"
81
+ - " 3.8"
82
+ - " 3.9"
83
+ - " 3.10"
84
+ - " 3.11"
85
+ - " 3.12"
86
+ - " pypy-3.7"
87
+ - " pypy-3.8"
88
+ - " pypy-3.9"
89
+ - " pypy-3.10"
90
+ name : Test (${{ matrix.python_version }})
85
91
steps :
92
+ - uses : extractions/setup-just@v2
86
93
- uses : actions/checkout@v3
87
-
88
- - name : Set up Python ${{ matrix.python.version }} and 3.10
94
+ - name : Set up Python ${{ matrix.python_version }}
89
95
uses : actions/setup-python@v4
90
96
with :
91
- python-version : |
92
- ${{ matrix.python.version }}
93
- 3.10
94
-
97
+ python-version : ${{ matrix.python_version }}
95
98
- uses : stripe/openapi/actions/stripe-mock@master
96
99
97
- - name : Typecheck with pyright
98
- run : PYRIGHT_ARGS="-- --pythonversion ${{ matrix.python.version }}" make pyright
99
- # Skip typecheking in pypy legs
100
- if : ${{ !contains(matrix.python.version, 'pypy') }}
101
-
102
- - name : Test with pytest
103
- run : TOX_ARGS="-e ${{ matrix.python.env }}" make ci-test
104
-
105
- - name : Calculate and publish coverage
106
- run : make coveralls
107
- if : env.COVERALLS_REPO_TOKEN && matrix.python.version == '3.10'
108
- env :
109
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
110
- COVERALLS_REPO_TOKEN : ${{ secrets.COVERALLS_REPO_TOKEN }}
100
+ - name : " run tests"
101
+ run : just test
111
102
112
103
publish :
113
104
name : Publish
@@ -116,7 +107,7 @@ jobs:
116
107
startsWith(github.ref, 'refs/tags/v') &&
117
108
endsWith(github.actor, '-stripe')
118
109
needs : [build, test, lint]
119
- runs-on : ubuntu-latest
110
+ runs-on : " ubuntu-24.04 "
120
111
steps :
121
112
- uses : actions/checkout@v3
122
113
- name : Download all workflow run artifacts
@@ -137,11 +128,12 @@ jobs:
137
128
GPG_SIGNING_PRIVKEY : ${{ secrets.GPG_SIGNING_PRIVKEY }}
138
129
GPG_SIGNING_PASSPHRASE : ${{ secrets.GPG_SIGNING_PASSPHRASE }}
139
130
- name : Install tools
140
- run : make venv
141
- - name : Publish packages to PyPy
131
+ run : just install-build-deps
132
+ - name : Publish packages to PyPI
133
+ # could probably move this into a just recipe too?
142
134
run : |
143
135
set -ex
144
- source venv/bin/activate
136
+ source . venv/bin/activate
145
137
export VERSION=$(cat VERSION)
146
138
gpg --detach-sign --local-user $GPG_SIGNING_KEYID --pinentry-mode loopback --passphrase $GPG_SIGNING_PASSPHRASE -a dist/stripe-$VERSION.tar.gz
147
139
gpg --detach-sign --local-user $GPG_SIGNING_KEYID --pinentry-mode loopback --passphrase $GPG_SIGNING_PASSPHRASE -a dist/stripe-$VERSION-py2.py3-none-any.whl
0 commit comments