Skip to main content

Lint Nextflow pipelines in Python

Project description

RefTrace

GitHub release Discord chat

Lint Nextflow pipelines in Python.

pip install reftrace

Features

  • Write custom linting rules in Python.
  • Avoid parsing the Nextflow DSL.
  • Access the Nextflow DSL from Python.

Example Rule

@rule
def no_labels(module: Module, results: LintResults):
    for process in module.processes:
        if not process.labels:
            results.warnings.append(
                ModuleWarning(
                    line=process.line,
                    warning=f"process '{process.name}' has no labels"
                )
            )

Getting Started

Run in your pipeline directory:

reftrace generate  # Create rules.py starter rules
reftrace lint

You'll get output like this:

Module: /home/andrew/nf-core/rnaseq/modules/nf-core/preseq/lcextrap/main.nf
  Warning on line 1: process 'PRESEQ_LCEXTRAP' has non-standard labels: ['error_ignore']

Module: /home/andrew/nf-core/rnaseq/modules/nf-core/hisat2/build/main.nf
  Warning on line 1: process 'HISAT2_BUILD' has conflicting labels: ['process_high', 'process_high_memory']

RefTrace automatically runs the linting rules in rules.py on all modules in the pipeline.

Access Nextflow from Python

from reftrace import Module

module = Module("path/to/nextflow.nf")

Limitations

  • Not all parts of the Nextflow DSL are yet exposed. Specifically, only processes are handled. Only directives, process inputs, and process outputs are exposed to linting rules.

  • The parser is not perfect. It doesn't seek to handle all of Groovy, but enough to work in practice. Even so, test coverage could be better. If you encounter a parsing bug, please open an issue.

Test Data

The files in the testdata/groovy_core directory are derived from the Apache Groovy project's test suite and are licensed under the Apache License 2.0. The original source files can be found in the Apache Groovy repository.

Acknowledgements

We would like to express our gratitude to the following:

  • The Apache Groovy project.
  • The ANTLR project, for providing the parser generator used in this tool.
  • The Go programming language and its standard library.
  • The Nextflow project and community, for being so welcoming and helpful.

License

This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

reftrace-0.6.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

reftrace-0.6.0-cp313-cp313-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

reftrace-0.6.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

reftrace-0.6.0-cp312-cp312-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

reftrace-0.6.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

reftrace-0.6.0-cp311-cp311-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

reftrace-0.6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

reftrace-0.6.0-cp310-cp310-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

reftrace-0.6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

reftrace-0.6.0-cp39-cp39-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file reftrace-0.6.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for reftrace-0.6.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6237b6584499bc6ef2daaf2daa6188538de80244326123cb79391c749d0cf156
MD5 1bfc8356d77ba06a72361bb1545b803c
BLAKE2b-256 baa833b26b25fce65ab94c178447d87c22b14be9ae0de150b94353b247044d31

See more details on using hashes here.

Provenance

The following attestation bundles were made for reftrace-0.6.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build.yml on RefTrace/RefTrace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reftrace-0.6.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for reftrace-0.6.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8ff48b965b7ad7303e542b26ba8210905d7d1430479cc9e799960d8844d58360
MD5 23b47888076ec5df3231dabafa3200a8
BLAKE2b-256 f318dbb38c5930a6875447fea3c2cdbe2f8222c98d6cf98b58718d04185c26dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for reftrace-0.6.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: build.yml on RefTrace/RefTrace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reftrace-0.6.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for reftrace-0.6.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d568c6a8662e7d0d7ec405e12d7d0b3f49d760c92b9f4586bb503003707c49bd
MD5 d258a0a9919db122250eea13e07dc0a9
BLAKE2b-256 5ea12c502bbf2584f6e8354c2cc6f29fab215f3a10d583708985308278f67961

See more details on using hashes here.

Provenance

The following attestation bundles were made for reftrace-0.6.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build.yml on RefTrace/RefTrace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reftrace-0.6.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for reftrace-0.6.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2a499271bd7eacb6f59be2640447f5aa2eac218c48ce53add2560f1d779fadb6
MD5 5fee9ec0185d57522b1f778d00a83e6c
BLAKE2b-256 6e8d3027a28241c8e8639b081f2554a2e45a20a03a79a383d616cfd83bd77459

See more details on using hashes here.

Provenance

The following attestation bundles were made for reftrace-0.6.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: build.yml on RefTrace/RefTrace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reftrace-0.6.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for reftrace-0.6.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1bd1aff40b8cce788f7e903d2dc321405e08dc33a1fd71dc52f1ee0d1e84da8f
MD5 f5eb13984e9f1ffc8e13ceef142b6284
BLAKE2b-256 e797567c5fa2c6ccbdef7b8e91350f15137e65ed21040f557aed4a191ac37f49

See more details on using hashes here.

Provenance

The following attestation bundles were made for reftrace-0.6.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build.yml on RefTrace/RefTrace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reftrace-0.6.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for reftrace-0.6.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6e1b628e9b344f8fc2b92f99f976d92032e6afc7f3039785cad4bdb02cb27163
MD5 6dfc92fae87ee290c0f28a6d128cc868
BLAKE2b-256 398dd16e12fee50528a4293fab59a3f43d9cfe7da4e21087e8574f34513c1ee2

See more details on using hashes here.

Provenance

The following attestation bundles were made for reftrace-0.6.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: build.yml on RefTrace/RefTrace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reftrace-0.6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for reftrace-0.6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 64494c4a99d112e60f0bb7db82e1bd74730ec9d224b1688f6f5815b01a32ab08
MD5 46f6e05d61110f3da7036b26452d0deb
BLAKE2b-256 6e66e4a13f850a5a48ccdf21c5e11d52b2905aa975eff617f27c19d589113ff8

See more details on using hashes here.

Provenance

The following attestation bundles were made for reftrace-0.6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build.yml on RefTrace/RefTrace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reftrace-0.6.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for reftrace-0.6.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 281028e5ae1dfe66c3ac83d29371fa46ed1fcfa94a4de1774a089afb223c3619
MD5 e76eb410db08433c9d892311f793aea3
BLAKE2b-256 c69b753cd872412eba6587a19b25671c3efa12c47900259dd2a68e3156861fba

See more details on using hashes here.

Provenance

The following attestation bundles were made for reftrace-0.6.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: build.yml on RefTrace/RefTrace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reftrace-0.6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for reftrace-0.6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9a6aedc1e64d0bacea0c0cf55de3dfaf1260045ad33674c2a2ea6e1e441b1f62
MD5 aea6fc902c6c9fd093f0d172501679e7
BLAKE2b-256 291c163778f05d15cc94698174c47ac18707631c627ad613b41cc925d48bc4ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for reftrace-0.6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build.yml on RefTrace/RefTrace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reftrace-0.6.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for reftrace-0.6.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dc0f7daed5a2395315a2972dfab4c46cc906bd1304d5144bf7df8d8fc01edd87
MD5 5c0c66a21a1fb679e2c13aafcc2606a0
BLAKE2b-256 2be22fe6de741e633f938b8838c767f39ad6ac84461e194668e252ede488fe4d

See more details on using hashes here.

Provenance

The following attestation bundles were made for reftrace-0.6.0-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: build.yml on RefTrace/RefTrace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page