Skip to content

Commit

Permalink
Merge pull request #65 from LUMC/release_1.1.1
Browse files Browse the repository at this point in the history
Release 1.1.1
  • Loading branch information
rhpvorderman committed Mar 5, 2019
2 parents aef5f04 + be5684b commit 47b749a
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 9 deletions.
12 changes: 8 additions & 4 deletions .github/release_checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ Release checklist
- [ ] Create a release branch
- [ ] Set version to a stable number.
- [ ] Change current development version in `HISTORY.rst` to stable version.
- [ ] Create a test pypi package from the release branch. ([Instructions.](
- [ ] Merge the release branch into `master`
- [ ] Create a test pypi package from the master branch. ([Instructions.](
https://packaging.python.org/tutorials/packaging-projects/#generating-distribution-archives
))
- [ ] Merge the release branch into `master`
- [ ] Install the packages from the test pypi repository to see if they work.
- [ ] Created an annotated tag with the stable version number. Include changes
from history.rst.
- [ ] Push tag to remote.
- [ ] Create packages and push to pypi
- [ ] Push tested packages to pypi
- [ ] merge `master` branch back into `develop`.
- [ ] Add updated version number to develop
- [ ] Add updated version number to develop
- [ ] Update the package on bioconda
- [ ] Build the new tag on readthedocs. Only build the last patch version of
each minor version. So `1.1.1` and `1.2.0` but not `1.1.0`, `1.1.1` and `1.2.0`.
7 changes: 7 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ Changelog
.. NOTE: This document is user facing. Please word the changes in such a way
.. that users understand how the changes affect the new version.
version 1.1.1
---------------------------
+ Added ``--kwd`` as alias for ``--keep-workflow-wd``. Notify the user of
deletion of temporary directories and logs.
+ Released pytest-workflow as a `conda package on bioconda
<https://bioconda.github.io/recipes/pytest-workflow/README.html>`_.

version 1.1.0
---------------------------
+ Enabled custom tests on workflow files.
Expand Down
16 changes: 15 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,18 @@ pytest-workflow
:target: https://pypi.org/project/pytest-workflow/
:alt:

.. image:: https://img.shields.io/conda/v/bioconda/pytest-workflow.svg
:target: https://https://bioconda.github.io/recipes/pytest-workflow/README.html
:alt:

.. image:: https://img.shields.io/pypi/pyversions/pytest-workflow.svg
:target: https://pypi.org/project/pytest-workflow/
:alt:

.. image:: https://img.shields.io/pypi/l/pytest-workflow.svg
:target: https://github.com/LUMC/pytest-workflow/blob/master/LICENSE
:alt:

.. image:: https://api.codacy.com/project/badge/Grade/f8bc14b0a507429eac7c06194fafcd59
:target: https://www.codacy.com/app/LUMC/pytest-workflow?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=LUMC/pytest-workflow&amp;utm_campaign=Badge_Grade
:alt:
Expand Down Expand Up @@ -41,6 +49,12 @@ and 3.7. Python 2 is not supported.
- Create a ``tests`` directory in the root of your repository.
- Create your test yaml files in the ``tests`` directory.

Pytest-workflow is also available as a `conda package on bioconda
<https://bioconda.github.io/recipes/pytest-workflow/README.html>`_. Follow
`these instructions <https://bioconda.github.io/index.html#set-up-channels>`_
to set up channels properly in order to use bioconda. After that ``conda
install pytest-workflow`` can be used to install pytest-workflow.

Quickstart
==========

Expand All @@ -52,7 +66,7 @@ To check the progress of a workflow while it is running you can use ``tail -f``
on the ``stdout`` or ``stderr`` file of the workflow. The locations of these
files are reported in the log as soon as a workflow is started.

For debugging pipelines using the ``--keep-workflow-wd`` flag is
For debugging pipelines using the ``--kwd`` or ``--keep-workflow-wd`` flag is
recommended. This will keep the workflow directory and logs after the test run
so it is possible to check where the pipeline crashed. The ``-v`` flag can come
in handy as well as it gives a complete overview of succeeded and failed tests.
Expand Down
8 changes: 8 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,11 @@ On Ubuntu or Debian:
environment will not work with ``pytest-workflow`` because this will start
the python2 version of ``pytest``. This is because python2 is the default
python on any distribution released before January 1st 2020.

Pytest-workflow is also available as a `conda package on bioconda
<https://bioconda.github.io/recipes/pytest-workflow/README.html>`_.
To install with conda:

- `Set up conda to use the bioconda channel
<https://bioconda.github.io/index.html#set-up-channels>`_
- ``conda install pytest-workflow``
4 changes: 2 additions & 2 deletions docs/running_pytest_workflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ The workflows are run automatically. Each workflow gets its own temporary
directory to run. The ``stdout`` and ``stderr`` of the workflow command are
also saved to this directory. The temporary directories are cleaned up after
the tests are completed. If you wish to inspect the output of a failing
workflow you can use the ``--keep-workflow-wd`` flag to disable cleanup. This
will also make sure the logs of the pipeline are not deleted. The
workflow you can use the ``--kwd`` or ``--keep-workflow-wd`` flag to disable
cleanup. This will also make sure the logs of the pipeline are not deleted. The
``--keep-workflow-wd`` flag is highly recommended when debugging pipelines.

If you wish to change the temporary directory in which the workflows are run
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

setup(
name="pytest-workflow",
version="1.1.0",
version="1.1.1",
description="A pytest plugin for configuring workflow/pipeline tests "
"using YAML files",
author="Leiden University Medical Center",
Expand All @@ -43,6 +43,7 @@
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: "
"GNU Affero General Public License v3 or later (AGPLv3+)",
"Framework :: Pytest",
Expand Down
5 changes: 4 additions & 1 deletion src/pytest_workflow/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

def pytest_addoption(parser: PytestParser):
parser.addoption(
"--keep-workflow-wd",
"--kwd", "--keep-workflow-wd",
action="store_true",
help="Keep temporary directories where workflows are run for "
"debugging purposes. This also triggers saving of stdout and "
Expand Down Expand Up @@ -191,6 +191,9 @@ def pytest_runtestloop(session: pytest.Session):

def pytest_sessionfinish(session: pytest.Session):
if not session.config.getoption("keep_workflow_wd"):
# The newline is needed otherwise everything looks ugly.
print("\nRemoving temporary directories and logs. Use '--kwd' or "
"'--keep-workflow-wd' to disable this behaviour.")
for tempdir in session.config.workflow_cleanup_dirs:
shutil.rmtree(str(tempdir))

Expand Down
3 changes: 3 additions & 0 deletions tests/test_temp_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def test_directory_not_kept(testdir):
working_dir = re.search(r"with command 'echo moo' in '([\w\/_-]*)'",
result.stdout.str()).group(1)
assert not Path(working_dir).exists()
assert ("Removing temporary directories and logs. Use '--kwd' or "
"'--keep-workflow-wd' to disable this behaviour."
) in result.stdout.str()


def test_basetemp_correct(testdir):
Expand Down

0 comments on commit 47b749a

Please sign in to comment.