Skip to content

Commit

Permalink
πŸ“ Update virtual environment setup with uv
Browse files Browse the repository at this point in the history
  • Loading branch information
yezz123 committed Feb 19, 2024
1 parent 7347b01 commit d9e4836
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,22 @@ First, you might want to see the basic ways to
If you already cloned the repository and you know that you need to deep dive
into the code, here is a guideline to set up your environment:

### Virtual environment with `venv`
### Virtual environment with `uv`

You can create a virtual environment in a directory using Python's `venv`
You can create a virtual environment in a directory using Python's [`uv`](https://github.com/astral-sh/uv)
module:

<div class="termy">

```console
python -m venv env
pip install uv

uv venv
```

</div>

That will create a directory `./env/` with the python binaries and then you will
That will create a directory `.venv` with the python binaries and then you will
be able to install packages for that isolated environment.

### Activate the environment
Expand All @@ -33,7 +35,7 @@ Activate the new environment with:
<div class="termy">

```console
$ source ./env/bin/activate
$ source ./.venv/bin/activate
```

</div>
Expand All @@ -43,7 +45,7 @@ Activate the new environment with:
<div class="termy">

```console
$ .\env\Scripts\Activate.ps1
$ .\.venv\Scripts\Activate.ps1
```

</div>
Expand All @@ -55,7 +57,7 @@ Activate the new environment with:
<div class="termy">

```console
$ source ./env/Scripts/activate
$ source ./.venv/Scripts/activate
```

</div>
Expand All @@ -82,7 +84,7 @@ To check it worked, use:

</div>

If it shows the `pip` binary at `env/bin/pip` then it worked. πŸŽ‰
If it shows the `pip` binary at `venv/bin/pip` then it worked. πŸŽ‰

!!! tip

Expand All @@ -98,7 +100,7 @@ After activating the environment as described above, Now lets install all the pa
<div class="termy">

```console
$ pip install -r requirements/all.txt
$ uv pip install -r requirements/all.txt

---> 100%
```
Expand Down

0 comments on commit d9e4836

Please sign in to comment.