Skip to content

Commit 193c028

Browse files
authored
Initial commit
0 parents  commit 193c028

File tree

14 files changed

+625
-0
lines changed

14 files changed

+625
-0
lines changed

.coveragerc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[run]
2+
branch = True
3+
omit =
4+
*/_version.py

.flake8

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
[flake8]
3+
doctests = True
4+
exclude =
5+
**/__init__.py
6+
*build/
7+
docs/sphinxext/
8+
docs/tools/
9+
docs/conf.py
10+
docs/source/conf.py
11+
max-line-length = 88
12+
select = C,E,F,W,B,B950
13+
extend-ignore = E203,E501,E129,W503
14+
per-file-ignores =
15+
__init__.py:F401,F403

.github/workflows/ci-cd.yaml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
#This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
# For deployment, it will be necessary to create a PyPI API token and store it as a secret
5+
# https://docs.github.com/en/actions/reference/encrypted-secrets
6+
7+
name: CI/CD
8+
9+
on:
10+
push:
11+
branches: [ main, develop ]
12+
tags: [ '*' ]
13+
pull_request:
14+
branches: [ main, develop ]
15+
16+
jobs:
17+
devcheck:
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
python-version: ['3.8', '3.12'] # Check oldest and newest versions
22+
pip-flags: ['', '--editable']
23+
pydra:
24+
- 'pydra'
25+
- '--editable git+https://github.com/nipype/pydra.git#egg=pydra'
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
- name: Set up Python ${{ matrix.python-version }}
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
- name: Install build dependencies
34+
run: |
35+
python -m pip install --upgrade pip
36+
- name: Install Pydra
37+
run: |
38+
pip install ${{ matrix.pydra }}
39+
python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
40+
- name: Install task package
41+
run: |
42+
pip install ${{ matrix.pip-flags }} ".[dev]"
43+
python -c "import pydra.workers.CHANGEME as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
44+
python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
45+
46+
test:
47+
runs-on: ubuntu-latest
48+
strategy:
49+
matrix:
50+
python-version: [3.7, 3.8, 3.9, '3.10']
51+
52+
steps:
53+
- uses: actions/checkout@v4
54+
- name: Set up Python ${{ matrix.python-version }}
55+
uses: actions/setup-python@v5
56+
with:
57+
python-version: ${{ matrix.python-version }}
58+
- name: Install build dependencies
59+
run: |
60+
python -m pip install --upgrade pip
61+
- name: Install task package
62+
run: |
63+
pip install ".[test]"
64+
python -c "import pydra.workers.CHANGEME as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
65+
python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
66+
- name: Test with pytest
67+
run: |
68+
pytest -sv --doctest-modules pydra/workers/CHANGEME \
69+
--cov pydra.workers.CHANGEME --cov-report xml
70+
- uses: codecov/codecov-action@v3
71+
if: ${{ always() }}
72+
73+
74+
deploy:
75+
needs: [devcheck, test]
76+
runs-on: ubuntu-latest
77+
strategy:
78+
matrix:
79+
python-version: [3.9]
80+
steps:
81+
- uses: actions/checkout@v4
82+
with:
83+
submodules: recursive
84+
fetch-depth: 0
85+
- name: Set up Python ${{ matrix.python-version }}
86+
uses: actions/setup-python@v5
87+
with:
88+
python-version: ${{ matrix.python-version }}
89+
- name: Install build tools
90+
run: python -m pip install build twine
91+
- name: Build source and wheel distributions
92+
run: python -m build
93+
- name: Check distributions
94+
run: twine check dist/*
95+
- uses: actions/upload-artifact@v4
96+
with:
97+
name: distributions
98+
path: dist/
99+
# Deploy on tags if PYPI_API_TOKEN is defined in the repository secrets.
100+
# Secrets are not accessible in the if: condition [0], so set an output variable [1]
101+
# [0] https://github.community/t/16928
102+
# [1] https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-output-parameter
103+
- name: Check for PyPI token on tag
104+
id: deployable
105+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
106+
env:
107+
PYPI_API_TOKEN: "${{ secrets.PYPI_API_TOKEN }}"
108+
run: if [ -n "$PYPI_API_TOKEN" ]; then echo "DEPLOY=true" >> $GITHUB_OUTPUT; fi
109+
- name: Upload to PyPI
110+
if: steps.deployable.outputs.DEPLOY
111+
uses: pypa/gh-action-pypi-publish@37f50c210e3d2f9450da2cd423303d6a14a6e29f # v1.5.1
112+
with:
113+
user: __token__
114+
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
target/
76+
77+
# Jupyter Notebook
78+
.ipynb_checkpoints
79+
80+
# IPython
81+
profile_default/
82+
ipython_config.py
83+
84+
# pyenv
85+
.python-version
86+
87+
# pipenv
88+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91+
# install all needed dependencies.
92+
#Pipfile.lock
93+
94+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
95+
__pypackages__/
96+
97+
# Celery stuff
98+
celerybeat-schedule
99+
celerybeat.pid
100+
101+
# SageMath parsed files
102+
*.sage.py
103+
104+
# Environments
105+
.env
106+
.venv
107+
env/
108+
venv/
109+
ENV/
110+
env.bak/
111+
venv.bak/
112+
113+
# Spyder project settings
114+
.spyderproject
115+
.spyproject
116+
117+
# Rope project settings
118+
.ropeproject
119+
120+
# mkdocs documentation
121+
/site
122+
123+
# mypy
124+
.mypy_cache/
125+
.dmypy.json
126+
dmypy.json
127+
128+
# Pyre type checker
129+
.pyre/
130+
131+
# Pycharm
132+
.idea
133+
134+
# Vim
135+
.*.sw[op]
136+
137+
# VS Code
138+
.vscode
139+
140+
# Mac garbarge
141+
.DS_store
142+
143+
# Generated files
144+
/pydra/workers/CHANGEME/_version.py

.pre-commit-config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.4.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
- repo: https://github.com/psf/black
12+
rev: 22.12.0
13+
hooks:
14+
- id: black

LICENSE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2021 Nipype developers
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

0 commit comments

Comments
 (0)