Conda Poetry
This is a demonstration of how Conda and Poetry can be used in a Python project for dev dependency management and production deployment.
Requirements
How To Run this Demonstration
- From this project directory, run
conda env create -f environment.yml
- Activate the environment:
conda activate condapoetry
- Run the app
uvicorn condapoetry.main:app --reload
and go to http://localhost:8000/
How To Create a Conda/Poetry Environment
-
Create a conda environemnt:
conda create -n
python=3.8 -
Activate the environemnt:
conda activate
-
Create a poetry project:
poetry new
-
Add dependencies:
poetry add
-
Export project dependencies to conda environment files:
conda env export > environment.yml conda list --export > anaconda-deps.ana
For an actual project, this step could be done with a pre-commit hook.