This is a minimal project template for Python projects that uses Poetry for dependency virtual environment management.
- (Optional) Download and install asdf on your machine to manage the version of Python and Poetry used in this project. Once done, run
asdf install
to install the versions specified in.tool-versions
. Alternatively, install them manually as described below: - Install Poetry on your machine
- Install Python 3 on your machine
- Create a virtual environment for your project using the command
poetry install
. This will install all the basic dependencies specified in yourpyproject.toml
file.
- You can use the following command to add dependencies to your Poetry env:
poetry add <package>
- You can also add dev dependencies by running:
poetry add <package> --group dev
- Update the
LICENSE
file - Update the
README.md
file - Change the project name, description, version, and authors in
pyproject.toml
- Finally, once you get to this point, you might want to delete the
poetry.lock
file and re-run the following command to update your virtual environment with your new changes:poetry install
- Add your own scripts and modules in
src/
- Add your own notebooks in
notebooks/
- Add your own examples of environment variables used in
.env.example
- Add your own unit tests in
tests/
- Double check that you have set up your virtual env correctly by running
poetry env info
- To open a shell inside your virtual env, run
poetry shell
- To run a command within your virtual env, prepend it with
poetry run
. For example:poetry run echo "hello from poetry env"
- If at any point you have added more dependencies and you want it to reflect in your
poetry.lock
file, you can runpoetry update
- To run your tests, run:
poetry run pytest .