From 01318713d8ea177d721bf8f2e2eb125a88211bf5 Mon Sep 17 00:00:00 2001 From: Madicken Munk Date: Sun, 11 May 2025 17:23:37 -0700 Subject: [PATCH 01/11] pull out environment directions from contributor install guide --- content/how-tos/envs.md | 123 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 content/how-tos/envs.md diff --git a/content/how-tos/envs.md b/content/how-tos/envs.md new file mode 100644 index 0000000..3d3e50c --- /dev/null +++ b/content/how-tos/envs.md @@ -0,0 +1,123 @@ +--- +title: How to set up a virtual environment +--- + +In this guide we summarize some key commands to set up a virtual environment +with different tools in the scientific python ecosystem. +A virtual environment is a workspace into which you can install Python +libraries, separate from what is being used by your operating system. + +The environment managers that are covered in this how-to guide include: +- venv +- conda +- mamba +- uv +- 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 the environment, install some dependencies, and see +an example of installing dependencies from a file. + +### Set up a virtual environment with venv + +With venv we'll have our virtual environment associated with our project folder called `science`. + +``` +python -m venv science +``` + +Start using it by activating it as follows: + +``` +source science/bin/activate +``` + +You are now ready to install Scientific Python packages using `pip`! For example: + +``` +pip install ipython numpy scipy +``` + +Often you'll interact with projects that have a specific list of dependencies (for development +environments, testing environments, or the project itself). You can install the list of dependencies +with pip in your venv using: + +``` +pip install -r requirements.txt +``` + +Remember to re-activate your environment every time you open a new terminal, using: + +``` +source science/bin/activate +``` + +### Set up a virtual environment using conda + +With conda, we can create a new environment named science (-n is the same as passing --name): + +``` +conda create -n science +``` + +Start using your environment by activating it: + +``` +conda activate science +``` + +You are now ready to install Scientific Python packages using `conda`! +For example: + +``` +conda install ipython numpy scipy +``` + +Often you'll interact with projects that have a specific list of dependencies (for development +environments, testing environments, or the project itself). You can install the list of dependencies +with conda in your environment using: + +``` +conda install --file requirements.txt +``` + +Remember to re-activate your environment every time you open a new terminal: + +``` +conda activate science +``` + +### Set up a virtual environment using mamba + +With mamba, like conda, we can create a new environment named science (-n is the same as passing --name): + +``` +mamba create -n science +``` + +Start using your environment by activating it: + +``` +mamba activate science +``` + +You are now ready to install Scientific Python packages using `mamba`! +For example: + +``` +mamba install ipython numpy scipy +``` + +Often you'll interact with projects that have a specific list of dependencies (for development +environments, testing environments, or the project itself). You can install the list of dependencies +with mamba in your environment using: + +``` +mamba install --file requirements.txt +``` + +Remember to re-activate your environment every time you open a new terminal: + +``` +mamba activate science +``` From e6dc8c9f8ef0e83f4ef9eb39191192f9a68471e8 Mon Sep 17 00:00:00 2001 From: Madicken Munk Date: Mon, 12 May 2025 14:30:44 -0700 Subject: [PATCH 02/11] add in pixi and uv commands --- ...{envs.md => how-to-create-environments.md} | 100 ++++++++++++++++-- 1 file changed, 89 insertions(+), 11 deletions(-) rename content/how-tos/{envs.md => how-to-create-environments.md} (52%) diff --git a/content/how-tos/envs.md b/content/how-tos/how-to-create-environments.md similarity index 52% rename from content/how-tos/envs.md rename to content/how-tos/how-to-create-environments.md index 3d3e50c..ff10707 100644 --- a/content/how-tos/envs.md +++ b/content/how-tos/how-to-create-environments.md @@ -43,7 +43,7 @@ environments, testing environments, or the project itself). You can install the with pip in your venv using: ``` -pip install -r requirements.txt +pip install -r ``` Remember to re-activate your environment every time you open a new terminal, using: @@ -52,7 +52,7 @@ Remember to re-activate your environment every time you open a new terminal, usi source science/bin/activate ``` -### Set up a virtual environment using conda +### Set up an environment using conda With conda, we can create a new environment named science (-n is the same as passing --name): @@ -73,12 +73,12 @@ For example: conda install ipython numpy scipy ``` -Often you'll interact with projects that have a specific list of dependencies (for development -environments, testing environments, or the project itself). You can install the list of dependencies -with conda in your environment using: +Some projects distribute environment files with listed dependencies with an `environment.yml` file. +The first line of this file sets the environment's name. To +create an environment and install the dependencies with this file, use: ``` -conda install --file requirements.txt +conda env create -f ``` Remember to re-activate your environment every time you open a new terminal: @@ -87,7 +87,7 @@ Remember to re-activate your environment every time you open a new terminal: conda activate science ``` -### Set up a virtual environment using mamba +### Set up an environment using mamba With mamba, like conda, we can create a new environment named science (-n is the same as passing --name): @@ -108,12 +108,10 @@ For example: mamba install ipython numpy scipy ``` -Often you'll interact with projects that have a specific list of dependencies (for development -environments, testing environments, or the project itself). You can install the list of dependencies -with mamba in your environment using: +To install a specific environment from a `.yml` file, use: ``` -mamba install --file requirements.txt +mamba create -f ``` Remember to re-activate your environment every time you open a new terminal: @@ -121,3 +119,83 @@ Remember to re-activate your environment every time you open a new terminal: ``` mamba activate science ``` + +### Set up a virtual environment using uv + +To create a new environment using uv in our project folder called `science`: + +``` +uv venv +``` + +Start using your environment by activating it: + +``` +source .venv/bin/activate +``` + +You are now ready to install Scientific Python packages using `uv`! +For example: + +``` +uv pip install ipython numpy scipy +``` + +To install dependencies from a requirements file, use: + +``` +uv pip install -f +``` + +Remember to re-activate your environment time you open a new terminal: + +``` +source .venv/bin/activate +``` + +You can find more information on using uv for environments +[here](https://docs.astral.sh/uv/pip/environments/#creating-a-virtual-environment). + +### Set up a virtual environment using pixi + +To initialize a new project with pixi in our project called `science`, execute: + +``` +pixi init +``` + +You are now ready to install Scientific Python packages as dependencies in this project! +From the science directory, execute: + +``` +pixi add ipython numpy scipy +``` + +To install dependencies from a file like `environment.yml`, use: + +``` +pixi init --import +``` + +Remember to re-activate your environment when you re-open a terminal. Navigate to +the science folder, and execute: + +``` +pixi shell +``` + +A pixi project may have multiple environments defined in the `pixi.toml` file. To +load a specific environment: + +``` +pixi shell --environment= +``` + +You can find more information on using pixi +[here](https://docs.astral.sh/uv/pip/environments/#creating-a-virtual-environment). + + + + + + From f801bbb751e8eb44ff66b18939ffd769dda0832a Mon Sep 17 00:00:00 2001 From: Madicken Munk Date: Mon, 12 May 2025 14:53:06 -0700 Subject: [PATCH 03/11] add links to docs for each tool --- content/how-tos/how-to-create-environments.md | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/content/how-tos/how-to-create-environments.md b/content/how-tos/how-to-create-environments.md index ff10707..7c08c61 100644 --- a/content/how-tos/how-to-create-environments.md +++ b/content/how-tos/how-to-create-environments.md @@ -1,10 +1,10 @@ --- -title: How to set up a virtual environment +title: How to set up an environment --- -In this guide we summarize some key commands to set up a virtual environment -with different tools in the scientific python ecosystem. -A virtual environment is a workspace into which you can install Python +In this guide we summarize some key commands to set up an environment +with different tools that you might encounter in the scientific python +ecosystem. An environment is a workspace into which you can install Python libraries, separate from what is being used by your operating system. The environment managers that are covered in this how-to guide include: @@ -14,13 +14,16 @@ The environment managers that are covered in this how-to guide include: - uv - 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 the environment, install some dependencies, and see -an example of installing dependencies from a file. +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 +the environment, install some dependencies, and see +an example of installing dependencies from an existing file. You may encounter +files like `requirements.txt`, `environment.yml` or `pyproject.toml` that specify +needed dependencies for a project. ### Set up a virtual environment with venv -With venv we'll have our virtual environment associated with our project folder called `science`. +With venv to create environment associated with a project folder called `science`. ``` python -m venv science @@ -52,6 +55,9 @@ Remember to re-activate your environment every time you open a new terminal, usi source science/bin/activate ``` +You can find more information on using venv for packaging +[here](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/). + ### Set up an environment using conda With conda, we can create a new environment named science (-n is the same as passing --name): @@ -87,6 +93,9 @@ Remember to re-activate your environment every time you open a new terminal: conda activate science ``` +You can find more information on using conda for environments +[here](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html). + ### Set up an environment using mamba With mamba, like conda, we can create a new environment named science (-n is the same as passing --name): @@ -120,6 +129,9 @@ Remember to re-activate your environment every time you open a new terminal: mamba activate science ``` +You can find more information on using mamba in the +[mamba user guide](https://mamba.readthedocs.io/en/latest/user_guide/mamba.html). + ### Set up a virtual environment using uv To create a new environment using uv in our project folder called `science`: @@ -192,7 +204,7 @@ pixi shell --environment= ``` You can find more information on using pixi -[here](https://docs.astral.sh/uv/pip/environments/#creating-a-virtual-environment). +[here](https://prefix.dev/docs/pixi/basic_usage). From 3052c7d7bdcd98b497b216649ce3ae765adba000 Mon Sep 17 00:00:00 2001 From: Madicken Munk Date: Mon, 12 May 2025 15:02:41 -0700 Subject: [PATCH 04/11] add shell highlighting for environment commands --- content/how-tos/how-to-create-environments.md | 56 ++++++++++--------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/content/how-tos/how-to-create-environments.md b/content/how-tos/how-to-create-environments.md index 7c08c61..cdb6a9b 100644 --- a/content/how-tos/how-to-create-environments.md +++ b/content/how-tos/how-to-create-environments.md @@ -25,19 +25,19 @@ needed dependencies for a project. With venv to create environment associated with a project folder called `science`. -``` +```shell python -m venv science ``` Start using it by activating it as follows: -``` +```shell source science/bin/activate ``` You are now ready to install Scientific Python packages using `pip`! For example: -``` +```shell pip install ipython numpy scipy ``` @@ -45,13 +45,13 @@ Often you'll interact with projects that have a specific list of dependencies (f environments, testing environments, or the project itself). You can install the list of dependencies with pip in your venv using: -``` +```shell pip install -r ``` Remember to re-activate your environment every time you open a new terminal, using: -``` +```shell source science/bin/activate ``` @@ -62,20 +62,20 @@ You can find more information on using venv for packaging With conda, we can create a new environment named science (-n is the same as passing --name): -``` +```shell conda create -n science ``` Start using your environment by activating it: -``` +```shell conda activate science ``` You are now ready to install Scientific Python packages using `conda`! For example: -``` +```shell conda install ipython numpy scipy ``` @@ -83,13 +83,13 @@ Some projects distribute environment files with listed dependencies with an `env The first line of this file sets the environment's name. To create an environment and install the dependencies with this file, use: -``` +```shell conda env create -f ``` Remember to re-activate your environment every time you open a new terminal: -``` +```shell conda activate science ``` @@ -100,32 +100,32 @@ You can find more information on using conda for environments With mamba, like conda, we can create a new environment named science (-n is the same as passing --name): -``` +```shell mamba create -n science ``` Start using your environment by activating it: -``` +```shell mamba activate science ``` You are now ready to install Scientific Python packages using `mamba`! For example: -``` +```shell mamba install ipython numpy scipy ``` To install a specific environment from a `.yml` file, use: -``` +```shell mamba create -f ``` Remember to re-activate your environment every time you open a new terminal: -``` +```shell mamba activate science ``` @@ -134,34 +134,35 @@ You can find more information on using mamba in the ### Set up a virtual environment using uv -To create a new environment using uv in our project folder called `science`: +To create a new environment using uv in a project folder called `science`, +navigate to that folder and execute: -``` +```shell uv venv ``` Start using your environment by activating it: -``` +```shell source .venv/bin/activate ``` You are now ready to install Scientific Python packages using `uv`! For example: -``` +```shell uv pip install ipython numpy scipy ``` To install dependencies from a requirements file, use: -``` +```shell uv pip install -f ``` Remember to re-activate your environment time you open a new terminal: -``` +```shell source .venv/bin/activate ``` @@ -172,34 +173,37 @@ You can find more information on using uv for environments To initialize a new project with pixi in our project called `science`, execute: -``` +```shell pixi init ``` You are now ready to install Scientific Python packages as dependencies in this project! From the science directory, execute: -``` +```shell pixi add ipython numpy scipy ``` To install dependencies from a file like `environment.yml`, use: -``` +```shell pixi init --import ``` Remember to re-activate your environment when you re-open a terminal. Navigate to the science folder, and execute: -``` +```shell pixi shell ``` +This will drop you into the default environment for the pixi project, with all +dependencies in that environment accessible to you in that shell. + A pixi project may have multiple environments defined in the `pixi.toml` file. To load a specific environment: -``` +```shell pixi shell --environment= ``` From 3051600b95abb2494816ef77119a63e8f8d3f7c3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 12 May 2025 22:08:22 +0000 Subject: [PATCH 05/11] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- content/how-tos/how-to-create-environments.md | 83 +++++++++---------- 1 file changed, 39 insertions(+), 44 deletions(-) diff --git a/content/how-tos/how-to-create-environments.md b/content/how-tos/how-to-create-environments.md index cdb6a9b..dde366f 100644 --- a/content/how-tos/how-to-create-environments.md +++ b/content/how-tos/how-to-create-environments.md @@ -3,27 +3,28 @@ title: How to set up an environment --- In this guide we summarize some key commands to set up an environment -with different tools that you might encounter in the scientific python +with different tools that you might encounter in the scientific python ecosystem. An environment is a workspace into which you can install Python libraries, separate from what is being used by your operating system. The environment managers that are covered in this how-to guide include: + - venv - conda - mamba - uv - 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 -the environment, install some dependencies, and see -an example of installing dependencies from an existing file. You may encounter -files like `requirements.txt`, `environment.yml` or `pyproject.toml` that specify -needed dependencies for a project. +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 +the environment, install some dependencies, and see +an example of installing dependencies from an existing file. You may encounter +files like `requirements.txt`, `environment.yml` or `pyproject.toml` that specify +needed dependencies for a project. ### Set up a virtual environment with venv -With venv to create environment associated with a project folder called `science`. +With venv to create environment associated with a project folder called `science`. ```shell python -m venv science @@ -41,9 +42,9 @@ You are now ready to install Scientific Python packages using `pip`! For example pip install ipython numpy scipy ``` -Often you'll interact with projects that have a specific list of dependencies (for development +Often you'll interact with projects that have a specific list of dependencies (for development environments, testing environments, or the project itself). You can install the list of dependencies -with pip in your venv using: +with pip in your venv using: ```shell pip install -r @@ -55,10 +56,10 @@ Remember to re-activate your environment every time you open a new terminal, usi source science/bin/activate ``` -You can find more information on using venv for packaging +You can find more information on using venv for packaging [here](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/). -### Set up an environment using conda +### Set up an environment using conda With conda, we can create a new environment named science (-n is the same as passing --name): @@ -66,7 +67,7 @@ With conda, we can create a new environment named science (-n is the same as pas conda create -n science ``` -Start using your environment by activating it: +Start using your environment by activating it: ```shell conda activate science @@ -79,9 +80,9 @@ For example: conda install ipython numpy scipy ``` -Some projects distribute environment files with listed dependencies with an `environment.yml` file. +Some projects distribute environment files with listed dependencies with an `environment.yml` file. The first line of this file sets the environment's name. To -create an environment and install the dependencies with this file, use: +create an environment and install the dependencies with this file, use: ```shell conda env create -f @@ -93,10 +94,10 @@ Remember to re-activate your environment every time you open a new terminal: conda activate science ``` -You can find more information on using conda for environments +You can find more information on using conda for environments [here](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html). -### Set up an environment using mamba +### Set up an environment using mamba With mamba, like conda, we can create a new environment named science (-n is the same as passing --name): @@ -104,7 +105,7 @@ With mamba, like conda, we can create a new environment named science (-n is the mamba create -n science ``` -Start using your environment by activating it: +Start using your environment by activating it: ```shell mamba activate science @@ -117,7 +118,7 @@ For example: mamba install ipython numpy scipy ``` -To install a specific environment from a `.yml` file, use: +To install a specific environment from a `.yml` file, use: ```shell mamba create -f @@ -129,19 +130,19 @@ Remember to re-activate your environment every time you open a new terminal: mamba activate science ``` -You can find more information on using mamba in the +You can find more information on using mamba in the [mamba user guide](https://mamba.readthedocs.io/en/latest/user_guide/mamba.html). -### Set up a virtual environment using uv +### Set up a virtual environment using uv -To create a new environment using uv in a project folder called `science`, -navigate to that folder and execute: +To create a new environment using uv in a project folder called `science`, +navigate to that folder and execute: ```shell uv venv ``` -Start using your environment by activating it: +Start using your environment by activating it: ```shell source .venv/bin/activate @@ -154,7 +155,7 @@ For example: uv pip install ipython numpy scipy ``` -To install dependencies from a requirements file, use: +To install dependencies from a requirements file, use: ```shell uv pip install -f @@ -166,15 +167,15 @@ Remember to re-activate your environment time you open a new terminal: source .venv/bin/activate ``` -You can find more information on using uv for environments +You can find more information on using uv for environments [here](https://docs.astral.sh/uv/pip/environments/#creating-a-virtual-environment). -### Set up a virtual environment using pixi +### Set up a virtual environment using pixi -To initialize a new project with pixi in our project called `science`, execute: +To initialize a new project with pixi in our project called `science`, execute: ```shell -pixi init +pixi init ``` You are now ready to install Scientific Python packages as dependencies in this project! @@ -184,34 +185,28 @@ From the science directory, execute: pixi add ipython numpy scipy ``` -To install dependencies from a file like `environment.yml`, use: +To install dependencies from a file like `environment.yml`, use: ```shell pixi init --import ``` -Remember to re-activate your environment when you re-open a terminal. Navigate to +Remember to re-activate your environment when you re-open a terminal. Navigate to the science folder, and execute: ```shell -pixi shell +pixi shell ``` -This will drop you into the default environment for the pixi project, with all -dependencies in that environment accessible to you in that shell. +This will drop you into the default environment for the pixi project, with all +dependencies in that environment accessible to you in that shell. -A pixi project may have multiple environments defined in the `pixi.toml` file. To -load a specific environment: +A pixi project may have multiple environments defined in the `pixi.toml` file. To +load a specific environment: ```shell -pixi shell --environment= +pixi shell --environment= ``` -You can find more information on using pixi +You can find more information on using pixi [here](https://prefix.dev/docs/pixi/basic_usage). - - - - - - From 89c5e179ffcbb56430fec7b726ad692fc0ab6ab0 Mon Sep 17 00:00:00 2001 From: Madicken Munk Date: Tue, 13 May 2025 15:16:11 -0700 Subject: [PATCH 06/11] Update path for reactivating env for venv Co-authored-by: Guen Prawiroatmodjo --- content/how-tos/how-to-create-environments.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content/how-tos/how-to-create-environments.md b/content/how-tos/how-to-create-environments.md index dde366f..3b078bb 100644 --- a/content/how-tos/how-to-create-environments.md +++ b/content/how-tos/how-to-create-environments.md @@ -164,7 +164,8 @@ uv pip install -f Remember to re-activate your environment time you open a new terminal: ```shell -source .venv/bin/activate +cd +source .venv/bin/activate ``` You can find more information on using uv for environments From 43fde64fa87d383edd223bef947f2947b2cc852f Mon Sep 17 00:00:00 2001 From: Madicken Munk Date: Wed, 14 May 2025 15:13:16 -0700 Subject: [PATCH 07/11] move uv to be after venv --- content/how-tos/how-to-create-environments.md | 76 +++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/content/how-tos/how-to-create-environments.md b/content/how-tos/how-to-create-environments.md index 3b078bb..38cd933 100644 --- a/content/how-tos/how-to-create-environments.md +++ b/content/how-tos/how-to-create-environments.md @@ -59,6 +59,44 @@ source science/bin/activate You can find more information on using venv for packaging [here](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/). +### Set up a virtual environment using uv + +To create a new environment using uv in a project folder called `science`, +navigate to that folder and execute: + +```shell +uv venv +``` + +Start using your environment by activating it: + +```shell +source .venv/bin/activate +``` + +You are now ready to install Scientific Python packages using `uv`! +For example: + +```shell +uv pip install ipython numpy scipy +``` + +To install dependencies from a requirements file, use: + +```shell +uv pip install -f +``` + +Remember to re-activate your environment time you open a new terminal: + +```shell +cd +source .venv/bin/activate +``` + +You can find more information on using uv for environments +[here](https://docs.astral.sh/uv/pip/environments/#creating-a-virtual-environment). + ### Set up an environment using conda With conda, we can create a new environment named science (-n is the same as passing --name): @@ -133,44 +171,6 @@ mamba activate science You can find more information on using mamba in the [mamba user guide](https://mamba.readthedocs.io/en/latest/user_guide/mamba.html). -### Set up a virtual environment using uv - -To create a new environment using uv in a project folder called `science`, -navigate to that folder and execute: - -```shell -uv venv -``` - -Start using your environment by activating it: - -```shell -source .venv/bin/activate -``` - -You are now ready to install Scientific Python packages using `uv`! -For example: - -```shell -uv pip install ipython numpy scipy -``` - -To install dependencies from a requirements file, use: - -```shell -uv pip install -f -``` - -Remember to re-activate your environment time you open a new terminal: - -```shell -cd -source .venv/bin/activate -``` - -You can find more information on using uv for environments -[here](https://docs.astral.sh/uv/pip/environments/#creating-a-virtual-environment). - ### Set up a virtual environment using pixi To initialize a new project with pixi in our project called `science`, execute: From b7a272820c54b206598e47a964452342273a0323 Mon Sep 17 00:00:00 2001 From: Madicken Munk Date: Wed, 14 May 2025 15:14:49 -0700 Subject: [PATCH 08/11] make venv directions generic --- content/how-tos/how-to-create-environments.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/content/how-tos/how-to-create-environments.md b/content/how-tos/how-to-create-environments.md index 38cd933..8d631a5 100644 --- a/content/how-tos/how-to-create-environments.md +++ b/content/how-tos/how-to-create-environments.md @@ -25,15 +25,16 @@ needed dependencies for a project. ### Set up a virtual environment with venv With venv to create environment associated with a project folder called `science`. +First, navigate into the `science` project folder. Next, execute: ```shell -python -m venv science +python -m venv ``` Start using it by activating it as follows: ```shell -source science/bin/activate +source .venv/bin/activate ``` You are now ready to install Scientific Python packages using `pip`! For example: @@ -53,7 +54,8 @@ pip install -r Remember to re-activate your environment every time you open a new terminal, using: ```shell -source science/bin/activate +cd +source .venv/bin/activate ``` You can find more information on using venv for packaging From 381fb25356e3256802e204adc5ed7da31e241aba Mon Sep 17 00:00:00 2001 From: Madicken Munk Date: Wed, 14 May 2025 15:21:09 -0700 Subject: [PATCH 09/11] Update pixi capitalization to refer to project name Co-authored-by: Matthew Feickert --- content/how-tos/how-to-create-environments.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/how-tos/how-to-create-environments.md b/content/how-tos/how-to-create-environments.md index 8d631a5..aec127c 100644 --- a/content/how-tos/how-to-create-environments.md +++ b/content/how-tos/how-to-create-environments.md @@ -173,9 +173,9 @@ mamba activate science You can find more information on using mamba in the [mamba user guide](https://mamba.readthedocs.io/en/latest/user_guide/mamba.html). -### Set up a virtual environment using pixi +### Set up a virtual environment using Pixi -To initialize a new project with pixi in our project called `science`, execute: +To initialize a new project with Pixi in our project called `science`, execute: ```shell pixi init @@ -201,7 +201,7 @@ the science folder, and execute: pixi shell ``` -This will drop you into the default environment for the pixi project, with all +This will drop you into the default environment for the Pixi project, with all dependencies in that environment accessible to you in that shell. A pixi project may have multiple environments defined in the `pixi.toml` file. To From 0563d47ef5d7ae28860cda498f2a29b7ffa34465 Mon Sep 17 00:00:00 2001 From: Madicken Munk Date: Wed, 14 May 2025 15:22:06 -0700 Subject: [PATCH 10/11] update pixi directions for clarity Co-authored-by: Matthew Feickert --- content/how-tos/how-to-create-environments.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/how-tos/how-to-create-environments.md b/content/how-tos/how-to-create-environments.md index aec127c..7e59f4a 100644 --- a/content/how-tos/how-to-create-environments.md +++ b/content/how-tos/how-to-create-environments.md @@ -182,13 +182,13 @@ pixi init ``` You are now ready to install Scientific Python packages as dependencies in this project! -From the science directory, execute: +From the `science` directory, execute: ```shell pixi add ipython numpy scipy ``` -To install dependencies from a file like `environment.yml`, use: +If you have an existing conda environment defined in an `environment.yml`, you can initialize a Pixi environment with the packages defined in it by executing: ```shell pixi init --import From ba8e25d9058ad99216c0eb1812332bd949aff869 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 14 May 2025 22:22:30 +0000 Subject: [PATCH 11/11] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- content/how-tos/how-to-create-environments.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/how-tos/how-to-create-environments.md b/content/how-tos/how-to-create-environments.md index 7e59f4a..5186d80 100644 --- a/content/how-tos/how-to-create-environments.md +++ b/content/how-tos/how-to-create-environments.md @@ -25,7 +25,7 @@ needed dependencies for a project. ### Set up a virtual environment with venv With venv to create environment associated with a project folder called `science`. -First, navigate into the `science` project folder. Next, execute: +First, navigate into the `science` project folder. Next, execute: ```shell python -m venv