WDL plugin for pytest

EliLillyCo, updated 🕥 2023-02-07 23:37:17

Travis CI Code Coverage Documentation Status

logo

This package is a plugin for the pytest unit testing framework that enables testing of workflows written in Workflow Description Language.

Dependencies

  • Python 3.6+
  • At least one of the supported workflow engines:
    • Miniwdl - automatically installed as a dependency of pytest-wdl
    • Cromwell JAR file
      • Cromwell Server: Any Cromwell instance remotely running in Server mode
    • dxWDL JAR file
  • Java-based workflow engines (e.g. Cromwell and dxWDL) require a Java runtime (typically 1.8+)
  • If your WDL tasks depend on Docker images, make sure to have the Docker daemon running

Other python dependencies are installed when you install the library.

Installation

Install from PyPI

commandline $ pip install pytest-wdl

Install from source

You can to clone the repository and install:

$ make install

Or use pip to install from github:

commandline $ pip install git+https://github.com/elilillyco/pytest-wdl.git

Install optional dependencies

Some optional features of pytest-wdl have additional dependencies that are loaded on-demand.

The plugins that have extra dependencies are:

  • dx: Support for DNAnexus file storage, and for the dxWDL executor.
  • bam: More intelligent comparison of expected and actual BAM file outputs of a workflow than just comparing MD5 checksums.
  • http: Support for executors that use HTTPS protocol to communicate with a remote server (e.g. Cromwell Server)
  • yaml: Support using YAML for configuration and test data files.
  • progress: Show progress bars when downloading remote files.

To install a plugin's dependencies:

$ pip install pytest-wdl[<plugin>]

To do this locally, you can clone the repo and run:

commandline $ pip install -e .[<data_type>]

To install pytest-wdl and all extras dependencies:

$ pip install pytest-wdl[all]

Usage

The pytest-wdl plugin provides a set of fixtures for use with pytest. Here is a quick example that tests the following workflow.

```wdl

variant_caller.wdl

version 1.0

import "variant_caller.wdl"

struct Index { File fasta String organism }

workflow call_variants { input { File bam File bai Index index }

call variant_caller.variant_caller { input: bam=bam, bai=bai, index=index }

output { File vcf = variant_caller.vcf } } ```

Inputs and expected outputs are defined in a test_data.json file in the same directory as your test script:

json { "bam": { "url": "http://example.com/my.bam" }, "bai": { "url": "http://example.com/my.bam.bai" }, "index_fa": { "name": "chr22.fasta" }, "vcf": { "url": "http://example.com/expected.vcf.gz", "type": "vcf", "allowed_diff_lines": 2 } }

You can write the test code in Python, or - in most cases - you can define the test in a JSON or YAML file instead. The following Python and JSON code define exactly the same test. This test will cause the workflow to be run with the specified inputs, and the outputs will be compared to the specified expected outputs.

```python

test_variant_caller.py

def test_variant_caller(workflow_data, workflow_runner): inputs = workflow_data.get_dict("bam", "bai") inputs["index"] = { "fasta": workflow_data["index_fa"], "organism": "human" } expected = workflow_data.get_dict("vcf") workflow_runner( "variant_caller.wdl", inputs, expected ) ```

```json

test_variant_caller.json

{ "tests": [ { "name": "test_variant_caller", "wdl": "variant_caller.wdl", "inputs": { "bam": "bam", "bai": "bai", "index": { "fasta": "index_fa", "organism": "human" } }, "outputs": { "vcf": "vcf" } } ] } ```

For details, read the docs.

Configuration

You can get started with pytest-wdl with no configuration required. However, some advanced features can be configured via environment variables, fixture functions, and/or a config file. To get started, copy one of the following example config files to $HOME/.pytest_wdl_config.json and modify as necessary:

  • simple: Uses only the miniwdl executor
  • more complex: Uses both miniwdl and Cromwell; shows how to configure proxies and headers for accessing remote data files in a private repository

See the manual for more details on configuring pytest-wdl.

Contributing

If you would like to contribute code to pytest-wdl, please fork the repository and submit your changes via pull request.

To get started developing pytest-wdl, first install all the development requirements:

commandline $ git clone https://github.com/EliLillyCo/pytest-wdl.git $ make install_development_requirements

To run the full build and unit tests, run:

commandline $ make

Note that some tests will be skipped if you are not logged into a DNAnexus account.

Support

pytest-wdl is not an official product of Eli Lilly or DNAnexus. Please do not contact these companies (or any employees thereof) for support. To report a bug or feature request, please open an issue in the issue tracker.

Issues

Bump cryptography from 2.9.2 to 39.0.1

opened on 2023-02-07 23:37:12 by dependabot[bot]

Bumps cryptography from 2.9.2 to 39.0.1.

Changelog

Sourced from cryptography's changelog.

39.0.1 - 2023-02-07


* **SECURITY ISSUE** - Fixed a bug where ``Cipher.update_into`` accepted Python
  buffer protocol objects, but allowed immutable buffers. **CVE-2023-23931**
* Updated Windows, macOS, and Linux wheels to be compiled with OpenSSL 3.0.8.

.. _v39-0-0:

39.0.0 - 2023-01-01

  • BACKWARDS INCOMPATIBLE: Support for OpenSSL 1.1.0 has been removed. Users on older version of OpenSSL will need to upgrade.
  • BACKWARDS INCOMPATIBLE: Dropped support for LibreSSL < 3.5. The new minimum LibreSSL version is 3.5.0. Going forward our policy is to support versions of LibreSSL that are available in versions of OpenBSD that are still receiving security support.
  • BACKWARDS INCOMPATIBLE: Removed the encode_point and from_encoded_point methods on :class:~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicNumbers, which had been deprecated for several years. :meth:~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicKey.public_bytes and :meth:~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicKey.from_encoded_point should be used instead.
  • BACKWARDS INCOMPATIBLE: Support for using MD5 or SHA1 in :class:~cryptography.x509.CertificateBuilder, other X.509 builders, and PKCS7 has been removed.
  • BACKWARDS INCOMPATIBLE: Dropped support for macOS 10.10 and 10.11, macOS users must upgrade to 10.12 or newer.
  • ANNOUNCEMENT: The next version of cryptography (40.0) will change the way we link OpenSSL. This will only impact users who build cryptography from source (i.e., not from a wheel), and specify their own version of OpenSSL. For those users, the CFLAGS, LDFLAGS, INCLUDE, LIB, and CRYPTOGRAPHY_SUPPRESS_LINK_FLAGS environment variables will no longer be respected. Instead, users will need to configure their builds as documented here_.
  • Added support for :ref:disabling the legacy provider in OpenSSL 3.0.x<legacy-provider>.
  • Added support for disabling RSA key validation checks when loading RSA keys via :func:~cryptography.hazmat.primitives.serialization.load_pem_private_key, :func:~cryptography.hazmat.primitives.serialization.load_der_private_key, and :meth:~cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateNumbers.private_key. This speeds up key loading but is :term:unsafe if you are loading potentially attacker supplied keys.
  • Significantly improved performance for :class:~cryptography.hazmat.primitives.ciphers.aead.ChaCha20Poly1305

... (truncated)

Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/EliLillyCo/pytest-wdl/network/alerts).

Bump certifi from 2020.12.5 to 2022.12.7

opened on 2022-12-08 07:44:12 by dependabot[bot]

Bumps certifi from 2020.12.5 to 2022.12.7.

Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/EliLillyCo/pytest-wdl/network/alerts).

Bump urllib3 from 1.25.11 to 1.26.5

opened on 2021-06-02 01:01:55 by dependabot[bot]

Bumps urllib3 from 1.25.11 to 1.26.5.

Release notes

Sourced from urllib3's releases.

1.26.5

:warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap

  • Fixed deprecation warnings emitted in Python 3.10.
  • Updated vendored six library to 1.16.0.
  • Improved performance of URL parser when splitting the authority component.

If you or your organization rely on urllib3 consider supporting us via GitHub Sponsors

1.26.4

:warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap

  • Changed behavior of the default SSLContext when connecting to HTTPS proxy during HTTPS requests. The default SSLContext now sets check_hostname=True.

If you or your organization rely on urllib3 consider supporting us via GitHub Sponsors

1.26.3

:warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap

  • Fixed bytes and string comparison issue with headers (Pull #2141)

  • Changed ProxySchemeUnknown error message to be more actionable if the user supplies a proxy URL without a scheme (Pull #2107)

If you or your organization rely on urllib3 consider supporting us via GitHub Sponsors

1.26.2

:warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap

  • Fixed an issue where wrap_socket and CERT_REQUIRED wouldn't be imported properly on Python 2.7.8 and earlier (Pull #2052)

1.26.1

:warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap

  • Fixed an issue where two User-Agent headers would be sent if a User-Agent header key is passed as bytes (Pull #2047)

1.26.0

:warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap

  • Added support for HTTPS proxies contacting HTTPS servers (Pull #1923, Pull #1806)

  • Deprecated negotiating TLSv1 and TLSv1.1 by default. Users that still wish to use TLS earlier than 1.2 without a deprecation warning should opt-in explicitly by setting ssl_version=ssl.PROTOCOL_TLSv1_1 (Pull #2002) Starting in urllib3 v2.0: Connections that receive a DeprecationWarning will fail

  • Deprecated Retry options Retry.DEFAULT_METHOD_WHITELIST, Retry.DEFAULT_REDIRECT_HEADERS_BLACKLIST and Retry(method_whitelist=...) in favor of Retry.DEFAULT_ALLOWED_METHODS, Retry.DEFAULT_REMOVE_HEADERS_ON_REDIRECT, and Retry(allowed_methods=...) (Pull #2000) Starting in urllib3 v2.0: Deprecated options will be removed

... (truncated)

Changelog

Sourced from urllib3's changelog.

1.26.5 (2021-05-26)

  • Fixed deprecation warnings emitted in Python 3.10.
  • Updated vendored six library to 1.16.0.
  • Improved performance of URL parser when splitting the authority component.

1.26.4 (2021-03-15)

  • Changed behavior of the default SSLContext when connecting to HTTPS proxy during HTTPS requests. The default SSLContext now sets check_hostname=True.

1.26.3 (2021-01-26)

  • Fixed bytes and string comparison issue with headers (Pull #2141)

  • Changed ProxySchemeUnknown error message to be more actionable if the user supplies a proxy URL without a scheme. (Pull #2107)

1.26.2 (2020-11-12)

  • Fixed an issue where wrap_socket and CERT_REQUIRED wouldn't be imported properly on Python 2.7.8 and earlier (Pull #2052)

1.26.1 (2020-11-11)

  • Fixed an issue where two User-Agent headers would be sent if a User-Agent header key is passed as bytes (Pull #2047)

1.26.0 (2020-11-10)

  • NOTE: urllib3 v2.0 will drop support for Python 2. Read more in the v2.0 Roadmap <https://urllib3.readthedocs.io/en/latest/v2-roadmap.html>_.

  • Added support for HTTPS proxies contacting HTTPS servers (Pull #1923, Pull #1806)

  • Deprecated negotiating TLSv1 and TLSv1.1 by default. Users that still wish to use TLS earlier than 1.2 without a deprecation warning

... (truncated)

Commits
  • d161647 Release 1.26.5
  • 2d4a3fe Improve performance of sub-authority splitting in URL
  • 2698537 Update vendored six to 1.16.0
  • 07bed79 Fix deprecation warnings for Python 3.10 ssl module
  • d725a9b Add Python 3.10 to GitHub Actions
  • 339ad34 Use pytest==6.2.4 on Python 3.10+
  • f271c9c Apply latest Black formatting
  • 1884878 [1.26] Properly proxy EOF on the SSLTransport test suite
  • a891304 Release 1.26.4
  • 8d65ea1 Merge pull request from GHSA-5phf-pp7p-vc2r
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/EliLillyCo/pytest-wdl/network/alerts).

Add support for dxCompiler

opened on 2021-02-22 19:12:48 by jdidion

dxCompiler still has the same CLI as dxWDL, so we support both using the same base executor.

Bump bleach from 3.1.5 to 3.3.0

opened on 2021-02-02 22:28:04 by dependabot[bot]

Bumps bleach from 3.1.5 to 3.3.0.

Changelog

Sourced from bleach's changelog.

Version 3.3.0 (February 1st, 2021)

Backwards incompatible changes

  • clean escapes HTML comments even when strip_comments=False

Security fixes

  • Fix bug 1621692 / GHSA-m6xf-fq7q-8743. See the advisory for details.

Features

None

Bug fixes

None

Version 3.2.3 (January 26th, 2021)

Security fixes

None

Features

None

Bug fixes

  • fix clean and linkify raising ValueErrors for certain inputs. Thank you @Google-Autofuzz.

Version 3.2.2 (January 20th, 2021)

Security fixes

None

Features

  • Migrate CI to Github Actions. Thank you @hugovk.

Bug fixes

  • fix linkify raising an IndexError on certain inputs. Thank you @Google-Autofuzz.

Version 3.2.1 (September 18th, 2020)

... (truncated)

Commits
  • 79b7a3c Merge pull request from GHSA-vv2x-vrpj-qqpq
  • 842fcb4 Update for v3.3.0 release
  • 1334134 sanitizer: escape HTML comments
  • c045a8b Merge pull request #581 from mozilla/nit-fixes
  • 491abb0 fix typo s/vnedoring/vendoring/
  • 10b1c5d vendor: add html5lib-1.1.dist-info/REQUESTED
  • cd838c3 Merge pull request #579 from mozilla/validate-convert-entity-code-points
  • 612b808 Update for v3.2.3 release
  • 6879f6a html5lib_shim: validate unicode points for convert_entity
  • 90cb80b Update for v3.2.2 release
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/EliLillyCo/pytest-wdl/network/alerts).

Failed quickstart test

opened on 2021-01-04 12:53:00 by stanedav

Hello, I am trying to setup pytest-wdl for testing my wdl scripts. I installed the package and I am trying to run example quickstart from your github. The command I am running is: pytest -s -vv --show-capture=all But it failed on: RuntimeError: Error localizing url https://github.com/ekg/freebayes/raw/65251646f8dd9c60e3db276e3c6386936b7cf60b/test/tiny/NA12878.chr22.tiny.bam (Whole log is here: [err.txt](https://github.com/EliLillyCo/pytest-wdl/files/5764732/err.txt

Could you please help me, to find where I am making a mistake?

Releases

1.4.1 2020-11-17 19:53:15

  • Replaces remote file localization method for adding HTTP headers to only add headers on initial request and not redirects.
  • Updated dxpy minimum to 0.297.1 to be able to use cryptography version 2.3 (#106)
  • Upgraded bleach to 3.1.5 (#138)
  • Constrains pytest version <=5.3.5 to avoid breaking changes in pytest (#139)
  • Upgrades Cromwell to version 53.1 in test setup and documentation.

1.4.0 2020-02-26 19:22:01

  • Added support for YAML data and configuration files (#116)
  • Added a Cromwell Server executor (thanks @pamagee!)
  • Added ability to specify tests in JSON/YAML (#117)
  • Updated docs and testing to latest version of Cromwell (v48)
  • Added an optional callback parameter to workflow_runner
  • Fix miniwdl executor when there are no inputs (thanks @mlin!)

1.3.0 2020-02-14 23:50:12

  • Added support for testing workflows on DNAnexus using dxWDL
  • Using DNAnexus-related features will cause the user to be automatically logged in to their account if not already logged in (log-in is interactive unless account credentials or a token are specified in the config file)
  • Enhanced support for miniwdl and made it the default executor (to configure different default executor(s), see the manual)
  • Generate requirements.txt using pip freeze. Note that miniwdl is pegged to a specific version (0.6.4) because we depend on internal functionality; this limitation will be fixed in a future release
  • Many improvements to the manual (thanks @mlin for suggestions), including a new "quickstart" example project
  • Bugfix: within-project local data file resolution was implemented incorrectly for the case where there are packages (i.e. __init__.py files) in the tests/ folder - it is now fixed.

1.2.1 2019-12-12 14:44:25

  • Fixes #93 - ensures parent directories exist when localizing a file

1.2.0 2019-12-04 20:54:38

  • Fix #86 - enable test_data.json file to be located in the same directory as the WDL file
  • When comparing BAM files, by default only compare HD, SQ, and RG headers
  • Enhance the error message that is displayed when a workflow fails
  • Add ability to validate data file digests
  • Optionally show progress bar when downloading data file
  • Update miniwdl minimum version to 0.5.2, and update the miniwdl executor to use docker swarm
  • Update xphyle minimum version to 4.1.3
  • Other bugfixes

1.1.1 2019-09-27 13:46:26

  • Fixes license entry in setup.py for proper rendering to release to PyPI.
Eli Lilly & Company

Eli Lilly & Company GitHub Organization

GitHub Repository Homepage