50
50
PIP_DISABLE_PIP_VERSION_CHECK : 1
51
51
PIP_NO_PYTHON_VERSION_WARNING : 1
52
52
PIP_NO_WARN_SCRIPT_LOCATION : 1
53
+ PROJECT_NAME : ansible-pylibssh
53
54
PY_COLORS : 1 # Recognized by the `py` package, dependency of `pytest`
54
55
TOX_PARALLEL_NO_SPINNER : 1
55
56
TOX_TESTENV_PASSENV : >- # Make tox-wrapped tools see color requests
80
81
81
82
env :
82
83
ANSIBLE_PYLIBSSH_CYTHON_TRACING : ${{ inputs.cython-tracing }}
83
- TOXENV : test-${{ inputs.dist-type }}-dists
84
+ TOXENV : py
84
85
85
86
steps :
86
87
- name : Install build toolchain and openssl headers on Linux
@@ -196,17 +197,62 @@ jobs:
196
197
path : dist/
197
198
merge-multiple : true
198
199
200
+ - name : Determine pre-compiled compatible wheel
201
+ env :
202
+ # NOTE: When `pip` is forced to colorize output piped into `jq`,
203
+ # NOTE: the latter can't parse it. So we're overriding the color
204
+ # NOTE: preference here via https://no-color.org.
205
+ # NOTE: Setting `FORCE_COLOR` to any value (including 0, an empty
206
+ # NOTE: string, or a "YAML null" `~`) doesn't have any effect and
207
+ # NOTE: `pip` (through its verndored copy of `rich`) treats the
208
+ # NOTE: presence of the variable as "force-color" regardless.
209
+ #
210
+ # NOTE: This doesn't actually work either, so we'll resort to unsetting
211
+ # NOTE: in the Bash script.
212
+ # NOTE: Ref: https://github.com/Textualize/rich/issues/2622
213
+ NO_COLOR : 1
214
+ if : inputs.dist-type == 'binary'
215
+ id : wheel-file
216
+ run : >
217
+ echo -n path= | tee -a "${GITHUB_OUTPUT}"
218
+
219
+
220
+ unset FORCE_COLOR
221
+
222
+
223
+ python
224
+ -X utf8
225
+ -u -I
226
+ -m pip install
227
+ --find-links=./dist
228
+ --no-index
229
+ '${{ env.PROJECT_NAME }}'
230
+ --force-reinstall
231
+ --no-color
232
+ --no-deps
233
+ --only-binary=:all:
234
+ --dry-run
235
+ --report=-
236
+ --quiet
237
+ | jq --raw-output .install[].download_info.url
238
+ | sed -e 's#^file://##' -e 's#%2B#+#'
239
+ | tee -a "${GITHUB_OUTPUT}"
240
+ shell : bash
241
+
199
242
- name : >-
200
243
Pre-populate tox env:
201
244
${{ env.TOXENV }}
202
- # FIXME: Integrate the following once it's possible
203
- # --installpkg 'dist/${{ needs.pre-setup.outputs.wheel-artifact-name }}'
204
245
run: >-
205
246
python -m
206
247
tox
207
248
--parallel auto
208
249
--parallel-live
209
250
--skip-missing-interpreters false
251
+ --installpkg '${{
252
+ inputs.dist-type == 'binary'
253
+ && steps.wheel-file.outputs.path
254
+ || format('dist/{0}', inputs.source-tarball-name)
255
+ }}'
210
256
--notest
211
257
212
258
- name : Configure tox to run pytest under catchsegv
@@ -219,8 +265,6 @@ jobs:
219
265
shell : python
220
266
221
267
- name : Run the testing
222
- # FIXME: Integrate the following once it's possible
223
- # --installpkg 'dist/${{ needs.pre-setup.outputs.wheel-artifact-name }}'
224
268
run : >-
225
269
python -m
226
270
tox
@@ -235,8 +279,6 @@ jobs:
235
279
paths : .test-results/pytest/results.xml
236
280
- name : Re-run the failing tests with maximum verbosity
237
281
if : failure()
238
- # FIXME: Integrate the following once it's possible
239
- # --installpkg 'dist/${{ needs.pre-setup.outputs.wheel-artifact-name }}'
240
282
run : >- # `exit 1` makes sure that the job remains red with flaky runs
241
283
python -m
242
284
tox
0 commit comments