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

feat: Allow the environment variable SNAKEMAKE_CONDA_PREFIX to be present without --use-conda #2263

Merged

Conversation

mrvollger
Copy link
Contributor

Description

SNAKEMAKE_CONDA_PREFIX is a great tool for shared computing environments and I am encouraging everyone in our lab to set it in their .bashrc it to help with the number of conda builds we have and reduce file usage. However, there is one downside and that is it becomes impossible to run a non conda snakemake without clearing the environment variable because the lack of --use-conda will force snakemake to exit.

In this PR I suggest a quality of life improvement. Instead of having snakemake error out, it will instead warn that the environment variable is set but conda environments will not be used or built because --use-conda is not set. Note, this will only happen when the environment variable is set and not when it is passed as a command line argument.

Thanks for considering!

QC

  • The PR contains a test case for the changes or the changes are already covered by an existing test case.
  • The documentation (docs/) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake).

…thout use_conda. Instead of exiting warn, and then set conda_prefix to None and continue without conda.
@sonarcloud
Copy link

sonarcloud bot commented May 17, 2023

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

@mrvollger
Copy link
Contributor Author

@johanneskoester could you approve the CI tests for this PR? Thanks!

@johanneskoester johanneskoester merged commit e4eba8d into snakemake:main Jun 5, 2023
8 checks passed
johanneskoester pushed a commit that referenced this pull request Jun 9, 2023
🤖 I have created a release *beep* *boop*
---


##
[7.27.0](v7.26.0...v7.27.0)
(2023-06-07)


### Features

* Allow the environment variable SNAKEMAKE_CONDA_PREFIX to be present
without --use-conda
([#2263](#2263))
([e4eba8d](e4eba8d))


### Bug Fixes

* adapt linting rule to Python 3.11
([a3a5c58](a3a5c58))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants