Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file added .DS_Store
Binary file not shown.
38 changes: 38 additions & 0 deletions .azure-pipelines/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
parameters:
name: ''
vmImage: ''
matrix: []

jobs:
- job: ${{ parameters.name }}
pool:
vmImage: ${{ parameters.vmImage }}
variables:
DEPENDS: "-r min-requirements.txt"
CHECK_TYPE: test
strategy:
matrix:
${{ insert }}: ${{ parameters.matrix }}

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(PYTHON_VERSION)'
addToPath: true
architecture: '$(PYTHON_ARCH)'
- script: |
echo %PYTHONHASHSEED%
displayName: 'Display hash seed'
- script: |
python -m pip install --upgrade pip==18.1 setuptools==30.2.1 wheel
displayName: 'Update build tools'
- script: |
python -m pip install %DEPENDS%
displayName: 'Install dependencies'
- script: |
python -m pip install .[$(CHECK_TYPE)]
displayName: 'Install pydra'
- script: |
pytest -vs -n auto --cov pydra --cov-config .coveragerc --cov-report xml:cov.xml --doctest-modules pydra
displayName: 'Pytest tests'

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ cov.xml
.*.swp
*~
.idea

.DS_Store
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ matrix:
allow_failures:
- python: 3.7
env: INSTALL_DEPENDS="pip==10.0.1 setuptools==30.3.0"
- os: windows


before_install:
Expand Down
12 changes: 12 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
jobs:
- template: .azure-pipelines/windows.yml
parameters:
name: Windows
vmImage: windows-2019
matrix:
py37-x86:
PYTHON_VERSION: '3.7'
PYTHON_ARCH: 'x86'
py37-x64:
PYTHON_VERSION: '3.7'
PYTHON_ARCH: 'x64'
43 changes: 1 addition & 42 deletions pydra/engine/helpers_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,47 +66,6 @@ def split_filename(fname):
return pth, fname, ext


def fname_presuffix(fname, prefix="", suffix="", newpath=None, use_ext=True):
"""
Manipulate path and name of input filename.

Parameters
----------
fname : :obj:`str`
A filename (may or may not include path)
prefix : :obj:`str`
Characters to prepend to the filename
suffix : :obj:`str`
Characters to append to the filename
newpath : :obj:`str`
Path to replace the path of the input fname
use_ext : :obj:`bool`
If True (default), appends the extension of the original file
to the output name.

Return
------
path : :obj:`str`
Absolute path of the modified filename

Examples
--------
>>> from pydra.engine.helpers_file import fname_presuffix
>>> fname = 'foo.nii.gz'
>>> fname_presuffix(fname,'pre','post','/tmp')
'/tmp/prefoopost.nii.gz'

"""
pth, fname, ext = split_filename(fname)
if not use_ext:
ext = ""

# No need for isdefined: bool(Undefined) evaluates to False
if newpath:
pth = op.abspath(newpath)
return op.join(pth, prefix + fname + suffix + ext)


def hash_file(afile, chunk_len=8192, crypto=sha256, raise_notfound=True):
"""Compute hash of a file using 'crypto' module."""
from .specs import LazyField
Expand Down Expand Up @@ -402,7 +361,7 @@ def get_related_files(filename, include_this_file=True):
if this_type in type_set:
for related_type in type_set:
if include_this_file or related_type != this_type:
related_files.append(op.join(path, name + related_type))
related_files.append(Path(path) / (name + related_type))
if not len(related_files):
related_files = [filename]
return related_files
Expand Down
Loading