Skip to content

Commit

Permalink
Merge pull request #1282 from effigies/ci/oidc-and-color
Browse files Browse the repository at this point in the history
CI: FORCE_COLOR for readable tox/pytest outputs, use OIDC PyPI uploads
  • Loading branch information
effigies authored Dec 6, 2023
2 parents 07289b7 + 432407f commit 96abe5a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ defaults:
run:
shell: bash

# Force tox and pytest to use color
env:
FORCE_COLOR: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand Down Expand Up @@ -195,13 +199,13 @@ jobs:
runs-on: ubuntu-latest
environment: "Package deployment"
needs: [test, test-package]
permissions:
# Required for trusted publishing
id-token: write
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v3
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
4 changes: 1 addition & 3 deletions nibabel/nifti1.py
Original file line number Diff line number Diff line change
Expand Up @@ -1637,9 +1637,7 @@ def set_slice_times(self, slice_times):
labels.remove('unknown')

matching_labels = [
label
for label in labels
if np.all(st_order == self._slice_time_order(label, n_timed))
label for label in labels if np.all(st_order == self._slice_time_order(label, n_timed))
]

if not matching_labels:
Expand Down
10 changes: 8 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ pass_env =
USERNAME
# Environment variables we check for
NIPY_EXTRA_TESTS
# Pass user color preferences through
PY_COLORS
FORCE_COLOR
NO_COLOR
CLICOLOR
CLICOLOR_FORCE
extras = test
deps =
# General minimum dependencies: pin based on API usage
Expand Down Expand Up @@ -139,8 +145,8 @@ deps =
isort[colors]
skip_install = true
commands =
blue --diff --color nibabel
isort --diff --color nibabel
blue --check --diff --color nibabel
isort --check --diff --color nibabel
flake8 nibabel

[testenv:style-fix]
Expand Down

0 comments on commit 96abe5a

Please sign in to comment.