- Poetry
- Python >= 3.10
poetry run pylox # To run in REPL mode
poetry run pylox <script> # To execute a script
- [ ] Interpret and print expression in the REPL (Chapter 8)
poetry shell
pre-commit install
Poetry does not create a virtualenv, so we need to create one ourselves and ask Poetry to install the dependencies in it:
python3 -m venv .venv
. .venv/bin/activate
poetry install
Ruff is not (yet) packaged in GNU Guix, so we need to build it
ourselves. That’s what the dependencies in manifest.scm
are for.
To build Ruff run the following:
# Activate the Guix shell and source the venv
guix shell
. .venv/bin/activate
# If Ruff has been installed by Poetry
pip uninstall ruff
# Install Ruff
CC=gcc pip install --no-binary :all: ruff
Once installed in the virtualenv, you don’t need to use guix shell
to do your development.
Pre-commit tries to install Ruff from pip. Since this does not work in
Guix, load you virtualenv, run pre-commit
, find the path to its ruff
installation and replace it with a symlink to your newly built Ruff