Skip to content
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

⚡ Add uv installation instructions #2601

Merged
merged 4 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading