Skip to content

Commit

Permalink
Mention uv for the initial install in CONTRIBUTING.md (#13595)
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam authored Mar 8, 2025
1 parent 01ed309 commit 0cdb5e9
Showing 1 changed file with 55 additions and 25 deletions.
80 changes: 55 additions & 25 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,37 +50,67 @@ please refer to this

Note that some tests require extra setup steps to install the required dependencies.

### Linux/Mac OS/WSL
<table>
<tr>
<td>Linux / macOS / WSL</td>
<td>

On Linux and macOS, you will be able to run the full test suite on Python
3.9-3.12.
To install the necessary requirements, run the following commands from a
terminal window:

```bash
$ python3 -m venv .venv
$ source .venv/bin/activate
(.venv)$ pip install -U pip
(.venv)$ pip install -r requirements-tests.txt
```

</td>
</tr>
<tr><!-- disables zebra striping --></tr>
<tr>
<td>Windows</td>
<td>

Run the following commands from a Windows terminal to install all requirements:

```powershell
> python -m venv .venv
> .venv\Scripts\activate
(.venv) > pip install -U pip
(.venv) > pip install -r requirements-tests.txt
```

To be able to run pytype tests, you'll also need to install it manually
as it's currently excluded from the requirements file:

On Linux and Mac OS, you will be able to run the full test suite on Python
3.9-3.12.
To install the necessary requirements, run the following commands from a
terminal window:
```powershell
(.venv) > pip install -U pytype
```

```bash
$ python3 -m venv .venv
$ source .venv/bin/activate
(.venv)$ pip install -U pip
(.venv)$ pip install -r requirements-tests.txt
```
</td>
</tr>
<tr><!-- disables zebra striping --></tr>
<tr>
<td>Using uv</td>
<td>

### Windows
If you already have [uv](https://docs.astral.sh/uv/getting-started/installation/) installed, you can simply replace the commands above with:

Run the following commands from a Windows terminal to install all requirements:
```shell
uv venv
uv pip install -r requirements-tests.txt
```

```powershell
> python -m venv .venv
> .venv\Scripts\activate
(.venv) > pip install -U pip
(.venv) > pip install -r "requirements-tests.txt"
```
```shell
uv pip install -U pytype
```

To be able to run pytype tests, you'll also need to install it manually
as it's currently excluded from the requirements file:

```powershell
(.venv) > pip install -U pytype
```
</td>
</tr>
</table>

## Code formatting

Expand Down

0 comments on commit 0cdb5e9

Please sign in to comment.