Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions source/discussions/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ specific topic. If you're just trying to get stuff done, see
wheel-vs-egg
src-layout-vs-flat-layout
setup-py-deprecated
packaging-tools-comparisons
205 changes: 205 additions & 0 deletions source/discussions/packaging-tools-comparisons.rst
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
Copy link
Contributor

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.

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
Copy link
Contributor

Choose a reason for hiding this comment

The 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that setuptools' support for installing packages is essentially what powers python setup.py install and is thus deprecated.

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
Copy link
Contributor

Choose a reason for hiding this comment

The 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 wheel pack, but I think most people would expect the ability to “build distributions” to mean something different (basically, being a pyproject build frontend).


Build back-ends are not listed here, but they are in a dedicated section below.
Copy link
Contributor

Choose a reason for hiding this comment

The 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by “[build-system] (PEP-517)”? That it is a PEP 517 compliant build backend?

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you mention the special purpose of pipx, I'd also mention the special purpose of pip-tools, namely lock file management.



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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question as above about wheel: I wouldn't consider it a “build frontend”.

"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``