Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Python Packaging and Distribution

Python Packaging and Distribution

Grand Rapids Python Users Group presentation on Poetry and pipx.

https://github.com/GRPUG/grpug-poetry-demo

Jace Browning

November 18, 2019
Tweet

More Decks by Jace Browning

Other Decks in Programming

Transcript

  1. virtualenv +
    pip + pip-tools +
    twine

    View full-size slide

  2. PEP 518


    [build-system]
    requires = ["setuptools", "wheel"]

    View full-size slide

  3. Poetry is a...



    [build-system]
    requires = ["poetry>=0.12"]
    build-backend = "poetry.masonry.api"

    View full-size slide

  4. Poetry does not...



    View full-size slide

  5. Why not...



    View full-size slide

  6. Version
    Specification

    View full-size slide

  7. { git = “https://github.com/owner/repo”,
    rev = “3846693f2daea2a9f156aba10512161d3a7ed5f6” }

    View full-size slide

  8. { git = “https://github.com/owner/repo”,
    rev = “v1.0” }

    View full-size slide

  9. { git = “https://github.com/owner/repo”,
    rev = “develop” }

    View full-size slide

  10. { path = “../my/local/package” }

    View full-size slide

  11. Generic
    Commands

    View full-size slide

  12. $ poetry new

    View full-size slide

  13. $ poetry init

    View full-size slide

  14. $ poetry add

    View full-size slide

  15. $ poetry add --dev

    View full-size slide

  16. $ poetry lock

    View full-size slide

  17. $ poetry show --tree

    View full-size slide

  18. $ poetry run

    View full-size slide

  19. Packaging
    Commands

    View full-size slide

  20. $ poetry build

    View full-size slide

  21. $ poetry publish

    View full-size slide

  22. $ poetry config http-basic.pypi

    View full-size slide

  23. https://pypi.org/manage/account/token/

    View full-size slide

  24. $ poetry config pypi-token.pypi

    View full-size slide

  25. pip + virtualenv

    View full-size slide

  26. Why not...



    View full-size slide

  27. Installation
    Commands

    View full-size slide

  28. $ pipx install

    View full-size slide

  29. $ pipx upgrade

    View full-size slide