Skip to content

Commit 3deca52

Browse files
authored
Merge pull request #121 from LUMC/release_1.5.0
Release 1.5.0
2 parents 40c027a + 95d488e commit 3deca52

24 files changed

+291
-232
lines changed

.github/workflows/ci.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Continous integration
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- develop
8+
- master
9+
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
python-version:
17+
- 3.6
18+
steps:
19+
- uses: actions/checkout@v2.3.4
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v2
22+
- name: Install tox
23+
run: pip install tox
24+
- name: Lint
25+
run: tox -e lint
26+
docs:
27+
needs: lint
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v2.3.4
31+
- name: Set up Python ${{ matrix.python-version }}
32+
uses: actions/setup-python@v2
33+
- name: Install tox
34+
run: pip install tox
35+
- name: Build docs
36+
run: tox -e docs
37+
test:
38+
runs-on: ubuntu-latest
39+
strategy:
40+
matrix:
41+
python-version:
42+
- 3.6
43+
- 3.7
44+
- 3.8
45+
- 3.9
46+
needs: lint
47+
steps:
48+
- uses: actions/checkout@v2.3.4
49+
- name: Set up Python ${{ matrix.python-version }}
50+
uses: actions/setup-python@v2
51+
- name: Install tox
52+
run: pip install tox
53+
- name: Run tests
54+
run: tox -e py3
55+
- name: Upload coverage report
56+
if: ${{ matrix.python-version == 3.6 }} # Only upload coverage once
57+
uses: codecov/codecov-action@v1
58+
59+
test-functional:
60+
runs-on: ubuntu-latest
61+
needs: test
62+
strategy:
63+
matrix:
64+
python-version: [3.7]
65+
test-program: [cromwell, snakemake, miniwdl]
66+
steps:
67+
- uses: actions/checkout@v2.3.4
68+
69+
# Setup python program requirements
70+
- name: Set up Python ${{ matrix.python-version }}
71+
if: ${{ matrix.test-program != 'cromwell' }}
72+
uses: actions/setup-python@v2
73+
- name: Install tox
74+
if: ${{ matrix.test-program != 'cromwell' }}
75+
run: pip install tox
76+
77+
# Setup cromwell requirements
78+
- name: Install conda
79+
if: ${{ matrix.test-program == 'cromwell' }}
80+
uses: conda-incubator/setup-miniconda@v2.0.1 # https://github.com/conda-incubator/setup-miniconda.
81+
with:
82+
channels: conda-forge,defaults
83+
- name: Install cromwell and tox
84+
shell: bash -l {0} # Needed for conda
85+
if: ${{ matrix.test-program == 'cromwell' }}
86+
run: conda install cromwell tox
87+
88+
# Test
89+
- name: Test
90+
shell: bash -l {0} # Needed for conda
91+
run: tox -e ${{ matrix.test-program }}

.travis.yml

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

HISTORY.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ Changelog
77
.. This document is user facing. Please word the changes in such a way
88
.. that users understand how the changes affect the new version.
99
10+
version 1.5.0
11+
---------------------------
12+
+ Add support for python 3.9
13+
+ Update the print statement for starting jobs to be more structured. This will
14+
make the output easier to to read and use, since different fields (stdout,
15+
stderr, command, etc) are all on their own line.
16+
+ Do not crash when directories can not be removed due to permission errors.
17+
Instead display a message to notify the users which directories could not be
18+
removed. These issues occurred sometimes when tests involving docker were
19+
run.
20+
1021
version 1.4.0
1122
---------------------------
1223
+ Usage of the ``name`` keyword argument in workflow marks is now deprecated.

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ For our complete documentation checkout our
4141

4242
Installation
4343
============
44-
Pytest-workflow requires Python 3.6 or higher. It is tested on Python 3.6, 3.7
45-
and 3.8. Python 2 is not supported.
44+
Pytest-workflow requires Python 3.6 or higher. It is tested on Python 3.6, 3.7,
45+
3.8 and 3.9. Python 2 is not supported.
4646

4747
- Make sure your virtual environment is activated.
4848
- Install using pip ``pip install pytest-workflow``

docs/examples.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ inside the test output directory. If you have a workflow with the output:
8888
Array[File] stats = moo_task.stats_files
8989
}
9090
91-
Inside the ``output_links`` directory the directories ``moo_file`` and
91+
Inside the ``out`` directory the directories ``moo_file`` and
9292
``stats`` will be created. Inside these directories will be the produced files.
9393

9494
The following yaml file tests a WDL pipeline run with miniwdl.

docs/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Installation
33
============
44

5-
Pytest-workflow is tested on python 3.6, 3.7 and 3.8. Python 2 is not
5+
Pytest-workflow is tested on python 3.6, 3.7, 3.8 and 3.9. Python 2 is not
66
supported.
77

88
In a virtual environment

mypy.ini

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

setup.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,18 @@
1414
# You should have received a copy of the GNU Affero General Public License
1515
# along with pytest-workflow. If not, see <https://www.gnu.org/licenses/
1616

17-
from setuptools import find_packages, setup
17+
from pathlib import Path
1818

19-
with open("README.rst", "r") as readme_file:
20-
LONG_DESCRIPTION = readme_file.read()
19+
from setuptools import find_packages, setup
2120

2221
setup(
2322
name="pytest-workflow",
24-
version="1.4.0",
23+
version="1.5.0",
2524
description="A pytest plugin for configuring workflow/pipeline tests "
2625
"using YAML files",
2726
author="Leiden University Medical Center",
2827
author_email="sasc@lumc.nl", # A placeholder for now
29-
long_description=LONG_DESCRIPTION,
28+
long_description=Path("README.rst").read_text(),
3029
long_description_content_type="text/x-rst",
3130
license="AGPL-3.0-or-later",
3231
keywords="pytest workflow pipeline yaml yml wdl cromwell snakemake",
@@ -43,6 +42,7 @@
4342
"Programming Language :: Python :: 3.6",
4443
"Programming Language :: Python :: 3.7",
4544
"Programming Language :: Python :: 3.8",
45+
"Programming Language :: Python :: 3.9",
4646
"Development Status :: 5 - Production/Stable",
4747
"License :: OSI Approved :: "
4848
"GNU Affero General Public License v3 or later (AGPLv3+)",

src/pytest_workflow/file_tests.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515
# along with pytest-workflow. If not, see <https://www.gnu.org/licenses/
1616

1717
"""All tests for workflow files"""
18-
import hashlib
18+
1919
from pathlib import Path
2020

2121
import pytest
2222

2323
from .content_tests import ContentTestCollector
2424
from .schema import FileTest
25+
from .util import file_md5sum
2526
from .workflow import Workflow
2627

2728

@@ -141,18 +142,3 @@ def repr_failure(self, excinfo, style=None):
141142
f"Observed md5sum '{self.observed_md5sum}' not equal to expected "
142143
f"md5sum '{self.expected_md5sum}' for file '{self.filepath}'"
143144
)
144-
145-
146-
# block_size 64k with python is a few percent faster than linux native md5sum.
147-
def file_md5sum(filepath: Path, block_size=64 * 1024) -> str:
148-
"""
149-
Generates a md5sum for a file. Reads file in blocks to save memory.
150-
:param filepath: a pathlib. Path to the file
151-
:param block_size: Block size in bytes
152-
:return: a md5sum as hexadecimal string.
153-
"""
154-
hasher = hashlib.md5() # nosec: only used for file integrity
155-
with filepath.open('rb') as file_handler: # Read the file in bytes
156-
for block in iter(lambda: file_handler.read(block_size), b''):
157-
hasher.update(block)
158-
return hasher.hexdigest()

0 commit comments

Comments
 (0)