Skip to content

Commit c9c967e

Browse files
authored
Merge pull request #232 from nicolocin/azure
Testing for windows on Azure Pipelines and Travis
2 parents 5fc78dd + 1cd53c8 commit c9c967e

File tree

12 files changed

+131
-68
lines changed

12 files changed

+131
-68
lines changed

.DS_Store

6 KB
Binary file not shown.

.azure-pipelines/windows.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
parameters:
2+
name: ''
3+
vmImage: ''
4+
matrix: []
5+
6+
jobs:
7+
- job: ${{ parameters.name }}
8+
pool:
9+
vmImage: ${{ parameters.vmImage }}
10+
variables:
11+
DEPENDS: "-r min-requirements.txt"
12+
CHECK_TYPE: test
13+
strategy:
14+
matrix:
15+
${{ insert }}: ${{ parameters.matrix }}
16+
17+
steps:
18+
- task: UsePythonVersion@0
19+
inputs:
20+
versionSpec: '$(PYTHON_VERSION)'
21+
addToPath: true
22+
architecture: '$(PYTHON_ARCH)'
23+
- script: |
24+
echo %PYTHONHASHSEED%
25+
displayName: 'Display hash seed'
26+
- script: |
27+
python -m pip install --upgrade pip==18.1 setuptools==30.2.1 wheel
28+
displayName: 'Update build tools'
29+
- script: |
30+
python -m pip install %DEPENDS%
31+
displayName: 'Install dependencies'
32+
- script: |
33+
python -m pip install .[$(CHECK_TYPE)]
34+
displayName: 'Install pydra'
35+
- script: |
36+
pytest -vs -n auto --cov pydra --cov-config .coveragerc --cov-report xml:cov.xml --doctest-modules pydra
37+
displayName: 'Pytest tests'
38+

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ cov.xml
1515
.*.swp
1616
*~
1717
.idea
18+
19+
.DS_Store

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ matrix:
5757
allow_failures:
5858
- python: 3.7
5959
env: INSTALL_DEPENDS="pip==10.0.1 setuptools==30.3.0"
60-
- os: windows
6160

6261

6362
before_install:

azure-pipelines.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
jobs:
2+
- template: .azure-pipelines/windows.yml
3+
parameters:
4+
name: Windows
5+
vmImage: windows-2019
6+
matrix:
7+
py37-x86:
8+
PYTHON_VERSION: '3.7'
9+
PYTHON_ARCH: 'x86'
10+
py37-x64:
11+
PYTHON_VERSION: '3.7'
12+
PYTHON_ARCH: 'x64'

pydra/engine/helpers_file.py

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -66,47 +66,6 @@ def split_filename(fname):
6666
return pth, fname, ext
6767

6868

69-
def fname_presuffix(fname, prefix="", suffix="", newpath=None, use_ext=True):
70-
"""
71-
Manipulate path and name of input filename.
72-
73-
Parameters
74-
----------
75-
fname : :obj:`str`
76-
A filename (may or may not include path)
77-
prefix : :obj:`str`
78-
Characters to prepend to the filename
79-
suffix : :obj:`str`
80-
Characters to append to the filename
81-
newpath : :obj:`str`
82-
Path to replace the path of the input fname
83-
use_ext : :obj:`bool`
84-
If True (default), appends the extension of the original file
85-
to the output name.
86-
87-
Return
88-
------
89-
path : :obj:`str`
90-
Absolute path of the modified filename
91-
92-
Examples
93-
--------
94-
>>> from pydra.engine.helpers_file import fname_presuffix
95-
>>> fname = 'foo.nii.gz'
96-
>>> fname_presuffix(fname,'pre','post','/tmp')
97-
'/tmp/prefoopost.nii.gz'
98-
99-
"""
100-
pth, fname, ext = split_filename(fname)
101-
if not use_ext:
102-
ext = ""
103-
104-
# No need for isdefined: bool(Undefined) evaluates to False
105-
if newpath:
106-
pth = op.abspath(newpath)
107-
return op.join(pth, prefix + fname + suffix + ext)
108-
109-
11069
def hash_file(afile, chunk_len=8192, crypto=sha256, raise_notfound=True):
11170
"""Compute hash of a file using 'crypto' module."""
11271
from .specs import LazyField
@@ -402,7 +361,7 @@ def get_related_files(filename, include_this_file=True):
402361
if this_type in type_set:
403362
for related_type in type_set:
404363
if include_this_file or related_type != this_type:
405-
related_files.append(op.join(path, name + related_type))
364+
related_files.append(Path(path) / (name + related_type))
406365
if not len(related_files):
407366
related_files = [filename]
408367
return related_files

0 commit comments

Comments
 (0)