Skip to content

Commit

Permalink
⚡ Add uv installation instructions (#2601)
Browse files Browse the repository at this point in the history
* add uv

* Update docs/source/installation.mdx

* Update docs/source/installation.mdx

* pypi -> PyPI

---------

Co-authored-by: Quentin Gallouédec <[email protected]>
Co-authored-by: Quentin Gallouédec <[email protected]>
  • Loading branch information
3 people authored Jan 21, 2025
1 parent b6a084c commit a5c88d6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
25 changes: 20 additions & 5 deletions docs/source/installation.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
# Installation
You can install TRL either from pypi or from source:
You can install TRL either from PyPI or from source:

## pypi
Install the library with pip:
## PyPI
Install the library with pip or [uv](https://docs.astral.sh/uv/):

<hfoptions id="install">
<hfoption id="uv">

uv is a fast Rust-based Python package and project manager. Refer to [Installation](https://docs.astral.sh/uv/getting-started/installation/) for installation instructions), .

```bash
uv pip install trl
```

</hfoption>
<hfoption id="pip">

```bash
pip install trl
```

### Source
</hfoption>
</hfoptions>

## Source
You can also install the latest version from source. First clone the repo and then run the installation with `pip`:

```bash
Expand All @@ -21,4 +36,4 @@ If you want the development install you can replace the pip install with the fol

```bash
pip install -e ".[dev]"
```
```
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
Simple check list for release from AllenNLP repo: https://github.com/allenai/allennlp/blob/master/setup.py
To create the package for pypi.
To create the package for PyPI.
0. Prerequisites:
- Dependencies:
Expand Down Expand Up @@ -50,7 +50,7 @@
For the sources, run: "python setup.py sdist"
You should now have a /dist directory with both .whl and .tar.gz source versions.
5. Check that everything looks correct by uploading the package to the pypi test server:
5. Check that everything looks correct by uploading the package to the PyPI test server:
twine upload dist/* -r pypitest --repository-url=https://test.pypi.org/legacy/
Expand All @@ -59,7 +59,7 @@
pip install -U tqdm
pip install -i https://testpypi.python.org/pypi evaluate
6. Upload the final version to actual pypi:
6. Upload the final version to actual PyPI:
twine upload dist/* -r pypi
7. Fill release notes in the tag in github once everything is looking hunky-dory.
Expand Down

0 comments on commit a5c88d6

Please sign in to comment.