Skip to content

Commit 1c69d95

Browse files
authored
Merge pull request #13 from nipype/function-task
Adds support for converting function tasks
2 parents c5616d1 + 6c76ea6 commit 1c69d95

File tree

831 files changed

+136161
-1303
lines changed

Some content is hidden

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

831 files changed

+136161
-1303
lines changed

.github/workflows/ci-cd.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: CI/CD
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
release:
9+
types: [published]
10+
11+
defaults:
12+
run:
13+
shell: bash
14+
15+
jobs:
16+
test:
17+
strategy:
18+
matrix:
19+
os: [macos-latest, ubuntu-latest]
20+
python-version: ["3.8", "3.11"]
21+
fail-fast: false
22+
runs-on: ${{ matrix.os }}
23+
defaults:
24+
run:
25+
shell: bash -l {0}
26+
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v2
30+
31+
- name: Unset header
32+
# checkout@v2 adds a header that makes branch protection report errors
33+
# because the Github action bot is not a collaborator on the repo
34+
run: git config --local --unset http.https://github.com/.extraheader
35+
36+
- name: Fetch tags
37+
run: git fetch --prune --unshallow
38+
39+
- name: Disable etelemetry
40+
run: echo "NO_ET=TRUE" >> $GITHUB_ENV
41+
42+
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
43+
uses: actions/setup-python@v2
44+
with:
45+
python-version: ${{ matrix.python-version }}
46+
47+
- name: Update build tools
48+
run: python3 -m pip install --upgrade pip setuptools wheel
49+
50+
- name: Install required file-formats packages
51+
run: |
52+
pushd required-fileformats
53+
python3 -m pip install -r requirements.txt
54+
popd
55+
56+
- name: Install Dipy separately as it was causing trouble
57+
run: python3 -m pip install dipy
58+
59+
- name: Install Package
60+
run: python3 -m pip install .[test]
61+
62+
- name: Pytest
63+
run: pytest -vvs --cov nipype2pydra --cov-config .coveragerc --cov-report xml
64+
65+
- name: Upload coverage to Codecov
66+
uses: codecov/codecov-action@v2
67+
with:
68+
fail_ci_if_error: true
69+
token: ${{ secrets.CODECOV_TOKEN }}
70+
71+
deploy:
72+
needs: [test]
73+
runs-on: ubuntu-latest
74+
steps:
75+
- uses: actions/checkout@v3
76+
with:
77+
submodules: recursive
78+
fetch-depth: 0
79+
80+
- name: Unset header
81+
# checkout@v2 adds a header that makes branch protection report errors
82+
# because the Github action bot is not a collaborator on the repo
83+
run: git config --local --unset http.https://github.com/.extraheader
84+
85+
- name: Set up Python
86+
uses: actions/setup-python@v4
87+
with:
88+
python-version: '3.11'
89+
90+
- name: Install build tools
91+
run: python3 -m pip install build twine
92+
93+
- name: Build source and wheel distributions
94+
run: python3 -m build .
95+
96+
- name: Check distributions
97+
run: twine check dist/*
98+
99+
- name: Check for PyPI token on tag
100+
id: deployable
101+
if: github.event_name == 'release'
102+
env:
103+
PYPI_API_TOKEN: "${{ secrets.PYPI_API_TOKEN }}"
104+
run: if [ -n "$PYPI_API_TOKEN" ]; then echo "DEPLOY=true" >> $GITHUB_OUTPUT; fi
105+
106+
- name: Upload to PyPI
107+
if: steps.deployable.outputs.DEPLOY
108+
uses: pypa/gh-action-pypi-publish@release/v1
109+
with:
110+
user: __token__
111+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/publish.yml

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

.github/workflows/tests.yml

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

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.venv*
1+
*.venv*
22
/.project
33
/.pydevproject
44
*.pyc
@@ -20,6 +20,6 @@ __pycache__
2020
*.egg-info
2121
~*
2222
/outputs
23-
/Test.venv
2423
/test-data
25-
/nipype2pydra/_version.py
24+
/nipype2pydra/_version.py
25+

conftest.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44
import tempfile
55
import pytest
66
from click.testing import CliRunner
7-
from fileformats.generic import File
87

98

109
PKG_DIR = Path(__file__).parent
1110
EXAMPLE_SPECS_DIR = PKG_DIR / "example-specs"
12-
EXAMPLE_TASKS_DIR = EXAMPLE_SPECS_DIR / "task"
11+
EXAMPLE_TASKS_DIR = EXAMPLE_SPECS_DIR / "task" / "nipype"
1312
EXAMPLE_WORKFLOWS_DIR = EXAMPLE_SPECS_DIR / "workflow"
1413

1514

@@ -18,11 +17,6 @@ def gen_test_conftest():
1817
return PKG_DIR / "scripts" / "pkg_gen" / "resources" / "conftest.py"
1918

2019

21-
@pytest.fixture(params=[str(p.stem) for p in (EXAMPLE_TASKS_DIR).glob("*.yaml")])
22-
def task_spec_file(request):
23-
return (EXAMPLE_TASKS_DIR / request.param).with_suffix(".yaml")
24-
25-
2620
@pytest.fixture(params=[str(p.stem) for p in EXAMPLE_WORKFLOWS_DIR.glob("*.yaml")])
2721
def workflow_spec_file(request):
2822
return (EXAMPLE_WORKFLOWS_DIR / request.param).with_suffix(".yaml")
@@ -34,6 +28,13 @@ def work_dir():
3428
return Path(work_dir)
3529

3630

31+
@pytest.fixture
32+
def outputs_dir():
33+
outputs_dir = PKG_DIR / "outputs" / "workflows"
34+
outputs_dir.mkdir(parents=True, exist_ok=True)
35+
return outputs_dir
36+
37+
3738
@pytest.fixture
3839
def cli_runner(catch_cli_exceptions):
3940
def invoke(*args, catch_exceptions=catch_cli_exceptions, **kwargs):
@@ -56,6 +57,11 @@ def pytest_exception_interact(call):
5657
def pytest_internalerror(excinfo):
5758
raise excinfo.value
5859

60+
def pytest_configure(config):
61+
config.option.capture = 'no' # allow print statements to show up in the console
62+
config.option.log_cli = True # show log messages in the console
63+
config.option.log_level = "INFO" # set the log level to INFO
64+
5965
CATCH_CLI_EXCEPTIONS = False
6066
else:
6167
CATCH_CLI_EXCEPTIONS = True

0 commit comments

Comments
 (0)