Skip to content

Commit

Permalink
Docs: Recommend uv instead of flit executable
Browse files Browse the repository at this point in the history
Using `uv tool install .` has a few advantages over
`flit install --symlink --user`: maybe the biggest one is avoiding
complaints from modern pip about breaking system packages.
  • Loading branch information
sampsyo committed Jan 30, 2025
1 parent 46d91d5 commit cc5c926
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
15 changes: 6 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,15 @@ You will then have `brili`, which takes a Bril program as JSON on stdin and exec

### Text Format

The parser & pretty printer for the human-editable text form of Bril are written for Python 3.
To install them, you need [Flit][], so run this:
The parser & pretty printer for the human-editable text form of Bril are in Python.
A good way to install them is using [uv][].
[Install uv][uv-install], then go to the `bril-txt` directory and type:

$ pip install --user flit

Then, go to the `bril-txt` directory and use Flit to install symlinks to the tools:

$ flit install --symlink --user
$ uv tool install .

The tools are called `bril2json` and `bril2txt`.
They also take input on stdin and produce output on stdout.

[flit]: https://flit.readthedocs.io/


Tests
-----
Expand All @@ -61,3 +56,5 @@ Then run all the tests by typing `make test`.
[pip]: https://packaging.python.org/tutorials/installing-packages/
[cs6120]: https://www.cs.cornell.edu/courses/cs6120/2020fa/
[turnt]: https://github.com/cucapra/turnt
[uv]: https://docs.astral.sh/uv/
[uv-install]: https://docs.astral.sh/uv/getting-started/installation/
6 changes: 3 additions & 3 deletions docs/tools/brench.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ Set Up

Brench is a Python tool.
There is a `brench/` subdirectory in the Bril repository.
Get [Flit][] and then type:
Get [uv][] and then type:

$ flit install --symlink --user
$ uv tool install .

[flit]: https://flit.readthedocs.io/
[uv]: https://docs.astral.sh/uv/

Configure
---------
Expand Down
7 changes: 3 additions & 4 deletions docs/tools/text.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ Tools
-----

[The `bril-txt` parser & pretty printer][briltxt] are written in Python.
You can install them with [Flit][] by doing something like:
You can install them with [uv][] by doing something like:

$ pip install --user flit
$ cd bril-txt
$ flit install --symlink --user
$ uv tool install .

You'll now have tools called `bril2json` and `bril2txt`.
Both read from standard input and write to standard output.
Expand All @@ -50,5 +49,5 @@ You can try a "round trip" like this, for example:

The `bril2json` parser also supports a `-p` flag to include [source positions](../lang/syntax.md#source-positions).

[flit]: https://flit.readthedocs.io/
[briltxt]: https://github.com/sampsyo/bril/blob/main/bril-txt/briltxt.py
[uv]: https://docs.astral.sh/uv/

0 comments on commit cc5c926

Please sign in to comment.