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: conda python interpreter path on Windows #1711

Merged
merged 6 commits into from
Jul 19, 2022

Conversation

yeyuan98
Copy link
Contributor

Description

PythonScript._is_python_env was not working properly as of v7.8.2 on Windows thereby preventing python scripts from executing with python interpreters from rule-based conda environments.

The bug should be resulting from inconsistencies when conda creates Python environments on Windows versus Unix-like systems. On Windows, the python interpreter will not exist as <conda_env_root>/bin/python but as <conda_env_root>/python.exe. Please refer to Anaconda documentation here.

Added a new test case test_conda_python_script in tests folder and added the test to tests/tests.py. However, it seems that nose is unmaintained and I could not run the nosetests in my local computer.

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).

@johanneskoester
Copy link
Contributor

Just use pytests, we no longer use nose. Maybe it needs to be removed somewhere from the docs?

@@ -1,1369 +1,1374 @@
__author__ = "Johannes Köster"
Copy link
Contributor

Choose a reason for hiding this comment

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

Mhm, this gigantic change in this file is fishy (all the lines below, not this single one)... What is going on here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe windows linebreaks?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks a lot for your explanation.. Sorry, new git user here. I think the problem is I pushed from a Windows machine and did not set hard line break settings. Git forces CRLF and replace LF on Windows by default.

Fixed the line break problem. Hopefully it will work!

@sonarcloud
Copy link

sonarcloud bot commented Jun 24, 2022

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

@yeyuan98
Copy link
Contributor Author

The previous commit got an issue with the black formatting guideline. Reformatted tests.py with black.

@johanneskoester johanneskoester merged commit 155c9d6 into snakemake:main Jul 19, 2022
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