1
1
version : 2.1
2
2
3
- jobs :
4
- package-macos :
3
+ # Define executors that various packaging jobs need. This lets us make one
4
+ # packaging job that accepts an executor parameter and avoids duplicating the
5
+ # packaging steps.
6
+ executors :
7
+ manylinux-2014-x86_64 :
8
+ docker :
9
+ - image : " quay.io/pypa/manylinux2014_x86_64"
10
+ manylinux_2_24-x86_64 :
11
+ docker :
12
+ - image : " quay.io/pypa/manylinux_2_24_x86_64"
13
+
14
+ # Define some custom commands that we can use as elements of `steps` in job
15
+ # definitions.
16
+ commands :
17
+ build-wheel :
18
+ description : " Build a Python wheel"
19
+
5
20
parameters :
6
- xcode-version :
21
+ python :
22
+ description : " The path to the Python executable to use"
7
23
type : " string"
24
+ default : " python3"
8
25
9
- macos :
10
- xcode : " << parameters.xcode-version >>"
11
-
12
- environment :
13
- # PyPI authentication configuration for twine so we can upload packages.
14
- # TWINE_PASSWORD is set in the CircleCI private configuration section.
15
- # In the CircleCI web app:
16
- #
17
- # Project Settings ->
18
- # Environment Variables ->
19
- # Add Environment Variable ->
20
- # Name: TWINE_PASSWORD
21
- # Value: <a token issued by PyPI>
22
- #
23
- # The PyPI token is issued in the PyPI web app:
24
- #
25
- # Manage ->
26
- # Settings ->
27
- # Create a token for ... ->
28
- # Permissions: Upload
29
- # Scope: Project: python-challenge-bypass-ristretto
30
- TWINE_USERNAME : " __token__"
26
+ audit-wheel :
27
+ description : " A boolean controlling whether the auditwheel tool is used to fix up the wheel"
28
+ type : " boolean"
31
29
32
30
steps :
33
31
- " checkout"
@@ -43,27 +41,69 @@ jobs:
43
41
name : " Install Rust Build Toolchain"
44
42
command : |
45
43
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rustup-init
46
- sh /tmp/rustup-init -y --default-toolchain stable
47
- . "$HOME"/.cargo/env
44
+ for i in $(seq 10); do
45
+ if sh /tmp/rustup-init -y --default-toolchain stable; then
46
+ break
47
+ else
48
+ sleep 1
49
+ fi
50
+ done
51
+ echo '. "$HOME"/.cargo/env' >> $BASH_ENV
48
52
49
53
- run :
50
54
name : " Get Python Build/Package Dependencies"
51
55
command : |
52
56
# Make sure we have a pip that's aware of Python version constraints
53
- pip install --upgrade pip
57
+ << parameters.python >> -m pip install --upgrade pip
54
58
# Pre-install these two setup_depends using pip so we don't have
55
59
# to rely on whatever resolution logic setuptools would apply.
56
- pip install --upgrade milksnake setuptools_scm
57
- # And get these so we can build and then upload a wheel
58
- pip install wheel twine
60
+ << parameters.python >> -m pip install --upgrade milksnake setuptools_scm
61
+ # And get these so we can build, fix, and upload a wheel.
62
+ << parameters.python >> -m pip install wheel auditwheel twine
59
63
60
64
- run :
61
65
name : " Build Wheel"
62
66
command : |
63
- python setup.py bdist_wheel
67
+ << parameters.python >> -m pip wheel --no-deps .
68
+
69
+ - when :
70
+ condition : << parameters.audit-wheel >>
71
+ steps :
72
+ - run :
73
+ name : " Audix / Fix Wheel"
74
+ command : |
75
+ # Since both macOS and Linux jobs re-use this step, make
76
+ # sure we only try to use auditwheel on the appropriate
77
+ # platform. That is, only on Linux.
78
+ << parameters.python >> -m auditwheel repair python_challenge_bypass_ristretto*.whl
79
+ # Delete the original, unfixed wheel.
80
+ rm *.whl
81
+ # Move the fixed wheel here for consistency with the
82
+ # non-manylinux case.
83
+ mv wheelhouse/python_challenge_bypass_ristretto*.whl ./
64
84
65
85
- run :
66
86
name : " Upload Wheel"
87
+ environment :
88
+ # PyPI authentication configuration for twine so we can upload
89
+ # packages. TWINE_PASSWORD is set in the CircleCI private
90
+ # configuration section. In the CircleCI web app:
91
+ #
92
+ # Project Settings ->
93
+ # Environment Variables ->
94
+ # Add Environment Variable ->
95
+ # Name: TWINE_PASSWORD
96
+ # Value: <a token issued by PyPI>
97
+ #
98
+ # The PyPI token is issued in the PyPI web app:
99
+ #
100
+ # Manage ->
101
+ # Settings ->
102
+ # Create a token for ... ->
103
+ # Permissions: Upload
104
+ # Scope: Project: python-challenge-bypass-ristretto
105
+ TWINE_USERNAME : " __token__"
106
+
67
107
command : |
68
108
if [[ "$CIRCLE_TAG" == v* ]]; then
69
109
# We're building a release tag so we should probably really
@@ -76,9 +116,57 @@ jobs:
76
116
repo="testpypi"
77
117
TWINE_PASSWORD="$TWINE_TESTPYPI_PASSWORD"
78
118
fi
79
- python -m twine upload --repository $repo dist/*
119
+ << parameters.python >> -m twine upload --repository $repo python_challenge_bypass_ristretto*.whl
120
+
121
+ # Define the actual jobs that will be available to run in a workflow.
122
+ jobs :
123
+
124
+ # Build a manylinux wheel.
125
+ package-manylinux :
126
+ parameters :
127
+ executor :
128
+ # note the name comes from the `executors` section above
129
+ description : " the name of the executor to use to run this job"
130
+ type : " executor"
131
+
132
+ pre-command :
133
+ description : |
134
+ a command to run first which resolves any inconsistencies between
135
+ the chosen executor and the requirements of this job
136
+ type : " string"
137
+ default : " "
138
+
139
+ python :
140
+ description : " the path to the Python executable to use"
141
+ type : " string"
142
+
80
143
81
- tests-353333 : &TESTS
144
+ executor : " << parameters.executor >>"
145
+
146
+ steps :
147
+ - run :
148
+ name : " Prepare Execution Environment"
149
+ command : |
150
+ << parameters.pre-command >>
151
+
152
+ - " build-wheel " :
153
+ python : " << parameters.python >>"
154
+ audit-wheel : true
155
+
156
+ package-macos :
157
+ parameters :
158
+ xcode-version :
159
+ type : " string"
160
+
161
+ macos :
162
+ xcode : " << parameters.xcode-version >>"
163
+
164
+ steps :
165
+ - " build-wheel " :
166
+ audit-wheel : false
167
+
168
+
169
+ tests-template : &TESTS
82
170
docker :
83
171
# Run in a highly Nix-capable environment.
84
172
- image : " nixorg/nix:circleci"
90
178
# time of this comment. We can bump it to a newer version when that
91
179
# makes sense. Meanwhile, the platform won't shift around beneath us
92
180
# unexpectedly.
93
- NIXPKGS_REV : " 353333ef340952c05332e3c271dff953264cb017 "
181
+ NIXPKGS_REV : " XXX " # Set this in a derived environment.
94
182
95
183
steps :
96
184
- run :
@@ -158,36 +246,48 @@ jobs:
158
246
command : |
159
247
./ci-tools/run-tests.sh
160
248
161
- tests-1909 :
162
- << : *TESTS
163
- environment :
164
- NIXPKGS_REV : " 19.09"
165
-
166
- tests-2009 :
249
+ tests-2105 :
167
250
<< : *TESTS
168
251
environment :
169
- NIXPKGS_REV : " 20.09 "
252
+ NIXPKGS_REV : " 21.05 "
170
253
171
- tests-2105 :
254
+ tests-2111 :
172
255
<< : *TESTS
173
256
environment :
174
- NIXPKGS_REV : " 21.05 "
257
+ NIXPKGS_REV : " 21.11 "
175
258
176
259
workflows :
177
260
version : 2
178
261
all-tests :
179
262
jobs :
180
- - " tests-2009"
181
263
- " tests-2105"
264
+ - " tests-2111"
265
+ - " package-manylinux " :
266
+ name : " package-manylinux-2014_x86_64"
267
+ executor : " manylinux-2014-x86_64"
268
+ # The image this executor uses comes with no ssh client. CircleCI
269
+ # rewrites our git configuration to fetch sources over ssh. Then it
270
+ # fails if we don't have any ssh client.
271
+ pre-command : " yum install -y openssh-clients"
272
+ python : " /opt/python/cp37-cp37m/bin/python"
273
+ - " package-manylinux " :
274
+ name : " package-manylinux_2_24-x86_64"
275
+ executor : " manylinux_2_24-x86_64"
276
+ # Similar to the manylinux-2014_x86_64 case.
277
+ pre-command : " apt-get update -y && apt-get install -y openssh-client"
278
+ python : " /opt/python/cp37-cp37m/bin/python"
279
+
182
280
- " package-macos " :
183
281
matrix :
184
282
parameters :
185
283
# https://circleci.com/docs/2.0/testing-ios/#supported-xcode-versions
186
284
xcode-version :
187
- # Latest macOS 10.14
285
+ # Latest macOS 10.14.x
188
286
- " 11.1.0"
189
- # The newest macOS 10.15 that still has Python 2. :/
190
- - " 11.4.1"
287
+ # Latest macOS 10.15.x
288
+ - " 12.4.0"
289
+ # Latest macOS 11.x
290
+ - " 13.2.1"
191
291
filters :
192
292
# CircleCI does not run workflows for tags unless you explicitly
193
293
# specify tag filters. Additionally, if a job requires any other
0 commit comments