Skip to content

Commit d5fd9f7

Browse files
authored
Merge pull request #604 from Remi-Gau/fix/603
[MAINT] update linting config and CI
2 parents b50f5e6 + 0f6fc2e commit d5fd9f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1790
-1710
lines changed

.codespellrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/workflows/bootstrap.yml

Lines changed: 50 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
# this workflow bootstraps the testing of the build the docker images
23
#
34
# - this will run the python script used to generate the workflows
@@ -8,16 +9,16 @@
89
name: bootstrap
910

1011
concurrency:
11-
group: ${{ github.workflow }}-${{ github.ref }}
12-
cancel-in-progress: true
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
1314

1415
on:
15-
push:
16-
branches: [ "master" ]
17-
paths:
18-
- .github/workflows/bootstrap.yml
19-
- .github/workflows/create_workflows.py
20-
- neurodocker/**
16+
push:
17+
branches: [master]
18+
paths:
19+
- .github/workflows/bootstrap.yml
20+
- .github/workflows/create_workflows.py
21+
- neurodocker/**
2122

2223
# Uses the cron schedule for github actions
2324
#
@@ -33,53 +34,53 @@ on:
3334
# │ │ │ │ │
3435
# * * * * *
3536

36-
schedule:
37-
- cron: 0 0 1,15 * *
37+
schedule:
38+
- cron: 0 0 1,15 * *
3839

3940
# Allows you to run this workflow manually from the Actions tab
40-
workflow_dispatch:
41-
inputs:
42-
software_name:
43-
description: 'software to test'
44-
required: true
45-
default: 'all'
41+
workflow_dispatch:
42+
inputs:
43+
software_name:
44+
description: software to test
45+
required: true
46+
default: all
4647

4748
permissions:
48-
contents: write
49-
actions: write
49+
contents: write
50+
actions: write
5051
jobs:
51-
bootstrap:
52-
runs-on: ubuntu-22.04
52+
bootstrap:
53+
runs-on: ubuntu-22.04
5354

54-
steps:
55-
- uses: actions/checkout@v4
56-
with:
57-
token: ${{ secrets.CI_FLOW }}
55+
steps:
56+
- uses: actions/checkout@v4
57+
with:
58+
token: ${{ secrets.CI_FLOW }}
5859

59-
- name: Set up Python
60-
uses: actions/setup-python@v5
61-
with:
62-
python-version: '3.11'
60+
- name: Set up Python
61+
uses: actions/setup-python@v5
62+
with:
63+
python-version: '3.11'
6364

64-
- name: Install dependencies
65-
run: python -m pip install jinja2 pyyaml
65+
- name: Install dependencies
66+
run: python -m pip install jinja2 pyyaml
6667

67-
- name: Create workflows
68-
run: |
69-
software_name=${{ inputs.software_name }}
70-
if [ -z "$software_name" ]; then
71-
software_name="all"
72-
fi
73-
if [ "$software_name" = "all" ]; then
74-
echo "testing all software"
75-
else
76-
echo "testing ${software_name}"
77-
fi
78-
git checkout -b test_docker_build
79-
python .github/workflows/create_workflows.py --software_name ${software_name}
80-
ls -l .github/workflows
81-
git add .
82-
git config --global user.email "[email protected]"
83-
git config --global user.name "Repronim neurodocker bot"
84-
git commit -am "added new workflows"
85-
git push origin --force test_docker_build
68+
- name: Create workflows
69+
run: |
70+
software_name=${{ inputs.software_name }}
71+
if [ -z "$software_name" ]; then
72+
software_name="all"
73+
fi
74+
if [ "$software_name" = "all" ]; then
75+
echo "testing all software"
76+
else
77+
echo "testing ${software_name}"
78+
fi
79+
git checkout -b test_docker_build
80+
python .github/workflows/create_workflows.py --software_name ${software_name}
81+
ls -l .github/workflows
82+
git add .
83+
git config --global user.email "[email protected]"
84+
git config --global user.name "Repronim neurodocker bot"
85+
git commit -am "added new workflows"
86+
git push origin --force test_docker_build

.github/workflows/codespell.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/create_workflows.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
and on the branch where the workflows are pushed to (currently "test_docker_build").
2424
2525
"""
26+
2627
import argparse
2728
from pathlib import Path
2829

.github/workflows/docs.yml

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
1+
---
12
on:
2-
push:
3-
branches:
4-
- master
3+
push:
4+
branches:
5+
- master
56
permissions:
6-
contents: write
7+
contents: write
78
jobs:
8-
build_docs:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- uses: actions/checkout@v4
12-
- name: Set up Python
13-
uses: actions/setup-python@v5
14-
with:
15-
python-version: "3.10"
16-
- name: Install neurodocker
17-
run: python -m pip install --editable .[all]
18-
- name: build docs
19-
run: |
20-
make -C docs cli
21-
make -C docs list
22-
sphinx-build docs docs-build
23-
- name: Deploy
24-
uses: JamesIves/github-pages-deploy-action@v4
25-
with:
26-
folder: docs-build # The folder the action should deploy.
9+
build_docs:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Set up Python
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: '3.10'
17+
- name: Install neurodocker
18+
run: python -m pip install --editable .[all]
19+
- name: build docs
20+
run: |
21+
make -C docs cli
22+
make -C docs list
23+
sphinx-build docs docs-build
24+
- name: Deploy
25+
uses: JamesIves/github-pages-deploy-action@v4
26+
with:
27+
folder: docs-build # The folder the action should deploy.

.github/workflows/publish.yml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
1+
---
12
name: Publish to pypi on Github release
23

34
on:
4-
release:
5-
types: [published]
5+
release:
6+
types: [published]
67

78
jobs:
8-
pypi-release:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- uses: actions/checkout@v4
9+
pypi-release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
1213

13-
- name: Set up Python
14-
uses: actions/setup-python@v5
15-
with:
16-
python-version: "3.10"
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.10'
1718

18-
- name: Install build & twine
19-
run: python -m pip install build twine
19+
- name: Install build & twine
20+
run: python -m pip install build twine
2021

21-
- name: Publish to pypi
22-
run: |
23-
python -m build
24-
twine upload dist/*
25-
env:
26-
TWINE_USERNAME: __token__
27-
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
22+
- name: Publish to pypi
23+
run: |
24+
python -m build
25+
twine upload dist/*
26+
env:
27+
TWINE_USERNAME: __token__
28+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}

.github/workflows/pull-request.yml

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,44 @@
1+
---
12
name: CI
23

34
concurrency:
4-
group: ${{ github.workflow }}-${{ github.ref }}
5-
cancel-in-progress: true
5+
group: ${{ github.workflow }}-${{ github.ref }}
6+
cancel-in-progress: true
67

78
on:
8-
pull_request:
9-
branches: [ master ]
9+
pull_request:
10+
branches: [master]
1011

1112
jobs:
12-
run-tests:
13-
runs-on: ubuntu-22.04
14-
strategy:
15-
matrix:
16-
python-version: ['3.12', '3.11', '3.10', '3.9', '3.8']
17-
fail-fast: false
18-
steps:
19-
- name: Install Apptainer
20-
env:
21-
VERSION: 1.1.5
22-
run: |
23-
sudo apt-get update
24-
sudo apt-get install -y wget
25-
wget https://github.com/apptainer/apptainer/releases/download/v${VERSION}/apptainer_${VERSION}_amd64.deb
26-
wget https://github.com/apptainer/apptainer/releases/download/v${VERSION}/apptainer-suid_${VERSION}_amd64.deb
27-
sudo apt-get install --yes ./apptainer*
28-
- name: Set Apptainer/Singularity environment variables
29-
run: |
30-
# Give reproenv the full path to apptainer, so it still works with `sudo`.
31-
echo REPROENV_APPTAINER_PROGRAM=apptainer >> $GITHUB_ENV
32-
echo APPTAINER_CACHEDIR=/dev/shm/$(whoami)/singularity >> $GITHUB_ENV
33-
- uses: actions/checkout@v4
34-
- name: Set up Python
35-
uses: actions/setup-python@v5
36-
with:
37-
python-version: ${{ matrix.python-version }}
38-
- name: Install neurodocker
39-
run: python -m pip install --editable .[dev]
40-
- name: Run python tests
41-
run: pytest --numprocesses auto
42-
- name: Get code coverage
43-
run: codecov
13+
run-tests:
14+
runs-on: ubuntu-22.04
15+
strategy:
16+
matrix:
17+
python-version: ['3.12', '3.11', '3.10', '3.9', '3.8']
18+
fail-fast: false
19+
steps:
20+
- name: Install Apptainer
21+
env:
22+
VERSION: 1.1.5
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get install -y wget
26+
wget https://github.com/apptainer/apptainer/releases/download/v${VERSION}/apptainer_${VERSION}_amd64.deb
27+
wget https://github.com/apptainer/apptainer/releases/download/v${VERSION}/apptainer-suid_${VERSION}_amd64.deb
28+
sudo apt-get install --yes ./apptainer*
29+
- name: Set Apptainer/Singularity environment variables
30+
run: |
31+
# Give reproenv the full path to apptainer, so it still works with `sudo`.
32+
echo REPROENV_APPTAINER_PROGRAM=apptainer >> $GITHUB_ENV
33+
echo APPTAINER_CACHEDIR=/dev/shm/$(whoami)/singularity >> $GITHUB_ENV
34+
- uses: actions/checkout@v4
35+
- name: Set up Python
36+
uses: actions/setup-python@v5
37+
with:
38+
python-version: ${{ matrix.python-version }}
39+
- name: Install neurodocker
40+
run: python -m pip install --editable .[dev]
41+
- name: Run python tests
42+
run: pytest --numprocesses auto
43+
- name: Get code coverage
44+
run: codecov

0 commit comments

Comments
 (0)