question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: poetry deploy

See original GitHub issue
  • I have searched the issues of this repo and believe that this is not a duplicate.

poetry deploy

What I am looking for is a way to generate a poetry.lock and my project wheel and then deploy them without needing to have any of the source/pyproject.tom or anything else available. Preferably into a venv of my choosing, or a default created one.

Running poetry build with a --with-lock that copies the existing poetry.lock, renames it to be versioned and adds the hash for the newly built wheel, and then places that in the dist folder.

Then when a user wants to deploy, they specifically do:

poetry deploy myapp-0.1.0-poetry.lock

And poetry would create a new virtualenv (or update it) and installs the application with the locked dependencies, verifying the wheel file (which has to exist in the same folder as the lock file, or maybe add a --wheel-path to allow an alternate location to find wheels, default to next to .lock fall back to PyPI).

Either way, the end result should be a virtualenv that has all of the dependencies + package installed as set in the lock file without needing to have the source code available.

This would be great for doing deployments inside of Docker containers, or Heroku build-packs so that you don’t need to ship the full source, just the lock file and a wheel.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:62
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

43reactions
sdispatercommented, Nov 13, 2019

The bundle command mentioned by @hynek is definitely on my radar but will likely be implemented after the 1.0 release.

31reactions
hynekcommented, Nov 30, 2018

The lack of something like this is pretty much the only reason I cannot put poetry into production.

As of now, if you’re in an activated virtualenv and call poetry install, it does exactly what you want to.

However it’s impossible to pass it as a parameter or env variable which is a problem on build servers.

A cheap win would be something like TARGET_VENV=/app poetry install but I understand that that’s rather clunky, especially in the context of the whole design.

I kinda like the idea of poetry deploy but I’d rather call it poetry bundle or something like that and make it pluggable. Imagine being able to call: poetry bundle --type venv /app or poetry bundle --type shiv Fooo.shiv or even poetry bundle --type pyinstaller Foo.exe – what do I know. There’s many ways to bundle a Python application.


P.S. requirements.txt exports are a thing as of #675 but since I’d want to go all-in on poetry it means I have not setup.py so it doesn’t help me when deploying.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Commands | Documentation | Poetry - Python dependency ...
Commands You've already learned how to use the command-line interface to do some things. This chapter documents all the available commands.
Read more >
Dependency Management With Python Poetry
A dependency manager like Python Poetry helps you specify, install, and resolve external packages in your projects.
Read more >
Python Poetry, finally easy build and deploy packages - Medium
Python Poetry, finally easy build and deploy packages ... poetry add requestsUsing version ^2.24.0 for requestsUpdating dependencies
Read more >
How To Install Poetry to Manage Python Dependencies on ...
In this tutorial you will install Poetry using the official installation ... Most Python libraries only require version 3.8 at a minimum.
Read more >
PyPI packages in the Package Registry - GitLab Docs
Deploy the Helm chart · Deployment options ... Feature flags · macOS setup · Runner Operator on OpenShift ... Merge request approvals.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found