|
Home
| https://python-poetry.org/ |
| Documentation | https://python-poetry.org/docs/ |
|
Introduction
Poetry is a tool for dependency management and packaging in Python.
| https://python-poetry.org/docs/ |
|
Basic usage
For the basic usage introduction we will be installing pendulum, a datetime library.
| https://python-poetry.org/docs/basic-usage/ |
|
Managing dependencies
Poetry supports specifying main dependencies in the project.dependencies section of your pyproject.toml according to PEP 621.
| https://python-poetry.org/docs/managing-dependencies/ |
|
Libraries
This chapter will tell you how to make your library installable through Poetry.
Versioning Poetry requires PEP 440-compliant versions for all projects.
While Poetry does not enforce any release convention, it used to encourage the use of semantic versioning within the scope of PEP 440 and supports version constraints that are especially suitable for semver.
Note As an example, 1.0.0-hotfix.1 is not compatible with PEP 440.
| https://python-poetry.org/docs/libraries/ |
|
Commands
You’ve already learned how to use the command-line interface to do some things.
| https://python-poetry.org/docs/cli/ |
|
Configuration
Poetry can be configured via the config command (see more about its usage here) or directly in the config.toml file that will be automatically created when you first run that command.
| https://python-poetry.org/docs/configuration/ |
|
Repositories
Poetry supports the use of PyPI and private repositories for discovery of packages as well as for publishing your projects.
By default, Poetry is configured to use the PyPI repository, for package installation and publishing.
So, when you add dependencies to your project, Poetry will assume they are available on PyPI.
This represents most cases and will likely be enough for most users.
Private Repository Example Installing from private package sources By default, Poetry discovers and installs packages from PyPI.
| https://python-poetry.org/docs/repositories/ |
|
Managing environments
Poetry makes project environment isolation one of its core features.
What this means is that it will always work isolated from your global Python installation.
| https://python-poetry.org/docs/managing-environments/ |
|
Dependency specification
Dependencies for a project can be specified in various forms, which depend on the type of the dependency and on the optional constraints that might be needed for it to be installed.
project.dependencies and tool.poetry.dependencies Prior Poetry 2.0, dependencies had to be declared in the tool.poetry.dependencies section of the pyproject.toml file.
[tool.poetry.dependencies] requests = "^2.13.0" With Poetry 2.0, you should consider using the project.dependencies section instead.
[project] # ...
| https://python-poetry.org/docs/dependency-specification/ |
|
Plugins
Poetry supports using and building plugins if you wish to alter or expand Poetry’s functionality with your own.
For example if your environment poses special requirements on the behaviour of Poetry which do not apply to the majority of its users or if you wish to accomplish something with Poetry in a way that is not desired by most users.
In these cases you could consider creating a plugin to handle your specific logic.
.
| https://python-poetry.org/docs/plugins/ |
|
The pyproject.toml file
In package mode, the only required fields are name and version (either in the project section or in the tool.poetry section).
| https://python-poetry.org/docs/pyproject/ |
|
Contributing to Poetry
First off, thanks for taking the time to contribute!
The following is a set of guidelines for contributing to Poetry on GitHub.
| https://python-poetry.org/docs/contributing/ |
|
Community
Badge For any projects using Poetry, you may add its official badge somewhere prominent like the README.
Markdown
[](https://python-poetry.org/) reStructuredText
..
| https://python-poetry.org/docs/community/ |
|
FAQ
Why is the dependency resolution process slow? While the dependency resolver at the heart of Poetry is highly optimized and should be fast enough for most cases, with certain sets of dependencies, it can take time to find a valid solution.
This is due to the fact that not all libraries on PyPI have properly declared their metadata and, as such, they are not available via the PyPI JSON API.
| https://python-poetry.org/docs/faq/ |
|
pre-commit hooks
pre-commit is a framework for building and running git hooks.
| https://python-poetry.org/docs/pre-commit-hooks/ |
|
Building extension modules
Building Extension Modules Warning While this feature has been around since almost the beginning of the Poetry project and has needed minimal changes, it is still considered unstable.
| https://python-poetry.org/docs/building-extension-modules/ |
|
2.3
Stable
Documentation for the latest,
stable, branch.
| https://python-poetry.org/docs/ |
|
main
Development
Documentation for the latest,
in-development, branch.
| https://python-poetry.org/docs/main/ |
| Blog | https://python-poetry.org/blog/ |
| History | https://python-poetry.org/history/ |
|
| https://github.com/python-poetry/poetry |
| Documentation | https://python-poetry.org/docs/ |
| Blog | https://python-poetry.org/blog/ |
| History | https://python-poetry.org/history/ |
|
| https://github.com/python-poetry/poetry |
| Releases | https://python-poetry.org/blog/category/releases/ |
|
2.x
| https://python-poetry.org/blog/tag/2.x/ |
|
2.0
| https://python-poetry.org/blog/tag/2.0/ |
| official installer | https://python-poetry.org/docs/#installation |
| # | https://python-poetry.org/blog/announcing-poetry-2.0.0#highlights |
| # | https://python-poetry.org/blog/announcing-poetry-2.0.0#supporting-the-project-section-in-pyprojecttoml-pep-621 |
| PEP 621 | https://peps.python.org/pep-0621/ |
| pyproject.toml specification | https://packaging.python.org/en/latest/specifications/pyproject-toml/#pyproject-toml-spec |
| documentation | https://python-poetry.org/docs/pyproject/ |
| project.dependencies and tool.poetry.dependencies | https://python-poetry.org/docs/dependency-specification/#projectdependencies-and-toolpoetrydependencies |
| # | https://python-poetry.org/blog/announcing-poetry-2.0.0#project-plugins-and-forcing-a-minimum-poetry-version |
| project plugins | https://python-poetry.org/docs/plugins/#project-plugins |
| # | https://python-poetry.org/blog/announcing-poetry-2.0.0#locking-resulting-markers-and-groups |
| # | https://python-poetry.org/blog/announcing-poetry-2.0.0#breaking-changes-and-removals |
| # | https://python-poetry.org/blog/announcing-poetry-2.0.0#poetry-export-and-poetry-shell-only-available-via-plugins |
| Using plugin | https://python-poetry.org/docs/plugins/#using-plugins |
| Activating the environment | https://python-poetry.org/docs/managing-environments/#activating-the-environment |
| # | https://python-poetry.org/blog/announcing-poetry-2.0.0#poetry-lock-defaults-to---no-update |
| # | https://python-poetry.org/blog/announcing-poetry-2.0.0#poetry-add---optional-requires-an-extra |
| # | https://python-poetry.org/blog/announcing-poetry-2.0.0#--directory-c-actually-switches-the-directory |
| # | https://python-poetry.org/blog/announcing-poetry-2.0.0#consistent-include-behavior |
| # | https://python-poetry.org/blog/announcing-poetry-2.0.0#changed-config-settings |
| Migrate outdated configs | https://python-poetry.org/docs/configuration/#migrate-outdated-configs |
| # | https://python-poetry.org/blog/announcing-poetry-2.0.0#changelog |
| # | https://python-poetry.org/blog/announcing-poetry-2.0.0#added |
| #9135 | https://github.com/python-poetry/poetry/pull/9135 |
| #9917 | https://github.com/python-poetry/poetry/pull/9917 |
| #9547 | https://github.com/python-poetry/poetry/pull/9547 |
| #9427 | https://github.com/python-poetry/poetry/pull/9427 |
| #9064 | https://github.com/python-poetry/poetry/pull/9064 |
| #9067 | https://github.com/python-poetry/poetry/pull/9067 |
| #9101 | https://github.com/python-poetry/poetry/pull/9101 |
| #9101 | https://github.com/python-poetry/poetry/pull/9101 |
| #9150 | https://github.com/python-poetry/poetry/pull/9150 |
| #9132 | https://github.com/python-poetry/poetry/pull/9132 |
| #9422 | https://github.com/python-poetry/poetry/pull/9422 |
| #9547 | https://github.com/python-poetry/poetry/pull/9547 |
| #9744 | https://github.com/python-poetry/poetry/pull/9744 |
| #9763 | https://github.com/python-poetry/poetry/pull/9763 |
| #9814 | https://github.com/python-poetry/poetry/pull/9814 |
| #9830 | https://github.com/python-poetry/poetry/pull/9830 |
| #9831 | https://github.com/python-poetry/poetry/pull/9831 |
| #9748 | https://github.com/python-poetry/poetry/pull/9748 |
| #9553 | https://github.com/python-poetry/poetry/pull/9553 |
| #9801 | https://github.com/python-poetry/poetry/pull/9801 |
| # | https://python-poetry.org/blog/announcing-poetry-2.0.0#changed |
| #9327 | https://github.com/python-poetry/poetry/pull/9327 |
| #5980 | https://github.com/python-poetry/poetry/pull/5980 |
| #9763 | https://github.com/python-poetry/poetry/pull/9763 |
| #9135 | https://github.com/python-poetry/poetry/pull/9135 |
| #9831 | https://github.com/python-poetry/poetry/pull/9831 |
| #9692 | https://github.com/python-poetry/poetry/pull/9692 |
| #9787 | https://github.com/python-poetry/poetry/pull/9787 |
| #9795 | https://github.com/python-poetry/poetry/pull/9795 |
| #9786 | https://github.com/python-poetry/poetry/pull/9786 |
| #9135 | https://github.com/python-poetry/poetry/pull/9135 |
| #9801 | https://github.com/python-poetry/poetry/pull/9801 |
| #9333 | https://github.com/python-poetry/poetry/pull/9333 |
| #8916 | https://github.com/python-poetry/poetry/pull/8916 |
| #9094 | https://github.com/python-poetry/poetry/pull/9094 |
| #9168 | https://github.com/python-poetry/poetry/pull/9168 |
| #9227 | https://github.com/python-poetry/poetry/pull/9227 |
| #9078 | https://github.com/python-poetry/poetry/pull/9078 |
| #9099 | https://github.com/python-poetry/poetry/pull/9099 |
| #9345 | https://github.com/python-poetry/poetry/pull/9345 |
| #9558 | https://github.com/python-poetry/poetry/pull/9558 |
| #9812 | https://github.com/python-poetry/poetry/pull/9812 |
| #9392 | https://github.com/python-poetry/poetry/pull/9392 |
| #9331 | https://github.com/python-poetry/poetry/pull/9331 |
| #9705 | https://github.com/python-poetry/poetry/pull/9705 |
| #9732 | https://github.com/python-poetry/poetry/pull/9732 |
| #9851 | https://github.com/python-poetry/poetry/pull/9851 |
| #9701 | https://github.com/python-poetry/poetry/pull/9701 |
| #9651 | https://github.com/python-poetry/poetry/pull/9651 |
| #9750 | https://github.com/python-poetry/poetry/pull/9750 |
| #9870 | https://github.com/python-poetry/poetry/pull/9870 |
| #9918 | https://github.com/python-poetry/poetry/pull/9918 |
| #9108 | https://github.com/python-poetry/poetry/pull/9108 |
| #9167 | https://github.com/python-poetry/poetry/pull/9167 |
| #9283 | https://github.com/python-poetry/poetry/pull/9283 |
| #9748 | https://github.com/python-poetry/poetry/pull/9748 |
| # | https://python-poetry.org/blog/announcing-poetry-2.0.0#fixed |
| #7028 | https://github.com/python-poetry/poetry/pull/7028 |
| #9118 | https://github.com/python-poetry/poetry/pull/9118 |
| #9189 | https://github.com/python-poetry/poetry/pull/9189 |
| #9202 | https://github.com/python-poetry/poetry/pull/9202 |
| #9277 | https://github.com/python-poetry/poetry/pull/9277 |
| #9286 | https://github.com/python-poetry/poetry/pull/9286 |
| #9433 | https://github.com/python-poetry/poetry/pull/9433 |
| #9345 | https://github.com/python-poetry/poetry/pull/9345 |
| #9504 | https://github.com/python-poetry/poetry/pull/9504 |
| #9166 | https://github.com/python-poetry/poetry/pull/9166 |
| #9603 | https://github.com/python-poetry/poetry/pull/9603 |
| #8893 | https://github.com/python-poetry/poetry/pull/8893 |
| #9278 | https://github.com/python-poetry/poetry/pull/9278 |
| #9468 | https://github.com/python-poetry/poetry/pull/9468 |
| #9658 | https://github.com/python-poetry/poetry/pull/9658 |
| #9723 | https://github.com/python-poetry/poetry/pull/9723 |
| #9700 | https://github.com/python-poetry/poetry/pull/9700 |
| #9007 | https://github.com/python-poetry/poetry/pull/9007 |
| #9770 | https://github.com/python-poetry/poetry/pull/9770 |
| #9815 | https://github.com/python-poetry/poetry/pull/9815 |
| #9816 | https://github.com/python-poetry/poetry/pull/9816 |
| #9849 | https://github.com/python-poetry/poetry/pull/9849 |
| #9505 | https://github.com/python-poetry/poetry/pull/9505 |
| #9850 | https://github.com/python-poetry/poetry/pull/9850 |
| #9798 | https://github.com/python-poetry/poetry/pull/9798 |
| #9861 | https://github.com/python-poetry/poetry/pull/9861 |
| #9870 | https://github.com/python-poetry/poetry/pull/9870 |
| #9475 | https://github.com/python-poetry/poetry/pull/9475 |
| #9863 | https://github.com/python-poetry/poetry/pull/9863 |
| #9899 | https://github.com/python-poetry/poetry/pull/9899 |
| # | https://python-poetry.org/blog/announcing-poetry-2.0.0#docs |
| #9726 | https://github.com/python-poetry/poetry/pull/9726 |
| #9716 | https://github.com/python-poetry/poetry/pull/9716 |
| #9734 | https://github.com/python-poetry/poetry/pull/9734 |
| #9783 | https://github.com/python-poetry/poetry/pull/9783 |
| #9864 | https://github.com/python-poetry/poetry/pull/9864 |
| 2.0.0 | https://github.com/python-poetry/poetry-core/releases/tag/2.0.0 |
| # | https://python-poetry.org/blog/announcing-poetry-2.0.0#poetry-core-200httpsgithubcompython-poetrypoetry-corereleasestag200 |
| #722 | https://github.com/python-poetry/poetry-core/pull/722 |
| #722 | https://github.com/python-poetry/poetry-core/pull/722 |
| #710 | https://github.com/python-poetry/poetry-core/pull/710 |
| #766 | https://github.com/python-poetry/poetry-core/pull/766 |
| #781 | https://github.com/python-poetry/poetry-core/pull/781 |
| #707 | https://github.com/python-poetry/poetry-core/pull/707 |
| #770 | https://github.com/python-poetry/poetry-core/pull/770 |
| #708 | https://github.com/python-poetry/poetry-core/pull/708 |
| #702 | https://github.com/python-poetry/poetry-core/pull/702 |
| #769 | https://github.com/python-poetry/poetry-core/pull/769 |
| #754 | https://github.com/python-poetry/poetry-core/pull/754 |
| #726 | https://github.com/python-poetry/poetry-core/pull/726 |
| #762 | https://github.com/python-poetry/poetry-core/pull/762 |
| #765 | https://github.com/python-poetry/poetry-core/pull/765 |
| #775 | https://github.com/python-poetry/poetry-core/pull/775 |
| #517 | https://github.com/python-poetry/poetry-core/pull/517 |
| #791 | https://github.com/python-poetry/poetry-core/pull/791 |
|
GitHub
| https://github.com/python-poetry |
|
Discord
| https://discord.com/invite/awxPgve |
|
Introduction
| https://python-poetry.org/docs/ |
|
Basic usage
| https://python-poetry.org/docs/basic-usage/ |
|
Managing dependencies
| https://python-poetry.org/docs/managing-dependencies/ |
|
Libraries
| https://python-poetry.org/docs/libraries/ |
|
Commands
| https://python-poetry.org/docs/cli/ |
|
Configuration
| https://python-poetry.org/docs/configuration/ |
|
Repositories
| https://python-poetry.org/docs/repositories/ |
|
Managing environments
| https://python-poetry.org/docs/managing-environments/ |
|
Dependency specification
| https://python-poetry.org/docs/dependency-specification/ |
|
Plugins
| https://python-poetry.org/docs/plugins/ |
|
The pyproject.toml file
| https://python-poetry.org/docs/pyproject/ |
|
Contributing to Poetry
| https://python-poetry.org/docs/contributing/ |
|
Community
| https://python-poetry.org/docs/community/ |
|
FAQ
| https://python-poetry.org/docs/faq/ |
|
pre-commit hooks
| https://python-poetry.org/docs/pre-commit-hooks/ |
|
Building extension modules
| https://python-poetry.org/docs/building-extension-modules/ |
|
Project
| https://github.com/python-poetry/poetry |
|
Issues
| https://github.com/python-poetry/poetry/issues |
|
Discussions
| https://github.com/python-poetry/poetry/discussions |
|
poetry-core
| https://github.com/python-poetry/poetry-core |
|
install.python-poetry.org
| https://github.com/python-poetry/install.python-poetry.org |
|
Bundle plugin
| https://github.com/python-poetry/poetry-plugin-bundle |
|
Export plugin
| https://github.com/python-poetry/poetry-plugin-export |
|
| https://vercel.com?utm_source=python-poetry&utm_campaign=oss |