Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Only --bind Snakemake module into container when we're working with a Python script #1206

merged 2 commits into from Oct 21, 2021


Copy link

@frankier frankier commented Oct 7, 2021


By default Snakemake binds its Python module into the container, but this is only needed for Python script mode.

This is problem if Snakemake is already running inside a Singularity container, as I am experimenting with at then the Snakemake module is not available on the host when executing.

This patch makes it so the bind is only made when we actually need to run a Python script.

Long term, I would favor a situation where the snakemake namespace available to Python scripts was more like a data file, which can somehow be shimmed directly into the script, like the current RustScript implementation --- assuming this is possible. This would seem to allow more flexibility for combining the Singularity implementation with other stuff.

@frankier frankier changed the title Only --bind Snakemake module into container when we're working with a Python script fix: Only --bind Snakemake module into container when we're working with a Python script Oct 7, 2021
Copy link

@johanneskoester johanneskoester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. And yes, I agree about the snakemake object.

Copy link

Can you please format your PR with black?

Copy link
Contributor Author


Copy link

sonarcloud bot commented Oct 21, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@johanneskoester johanneskoester merged commit 1d79f62 into snakemake:main Oct 21, 2021
pvandyken pushed a commit to pvandyken/snakemake that referenced this pull request Nov 15, 2021

Co-authored-by: Johannes Köster <>
Copy link

Why is bind needed for Python scripts? Is it only necessary for importing logger from snakemake.logging?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants