This project uses Python 3.10. Remember to run below commands in the root directory of your project where the pyproject.toml
file is located. Here are the main elements you need to know to get started:
Note that for this the package venv is to be used.
In short, a virtual environment will help us manage an isolated version of python interpreter. And so too installed packages. In this way. Different project will not have to depends on the same packages installation and have to conflict. Read the link above explain and show it well.
docker compose up --build
# Create a virtual environment, navigate to your root directory and run:
python -m venv .venv
# Activate the environment, use:
source .venv/bin/activate
pip install -r requirements
- In a Python project managed with Poetry, dependencies are listed in a
pyproject.toml
file, make sure that[tool.poetry] name = "bloomsage-backend"
:
poetry install --no-root
To add additional dependencies/packages to your project, use:
- With
poetry
poetry add [dependencies/packages]
- With
pip
pip install [dependencies/packages]
- Once you have done with your session
# To export the requirements.txt
pip install -r requirements
poetry export -f requirements.txt --output requirements.txt --without-hashes --without=dev
# Deactivate the environment once done, use:
deactivate
- To start the server at http://0.0.0.0:8000
poe compose
- To check the type in python files
poe typecheck