Trattoria involves 3 repos and some compiled code so getting up and running a dev environment for it is not as trivial as I would like it.
The following instructions are a first step towards making it easier for newcomers and future me to setup.
- Clone
trattoria
,trattoria-core
andtttr-toolbox
. - In
trattoria-core
modify the Cargo.toml file so that it picks uptttr-toolbox
not from crates.io but from a local folder on your computer. This will have to be undone before you push a new version to crates.io. - Create a Python venv and move into it.
- Assuming you are still inside the
trattoria-core
you should now runpoetry install
. This will install the required Python dependencies. - Now you can run
poetry run maturin develop
which will compile the rust components and make them available from within the venv. You can test this by opening a Python interpreter andimport trattoria_core
. - Without leaving the venv move to the
trattoria
repo. Open thepyproject.toml
file and comment out thetrattoria-core
dependency. This will temporatily disable the dependency on trattoria-core so that the next step doesnt attempt to fetchtrattoria-core
from pypi which we haven't up. - Now
poetry install
and finally check that everythin works by starting a REPL and and verifying you canimport trattoria
.
Reached this point you can start developing trattoria-core
and tttr-toolbox
and
test the code by calling it from Python using trattoria
. Remember that between
changes you will have to rerun step 5 above.