-
Notifications
You must be signed in to change notification settings - Fork 16
Add how-to for creating an environment #247
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
base: main
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
✅ Deploy Preview for learn-scientific-python-org ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
lgtm, just one nit
Co-authored-by: Guen Prawiroatmodjo <[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.
@munkm Thanks for this work and the PR! I've got some style change suggestions, small error corrections, and possible syntax revisions (but those could depend on what workflow you're trying to show).
Let me know if you have any questions!
cd <path/to/science/> | ||
source .venv/bin/activate |
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.
cd <path/to/science/> | |
source .venv/bin/activate | |
source science/bin/activate |
Following pip example syntax
Remember to re-activate your environment when you re-open a terminal. Navigate to | ||
the science folder, and execute: | ||
|
||
```shell | ||
pixi shell | ||
``` |
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.
Not sure if it is worth mentioning that both Pixi and uv
have run
options that allow for you to execute operations inside the virtual environment without explicitly activating them.
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.
Good point! I was having trouble when constructing this document deciding how broad (or narrow) to construct this document. I do think this is a useful tip. Do folks here think it should be included?
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.
Great addition! One structural suggestion to consider: The environment managers are covered in chronological order. It might be helpful to move uv
up to after pip
. Once you know pip
, you mostly know uv
. Likewise, once you know conda
, you mostly know mamba
. It could be helpful to emphasize that uv
and mamba
intentionally hem very close to the pip
and conda
interfaces respectively.
Then, by way of transitioning to the discussion on pixi
, this comparison guide may be a good resource for readers.
- pixi | ||
|
||
In each of these examples we'll create a new virtual environment related to our | ||
project called `science` (you can use whichever name you prefer!). We'll activate |
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.
science
❤️
Maybe we should link other resources on here as well? |
Longer term, I think it makes sense to try to put these in tabs. Most users don't want to learn 4 package managers at the same time, generally they learn one at a time. This could also be used to display the structure: native PyPI tools are Something like this:
I would recommend calling the virtual environment This overlaps a little with https://learn.scientific-python.org/development/tutorials/dev-environment/. |
Co-authored-by: Matthew Feickert <[email protected]>
Co-authored-by: Matthew Feickert <[email protected]>
for more information, see https://pre-commit.ci
Here I'm adding a how-to that includes creating an environment, installing some scientific python tools in the environment, and also installing dependencies from a file. This guide covers basic commands for venv,
I didn't modify https://github.com/scientific-python/learn.scientific-python.org/blob/main/content/contributors/setup/install.md to link to this at first, but depending on review I can do that here or open a new PR.