-
Notifications
You must be signed in to change notification settings - Fork 2
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 uv
and pixi
.
#464
Add uv
and pixi
.
#464
Conversation
Resolves #419.
@dstansby I thought you were on holiday! |
🙈 🙉 🙊 |
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.
Other than minor typo fix looks good to me! Based on in-person conversation about uvx
/ uv tool install
versus current solution, I think my comment below may be better dealt with in a separate future pull-request.
README.md
Outdated
1. Install [cookiecutter] in a `uv venv` or `conda` environment (commented lines for | ||
`uv venv` example). | ||
|
||
``` | ||
# conda create --channel conda-forge --name new-env-name | ||
# conda activate new-env-name | ||
# conda install pip | ||
pip install cookiecutter | ||
# uv venv # creates a .venv directory wherever you are | ||
# source ./.venv/bin/activate | ||
uv pip install cookiecutter |
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.
As an alternative to installing in a (project specific) uv
virtual environment we could recommend using the uv
tools feature. Equivalent would then be something like
uv tool install cookiecutter
which will install cookiecutter
in an isolated virtual environment and set up so cookiecutter
is added to path.
Alternatively we could recommend using uvx
to install and run directly in a temporary virtual environment
uvx cookiecutter gh:ucl-arc/python-tooling
This appears to be fairly minimal overhead (reports 13ms for installing packages in temporary virtual environment in my local system so no noticeable lag).
Problem with the latter is it then makes it difficult to keep instructions generic across different package manager / virtual environment solutions.
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 of a rewording of the whole instructions then.
How about just laying out a few options in prose (doing away with step numbers)...
If you use [`uv`](LINK) you can use our template with the following one-liner
```sh
uvx cookiecutter gh:ucl-arc/python-tooling
```
You could also [install cookiecutter]() system-wide if you're likely to want to use cookiecutter again.
We like installing it as a [uv tool](LINKTOUVTOOLSDOCS)
```
uv tool install cookiecutter
cookiecutter gh:ucl-arc/python-tooling
```
Co-authored-by: Sam Cunliffe <[email protected]>
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 wonderful fruitful (🫐) discussion was had
Sure! Though I think worth tackling. |
Co-authored-by: Matt Graham <[email protected]>
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
I've attempted to simplify the user-facing quick-start instructions. Not a huge fan of enumerated instructions and the optional (but cool) one-liner it doesn't really fit in 1. 2. 3.... Also it's a bit overkill to have a venv/conda environment just for cookiecutter itself. The cookiecutter docs recommend `pipx install`. I claim that we want to encourage `uvx` because it's fast and cool 😎 . I've spent a bit of effort trying to be clear but comments on clarity etc are very welcome. I also moved and merged the dev instructions into CONTRIBUTING so README is _**just**_ user-facing. And CONTRIBUTING is just dev. This addresses - #466 And two comments - #464 (comment) - #419 (comment) --------- Co-authored-by: David Stansby <[email protected]> Co-authored-by: Patrick J. Roddy <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Resolves #419.
Notably not done, is that I've not updated the tutorial.md to use
uv
instead of Anaconda. I'd need to use a Windows machine to test the instructions before I'd feel confident changing the tutorial.