ehmatthes / django-simple-deploy

A reusable Django app that configures your project for deployment
BSD 3-Clause "New" or "Revised" License
307 stars 26 forks source link

Support Poetry on Fly #203

Closed ehmatthes closed 1 year ago

ehmatthes commented 1 year ago

I believe fly deployments fail on the restructure_pkg_man branch right now, because we no longer generate a requirements.txt file in simple_deploy when using Poetry, and the fly deploy script is doing nothing to respond to poetry specifically.

ehmatthes commented 1 year ago

Adding poetry packages for remote use only

ehmatthes commented 1 year ago

Poetry experiment

Quick demo for trying out poetry installation commands.

$ mkdir poetry_install_test && cd poetry_install_test
$ python3 -m venv venv
$ source venv/bin/activate
$ poetry init
$ poetry add django
# Modify pyproject.toml to have a group "deploy", with "optional" property.
# Add gunicorn and dj-database-url to this group.
$ poetry install
# should not install gunicorn, dj-database-url
$ poetry install --with deploy
# should install gunicorn, dj-database-url

I'm not entirely sure how all of this impacts the poetry.lock file, ie can you install the optional group without updating the lock file?

ehmatthes commented 1 year ago

pyproject.toml

This is what pyproject.toml should look like:

...
[tool.poetry.group.deploy]
optional = true

[tool.poetry.group.deploy.dependencies]
gunicorn = "*"
dj-database-url = "*"
ehmatthes commented 1 year ago

Other tasks

ehmatthes commented 1 year ago

Modify dockerfile to use Poetry

ehmatthes commented 1 year ago

This feels great. :)