-
Notifications
You must be signed in to change notification settings - Fork 28
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
Improve justfile to manage virtualenv #102
Conversation
…nt for you - Added just target: ``setup-env`` - Test commands are automatically run within the virtual environment without it needing to be activated locally - ``setup-env`` target is parameterized for optional dependencies such as *postgres* and *mysql* - Updated ``CONTRIBUTING.md`` accordingly - Pip commands are run with options to disable some annoying output, avoid waiting for user input, and to fail faster when the upstream repository cannot be reached - The virtual environment folder is setup to contain the python version number so that if the default python version changes it won't try to use an outdated env
49eb5fa
to
ee9b5f2
Compare
# Recipes | ||
@default: | ||
just --list | ||
|
||
setup-env *args: |
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'm not sure there's a need to be so prescriptive on the virtualenv location. The CONTRIBUTING.md
simply shows it as an example. This adds a lot of additional complexity to the project, for the sake of saving a single commad.
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.
A bit, though I do appreciate that the abstraction is general enough that if there is a switch to say, uv
over pip in order to provide faster dependency resolution and such, that the switch could be made seamlessly without disturbing or changing any development workflow.
@@ -1,29 +1,42 @@ | |||
# Variables | |||
PYTHON_VERSION := shell("python -c \"import sys;v=f'{sys.version_info.major}.{sys.version_info.minor}';sys.stdout.write(v)\"") |
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.
Issue: If the system version updates, then the virtualenv disappears without warning.
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.
That's also a good point; coming from Makefiles, the venv would normally just be recreated automatically (but only if it didn't already exist); here there is a need to run the setup command once. I'm not aware of a builtin mechanism for building something only if it doesn't exist.
Do you know if just
supports something to that effect?
Closing PR as unlikely to be merged. Thanks for the quick feedback! |
Improve the justfile by adding a target to build the virtual environment for you
setup-env
setup-env
target is parameterized for optional dependencies such as postgres and mysqlCONTRIBUTING.md
accordingly