Poetry streamlines the awkward job of turning a Python project into a distributable package. It separates the distribution package directory from the Python package inside it, then provides commands for building and publishing. section 8.10
A typical workflow is:
- Create a project with poetry new mypackage. section 8.10
- Place the package code inside the generated project structure. section 8.10
- Build an archive with poetry build, then upload it with poetry publish. section 8.10
Build and publish a package
From a Unix shell: poetry new mypackage; cd mypackage; copy the existing code into mypackage; poetry build; poetry publish. Publishing to PyPI requires an account, and a unique project name. section 8.10
$ poetry new mypackage #1 $ cd mypackage #2 $ cp -R ~/mypackage-code/* mypackage #3 $ poetry build #4 $ poetry publish #5
Browse the complete command sequence from project creation through publication. section 8.10
