Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
307b52b
added comment
tclose Feb 17, 2025
f74ddae
starting to convert test_environments tests to new syntax
tclose Feb 17, 2025
67eadff
debugging test_environments
tclose Feb 21, 2025
8c7fc19
debugged test_environments (except singularity tests)
tclose Feb 23, 2025
3418b0d
updated singularity tests
tclose Feb 23, 2025
a67968b
updated __version__ location to inside pydra.engine
tclose Feb 23, 2025
ac80cbf
updated github actions version tests
tclose Feb 23, 2025
286a8cb
dropped --pyargs flag in CI test as it doesn't work with namespace pa…
tclose Feb 23, 2025
c0bd52c
streamlined test matrices
tclose Feb 23, 2025
63b31b5
reverted ubuntu version to 22.04 for singularity tests
tclose Feb 23, 2025
a7876a3
added test_environments to singularity test
tclose Feb 23, 2025
41d9d21
fixed up singularity tests
tclose Feb 23, 2025
bd2b158
started implementing singularity tests
tclose Feb 23, 2025
e680452
reworked test_singularity for new syntax
tclose Feb 23, 2025
77bcafe
fixes to test_singularity tests
tclose Feb 23, 2025
33e615c
removed mandatory kwarg in test_singularity shell.defines
tclose Feb 23, 2025
1be664f
changed shell.arg to shell.outarg for path_template outputs
tclose Feb 23, 2025
f83b57d
cleaning up more test_environment singularity tests
tclose Feb 23, 2025
25eed1f
cleaned up singularity unittests
tclose Feb 23, 2025
e8a6aa0
debugging singularity tests
tclose Feb 23, 2025
0c779d2
fixed overzealous validation of path_template
tclose Feb 23, 2025
ab23576
made all args to task call kwds
tclose Feb 23, 2025
f1a6cb3
working on singularity errors
tclose Feb 23, 2025
d8696f2
more debugging of singularity
tclose Feb 23, 2025
b30d982
more debugging
tclose Feb 23, 2025
bc5397d
attempting to fix singularity tests
tclose Feb 23, 2025
b1184d4
fixed up environments import
tclose Feb 24, 2025
c8bdd3b
shell.define can take a list of tokens as well as a single string
tclose Feb 24, 2025
2fc135f
debugging docker unittests
tclose Feb 24, 2025
a42cc51
test_dockertask tests pass
tclose Feb 24, 2025
fdd5e52
fixed initialisation of environment in Submitter
tclose Feb 24, 2025
44d0d67
debugged test_dockertask
tclose Feb 24, 2025
28f1bc5
fixed merge error
tclose Feb 25, 2025
3f397e0
fixed merging error in test_shell
tclose Feb 25, 2025
4080298
debugging unittests
tclose Feb 25, 2025
ffeece0
debugged singularity tests
tclose Feb 25, 2025
3b8f818
made imports in pydra.design.* modules absolute
tclose Feb 25, 2025
6aaf1b7
added fileformats-extras to test deps
tclose Feb 25, 2025
e6724c1
fetch tags in github actions so installed version is correct
tclose Feb 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/testdask.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ jobs:
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}

- name: Fetch tags
run: git fetch --prune --unshallow
- name: Setup Python version ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/testpsijlocal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ jobs:
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}

- name: Fetch tags
run: git fetch --prune --unshallow
- name: Setup Python version ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/testpsijslurm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
- name: Disable etelemetry
run: echo "NO_ET=TRUE" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Fetch tags
run: git fetch --prune --unshallow
- name: Pull docker image
run: |
docker pull $DOCKER_IMAGE
Expand All @@ -48,7 +50,7 @@ jobs:
docker exec slurm bash -c "CONFIGURE_OPTS=\"-with-openssl=/opt/openssl\" pyenv install -v 3.11.5"
fi
docker exec slurm bash -c "pyenv global ${{ matrix.python-version }}"
docker exec slurm bash -c "pip install --upgrade pip && pip install -e /pydra[test,psij] && python -c 'import pydra; print(pydra.__version__)'"
docker exec slurm bash -c "pip install --upgrade pip && pip install -e /pydra[test,psij] && python -c 'import pydra.engine; print(pydra.engine.__version__)'"
- name: Run pytest
run: |
docker exec slurm bash -c "pytest --color=yes -vs -n auto --psij=slurm --cov pydra --cov-config /pydra/.coveragerc --cov-report xml:/pydra/cov.xml --doctest-modules /pydra/pydra/ -k 'not test_audit_prov and not test_audit_prov_messdir_1 and not test_audit_prov_messdir_2 and not test_audit_prov_wf and not test_audit_all'"
Expand Down
51 changes: 6 additions & 45 deletions .github/workflows/testpydra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,74 +52,35 @@ jobs:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: ['3.11', '3.12', '3.13']
install: ['wheel']
include:
- os: 'ubuntu-latest'
python-version: '3.11'
install: 'sdist'
- os: 'ubuntu-latest'
python-version: '3.11'
install: 'repo'
- os: 'ubuntu-latest'
python-version: '3.11'
install: 'archive'
fail-fast: false
runs-on: ${{ matrix.os }}


steps:
- name: Fetch sdist/wheel
uses: actions/download-artifact@v4
if: matrix.install == 'sdist' || matrix.install == 'wheel'
with:
name: dist
path: dist/
- name: Fetch git archive
uses: actions/download-artifact@v4
if: matrix.install == 'archive'
with:
name: archive
path: archive/
- name: Fetch repository
uses: actions/checkout@v4
if: matrix.install == 'repo'

- name: Fetch tags
run: git fetch --prune --unshallow
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Update pip
run: python -m pip install --upgrade pip

- name: Determine installation target
run: |
if [[ "$INSTALL" = "sdist" ]]; then
echo "ARCHIVE=$( ls dist/*.tar.gz )" >> $GITHUB_ENV
elif [[ "$INSTALL" = "wheel" ]]; then
echo "ARCHIVE=$( ls dist/*.whl )" >> $GITHUB_ENV
elif [[ "$INSTALL" = "archive" ]]; then
echo "ARCHIVE=$( ls archive/*.zip )" >> $GITHUB_ENV
elif [[ "$INSTALL" = "repo" ]]; then
echo "ARCHIVE=." >> $GITHUB_ENV
fi
env:
INSTALL: ${{ matrix.install }}

- name: Install Pydra
run: pip install $ARCHIVE
run: pip install .[test]

- name: Print version
run: python -c "import pydra; print(pydra.__version__)"

- name: Install Pydra tests dependencies
run: pip install pydra[test]
run: python -c "import pydra.engine; print(pydra.engine.__version__)"

- name: Disable etelemetry
run: echo "NO_ET=TRUE" >> $GITHUB_ENV

- name: Pytest
run: |
pytest -vs -n auto --doctest-modules --pyargs pydra \
pytest -vs -n auto --doctest-modules \
--cov pydra --cov-config .coveragerc --cov-report xml:cov.xml

- name: Upload to codecov
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/testsingularity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:
jobs:
build:
name: Build
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ['3.11', '3.12', '3.13']
Expand Down Expand Up @@ -65,11 +65,13 @@ jobs:
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
- name: Fetch tags
run: git fetch --prune --unshallow
- name: Install pydra (test)
run: pip install -e ".[test]"


- name: Pytest
run: pytest -vs --cov pydra --cov-config .coveragerc --cov-report xml:cov.xml pydra/engine/tests/test_singularity.py
run: pytest -vs --cov pydra --cov-config .coveragerc --cov-report xml:cov.xml pydra/engine/tests/test_singularity.py pydra/engine/tests/test_environments.py
- name: Upload to codecov
run: codecov -f cov.xml -F unittests -e GITHUB_WORKFLOW
4 changes: 3 additions & 1 deletion .github/workflows/testslurm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
- name: Disable etelemetry
run: echo "NO_ET=TRUE" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Fetch tags
run: git fetch --prune --unshallow
- name: Pull docker image
run: |
docker pull $DOCKER_IMAGE
Expand All @@ -48,7 +50,7 @@ jobs:
docker exec slurm bash -c "CONFIGURE_OPTS=\"-with-openssl=/opt/openssl\" pyenv install -v 3.11.5"
fi
docker exec slurm bash -c "pyenv global ${{ matrix.python-version }}"
docker exec slurm bash -c "pip install --upgrade pip && pip install -e /pydra[test] && python -c 'import pydra; print(pydra.__version__)'"
docker exec slurm bash -c "pip install --upgrade pip && pip install -e /pydra[test] && python -c 'import pydra.engine; print(pydra.engine.__version__)'"
- name: Run pytest
run: |
docker exec slurm bash -c "pytest --color=yes -vs --cov pydra --cov-config /pydra/.coveragerc --cov-report xml:/pydra/cov.xml --doctest-modules /pydra/pydra/ -k 'not test_audit_prov and not test_audit_prov_messdir_1 and not test_audit_prov_messdir_2 and not test_audit_prov_wf and not test_audit_all'"
Expand Down
67 changes: 62 additions & 5 deletions new-docs/source/tutorial/5-shell.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,6 @@
"print(trim_png.cmdline)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -180,6 +175,68 @@
"print(f\"'--int-arg' default: {fields_dict(Cp)['int_arg'].default}\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Path templates for output files\n",
"\n",
"By default, when an output file argument is defined, a `path_template` attribute will\n",
"be assigned to the field based on its name and extension (if applicable). For example,\n",
"the `zipped` output field in the following Gzip command will be assigned a\n",
"`path_template` of `out_file.gz`"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from pydra.design import shell\n",
"from fileformats.generic import File\n",
"\n",
"Gzip = shell.define(\"gzip <out|out_file:application/gzip> <in_files+>\")\n",
"gzip = Gzip(in_files=File.mock(\"/a/file.txt\"))\n",
"print(gzip.cmdline)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"However, if this needs to be specified it can be by using the `$` operator, e.g."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"Gzip = shell.define(\"gzip <out|out_file:application/gzip$zipped.gz> <in_files+>\")\n",
"gzip = Gzip(in_files=File.mock(\"/a/file.txt\"))\n",
"print(gzip.cmdline)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To give the field a path_template of `archive.gz` when it is written on the command line.\n",
"Note that this value can always be overridden when the task is initialised, e.g."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"gzip = Gzip(in_files=File.mock(\"/a/file.txt\"), out_file=\"/path/to/archive.gz\")\n",
"print(gzip.cmdline)"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
4 changes: 2 additions & 2 deletions pydra/design/boutiques.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from functools import reduce
from fileformats.generic import File
from pydra.engine.specs import ShellDef
from .base import make_task_def
from . import shell
from pydra.design.base import make_task_def
from pydra.design import shell


class arg(shell.arg):
Expand Down
2 changes: 1 addition & 1 deletion pydra/design/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import inspect
from typing import dataclass_transform
import attrs
from .base import (
from pydra.design.base import (
Arg,
Out,
ensure_field_objects,
Expand Down
Loading
Loading