This package is a plugin for the pytest unit testing framework that enables testing of workflows written in Workflow Description Language.
Other python dependencies are installed when you install the library.
commandline
$ pip install pytest-wdl
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
Some optional features of pytest-wdl have additional dependencies that are loaded on-demand.
The plugins that have extra dependencies are:
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]
The pytest-wdl plugin provides a set of fixtures for use with pytest. Here is a quick example that tests the following workflow.
```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
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
{ "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.
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:
See the manual for more details on configuring pytest-wdl.
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.
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.
Bumps cryptography from 2.9.2 to 39.0.1.
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
andfrom_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 buildcryptography
from source (i.e., not from awheel
), and specify their own version of OpenSSL. For those users, theCFLAGS
,LDFLAGS
,INCLUDE
,LIB
, andCRYPTOGRAPHY_SUPPRESS_LINK_FLAGS
environment variables will no longer be respected. Instead, users will need to configure their buildsas 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)
d6951dc
changelog + security fix backport (#8231)138da90
workaround scapy bug in downstream tests (#8218) (#8228)69527bc
bookworm is py311 now (#8200)111deef
backport main branch CI to 39.0.x (#8153)338a65a
39.0.0 version bump (#7954)84a3cd7
automatically download and upload circleci wheels (#7949)525c0b3
Type annotate release.py (#7951)46d2a94
Use the latest 3.10 release when wheel building (#7953)f150dc1
fix CI to work with ubuntu 22.04 (#7950)8867724
fix README for python3 (#7947)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
.
Bumps certifi from 2020.12.5 to 2022.12.7.
9e9e840
2022.12.07b81bdb2
2022.09.24939a28f
2022.09.14aca828a
2022.06.15.2de0eae1
Only use importlib.resources's new files() / Traversable API on Python ≥3.11 ...b8eb5e9
2022.06.15.147fb7ab
Fix deprecation warning on Python 3.11 (#199)b0b48e0
fixes #198 -- update link in license9d514b4
2022.06.154151e88
Add py.typed to MANIFEST.in to package in sdist (#196)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
.
Bumps urllib3 from 1.25.11 to 1.26.5.
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 defaultSSLContext
now setscheck_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
andCERT_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 aUser-Agent
header key is passed asbytes
(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 aDeprecationWarning
will failDeprecated
Retry
optionsRetry.DEFAULT_METHOD_WHITELIST
,Retry.DEFAULT_REDIRECT_HEADERS_BLACKLIST
andRetry(method_whitelist=...)
in favor ofRetry.DEFAULT_ALLOWED_METHODS
,Retry.DEFAULT_REMOVE_HEADERS_ON_REDIRECT
, andRetry(allowed_methods=...)
(Pull #2000) Starting in urllib3 v2.0: Deprecated options will be removed
... (truncated)
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 defaultSSLContext
now setscheck_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
andCERT_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 aUser-Agent
header key is passed asbytes
(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)
d161647
Release 1.26.52d4a3fe
Improve performance of sub-authority splitting in URL2698537
Update vendored six to 1.16.007bed79
Fix deprecation warnings for Python 3.10 ssl moduled725a9b
Add Python 3.10 to GitHub Actions339ad34
Use pytest==6.2.4 on Python 3.10+f271c9c
Apply latest Black formatting1884878
[1.26] Properly proxy EOF on the SSLTransport test suitea891304
Release 1.26.48d65ea1
Merge pull request from GHSA-5phf-pp7p-vc2rDependabot 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
.
dxCompiler still has the same CLI as dxWDL, so we support both using the same base executor.
Bumps bleach from 3.1.5 to 3.3.0.
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)
79b7a3c
Merge pull request from GHSA-vv2x-vrpj-qqpq842fcb4
Update for v3.3.0 release1334134
sanitizer: escape HTML commentsc045a8b
Merge pull request #581 from mozilla/nit-fixes491abb0
fix typo s/vnedoring/vendoring/10b1c5d
vendor: add html5lib-1.1.dist-info/REQUESTEDcd838c3
Merge pull request #579 from mozilla/validate-convert-entity-code-points612b808
Update for v3.2.3 release6879f6a
html5lib_shim: validate unicode points for convert_entity90cb80b
Update for v3.2.2 releaseDependabot 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
.
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?
dxpy
minimum to 0.297.1
to be able to use cryptography
version 2.3
(#106)bleach
to 3.1.5
(#138)pytest
version <=5.3.5
to avoid breaking changes in pytest
(#139)Cromwell
to version 53.1
in test setup and documentation.callback
parameter to workflow_runner
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__init__.py
files) in the tests/
folder - it is now fixed.license
entry in setup.py
for proper rendering to release to PyPI.