Poetry and pip can be used to install Python packages, and both can parse information in pyproject.toml located in the root directory of the Python package. It is desirable to construct a Python package that supports both poetry install as well as pip install, since developers will probably prefer to use poetry whereas end users will prefer to use pip. Support for both Poetry and pip can be facilitated with a few caveats:
piprecognises the dependencies in[tool.poetry.dependencies], but it does not (yet) recognise group dependencies. This means that if you usepipto install the package, you may need to install additional packages in order to run tests (pytest) and compile documentation (sphinx, etc.).- If you are working with the source code of a Python package directly (rather than installing the package as a dependency of another package), note that
pip installwill not copy any compiled shared library objects into the source directory of the package (which by convention is usually named after the package). Instead, you should copy the library file manually into the source directory. This is only relevant if the package uses a build script to compile code usingCythonor similar.
Both Poetry and pip continue to undergo active development so it is foreseeable that the gap between Poetry and pip will continue to close; hence I will endevour to keep this gist up-to-date.