-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add docs on how to run tests #53
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can all be replaced with pip install --editable .
which is a pytest best practice.
Or more compactly as demonstrated in the GitHub Action pip install --editable ".[dev]"
test/_prepare_outputs.py
Outdated
@@ -1,6 +1,7 @@ | |||
import glob | |||
import os | |||
import subprocess | |||
import sys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not required if you have a venv.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it hurt though? If not, it seems to me better to keep it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It hurts. Please read Why do virtual environments exist?
from a long-term core Python developer and head of Python development for VSCode... https://snarky.ca/how-virtual-environments-work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the end, whether you type
python
after activation or.venv/bin/python
makes no difference to Python
Hum I don't know if I'm reading that right, but it seems to me this implies it would not hurt, as it says it makes no difference, no? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It says that the goal of using a virtualenv to avoid installing your dependencies into your system Python.
Doing so can cause dependency conflicts that can become unresolvable when multiple projects are installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I do see the upsides of using a virtualenv, much less troublesome than spawning a docker container. But I thought you were saying “it hurts to use sys.executable
instead of "python"
”, and – I guess this where I’m missing something – I don’t see how that relates to virtualenv or how it would hurt.
test/test_outputs.py
Outdated
@@ -1,6 +1,7 @@ | |||
import glob |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not required if you have a venv.
Co-authored-by: Christian Clauss <[email protected]>
sys.executable
instead of "python"
The reason for the shift to |
I couldn't find docs on how to run tests locally, so I had to take a few guesses. I'm suggesting a section at the end of the README.