-
Notifications
You must be signed in to change notification settings - Fork 932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tools comparison tables #1196
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,205 @@ | ||
=========================== | ||
Packaging tools comparisons | ||
=========================== | ||
|
||
.. contents:: | ||
:local: | ||
|
||
|
||
Use cases | ||
========= | ||
|
||
.. csv-table:: | ||
:align: left | ||
:header-rows: 1 | ||
:stub-columns: 1 | ||
|
||
,Install Python,Install packages,Build distributions,Upload distributions,Manage virtual environments,Lock files | ||
build,no,no,yes,no,no,no | ||
Flit,no,yes,yes,yes,yes,yes | ||
Hatch,no,yes,yes,yes,yes,no | ||
PDM,no,yes,yes,yes,yes,yes | ||
pip,no,yes,yes,no,no,yes | ||
pip-tools,no,yes,no,no,no,yes | ||
Pipenv,no,yes,no,no,yes,yes | ||
pipx,no,yes,no,no,no,no | ||
Poetry,no,yes,yes,yes,yes,yes | ||
pyenv,yes,no,no,no,no,no | ||
Pyflow,yes,yes,yes,yes,yes,yes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would not mention Pyflow here. It is unmaintained. |
||
setuptools,no,yes,yes,no,no,no | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe that setuptools' support for installing packages is essentially what powers |
||
twine,no,no,no,yes,no,no | ||
venv,no,no,no,no,yes,no | ||
virtualenv,no,no,no,no,yes,no | ||
virtualenvwrapper,no,no,no,no,yes,no | ||
wheel,no,no,yes,no,no,no | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What are you referring to with the “yes” here? You can of course assemble a wheel “by hand” using |
||
|
||
Build back-ends are not listed here, but they are in a dedicated section below. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You did list Flit, PDM, ... |
||
|
||
|
||
Comparisons | ||
=========== | ||
|
||
Development workflow tools | ||
-------------------------- | ||
|
||
.. csv-table:: | ||
:align: left | ||
:header-rows: 1 | ||
:stub-columns: 1 | ||
|
||
,``[build-system]`` (PEP-517),Build,Upload,Env,Interchangeable build back-end,Plugins,Lock file | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you mean by “ As said above, I'd remove Pyflow from this table; then this column won't be useful anymore since all of the other backends listed support PEP 517. I'd also expand “Env” (“Manage environments”?) and add a note to explain what “Interchangeable build back-end” means. |
||
Flit,yes,yes,yes,no,no,no,no | ||
Hatch,yes,yes,yes,yes,yes,yes,no | ||
PDM,yes,yes,yes,yes,yes,yes,yes | ||
Poetry,yes,yes,yes,yes,no,yes,yes | ||
Pyflow,no,yes,yes,yes,no,no,yes | ||
|
||
See also build back-end features in dedicated section. | ||
|
||
There is no standard for lock files. | ||
|
||
|
||
Install Python interpreters | ||
--------------------------- | ||
|
||
.. csv-table:: | ||
:align: left | ||
:header-rows: 1 | ||
:stub-columns: 1 | ||
|
||
,Install Python interpreters | ||
pyenv,yes | ||
Pyflow,yes | ||
|
||
|
||
Install packages | ||
---------------- | ||
|
||
.. csv-table:: | ||
:align: left | ||
:header-rows: 1 | ||
:stub-columns: 1 | ||
|
||
,Dependency resolution,Editable | ||
pip,yes,yes | ||
pip-tools,yes,yes | ||
Pipenv,yes,yes | ||
pipx,yes,no | ||
|
||
``pipx`` is intended to be used to install standalone applications | ||
rather than to install packages in a virtual environment. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since you mention the special purpose of |
||
|
||
|
||
Build distributions | ||
------------------- | ||
|
||
These tools are also called "*build front-ends*". | ||
|
||
.. csv-table:: | ||
:align: left | ||
:header-rows: 1 | ||
:stub-columns: 1 | ||
|
||
,``[build-system]`` (PEP-517),sdist,wheel | ||
build,yes,yes,yes | ||
pip,yes,no,yes | ||
wheel,no,no,yes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same question as above about |
||
"dev workflow tools (Hatch, Flit, PDM, Poetry, etc.)",yes,yes,yes | ||
|
||
|
||
Build back-ends | ||
--------------- | ||
|
||
.. csv-table:: | ||
:align: left | ||
:header-rows: 1 | ||
:stub-columns: 1 | ||
|
||
,``[build-system]`` (PEP-517),``[project]`` (PEP-621),Editable installation (PEP-660),Extensions configuration | ||
``enscons``,yes,yes,yes,*SCONS* | ||
``flit-core``,yes,yes,yes,no | ||
``hatchling``,yes,yes,yes,via plug-ins | ||
``maturin``,yes,yes,yes,*Cargo* (*Rust*) | ||
``meson-python``,yes,yes,yes,*Meson* | ||
``pdm-backend``,yes,yes,yes,no | ||
``poetry-core``,yes,no,yes,``build.py`` [#]_ | ||
``pymsbuild``,yes,no,no,``_msbuild.py`` | ||
``scikit-build-core``,yes,yes,no,*CMake* | ||
``setuptools``,yes,yes,yes,``setup.py`` | ||
``trampolim``,yes,yes,no,no | ||
``whey``,yes,yes,yes,no | ||
|
||
.. [#] Poetry has an undocumented feature allowing | ||
the customization of the build process via a ``build.py`` file, | ||
which indirectly allows the handling of C extensions | ||
(this is comparable to ``setuptools`` own `setup.py`). | ||
|
||
|
||
Upload distributions | ||
-------------------- | ||
|
||
.. csv-table:: | ||
:align: left | ||
:header-rows: 1 | ||
:stub-columns: 1 | ||
|
||
,Upload | ||
Flit,yes | ||
Hatch,yes | ||
PDM,yes | ||
Poetry,yes | ||
twine,yes | ||
|
||
|
||
Manage virtual environments | ||
--------------------------- | ||
|
||
.. csv-table:: | ||
:align: left | ||
:header-rows: 1 | ||
:stub-columns: 1 | ||
|
||
,For any Python interpreter,Description in file | ||
Hatch,yes,yes [#]_ | ||
nox,yes,yes [#]_ | ||
PDM,yes,no | ||
Pipenv,yes,no | ||
Poetry,yes,no | ||
tox,yes,yes [#]_ | ||
venv,no,no | ||
virtualenv,yes,no | ||
virtualenvwrapper,yes,no | ||
|
||
Unlike the other tools presented in this section, | ||
``venv`` is part of Python's own standard library, | ||
it should be always available without having to be installed separately. | ||
But note that some Linux distributions (e.g. Debian, Ubuntu, and derivatives) | ||
made the decision to package ``venv`` separately from the rest of the Python distribution | ||
and consequently it might be necessary to install ``venv`` explicitly | ||
(typically with a command such as ``apt install python3-venv``, | ||
consult the documentation of the Linux distribution for exact details). | ||
|
||
.. [#] ``[tool.hatch.envs]`` section of ``pyproject.toml`` | ||
.. [#] ``noxfile.py`` | ||
.. [#] ``tox.ini`` | ||
|
||
|
||
Lock files | ||
---------- | ||
|
||
There is no PyPA standard for the concept of "*lock files*". | ||
There is some kind of a *de facto* convention | ||
around *pip*'s ``requirements.txt`` file format | ||
but it can not be considered a good enough *lock file* format. | ||
|
||
.. csv-table:: | ||
:align: left | ||
:header-rows: 1 | ||
:stub-columns: 1 | ||
|
||
,Format | ||
pip,``requirements.txt`` | ||
pip-tools,``requirements.txt`` | ||
Pipenv,``Pipfile.lock`` | ||
poetry,``poetry.lock`` | ||
PDM,``pdm.lock`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not believe Flit has lock file support.
Also, I find the "Install Packages" column a bit misleading because pip is a general package installer, while Flit, Hatch & co. can only install the project being developed, if it uses their build backend.