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-coreandtttr-toolbox. - In
trattoria-coremodify the Cargo.toml file so that it picks uptttr-toolboxnot 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-coreyou should now runpoetry install. This will install the required Python dependencies. - Now you can run
poetry run maturin developwhich 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
trattoriarepo. Open thepyproject.tomlfile and comment out thetrattoria-coredependency. This will temporatily disable the dependency on trattoria-core so that the next step doesnt attempt to fetchtrattoria-corefrom pypi which we haven't up. - Now
poetry installand 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.