|
| 1 | +=========================== |
| 2 | +Packaging tools comparisons |
| 3 | +=========================== |
| 4 | + |
| 5 | +.. contents:: |
| 6 | + :local: |
| 7 | + |
| 8 | + |
| 9 | +Use cases |
| 10 | +========= |
| 11 | + |
| 12 | +.. csv-table:: |
| 13 | + :align: left |
| 14 | + :header-rows: 1 |
| 15 | + :stub-columns: 1 |
| 16 | + |
| 17 | + ,Install Python,Install packages,Build distributions,Upload distributions,Manage virtual environments,Lock files |
| 18 | + build,no,no,yes,no,no,no |
| 19 | + Flit,no,yes,yes,yes,yes,yes |
| 20 | + Hatch,no,yes,yes,yes,yes,no |
| 21 | + PDM,no,yes,yes,yes,yes,yes |
| 22 | + pip,no,yes,yes,no,no,yes |
| 23 | + pip-tools,no,yes,no,no,no,yes |
| 24 | + Pipenv,no,yes,no,no,yes,yes |
| 25 | + pipx,no,yes,no,no,no,no |
| 26 | + Poetry,no,yes,yes,yes,yes,yes |
| 27 | + pyenv,yes,no,no,no,no,no |
| 28 | + Pyflow,yes,yes,yes,yes,yes,yes |
| 29 | + setuptools,no,yes,yes,no,no,no |
| 30 | + twine,no,no,no,yes,no,no |
| 31 | + venv,no,no,no,no,yes,no |
| 32 | + virtualenv,no,no,no,no,yes,no |
| 33 | + virtualenvwrapper,no,no,no,no,yes,no |
| 34 | + wheel,no,no,yes,no,no,no |
| 35 | + |
| 36 | +Build back-ends are not listed here, but they are in a dedicated section below. |
| 37 | + |
| 38 | + |
| 39 | +Comparisons |
| 40 | +=========== |
| 41 | + |
| 42 | +Development workflow tools |
| 43 | +-------------------------- |
| 44 | + |
| 45 | +.. csv-table:: |
| 46 | + :align: left |
| 47 | + :header-rows: 1 |
| 48 | + :stub-columns: 1 |
| 49 | + |
| 50 | + ,``[build-system]`` (PEP-517),Build,Upload,Env,Interchangeable build back-end,Plugins,Lock file |
| 51 | + Flit,yes,yes,yes,no,no,no,no |
| 52 | + Hatch,yes,yes,yes,yes,no,yes,no |
| 53 | + PDM,yes,yes,yes,yes,yes,yes,yes |
| 54 | + Poetry,yes,yes,yes,yes,no,yes,yes |
| 55 | + Pyflow,no,yes,yes,yes,no,no,yes |
| 56 | + |
| 57 | +See also build back-end features in dedicated section. |
| 58 | + |
| 59 | +There is no standard for lock files. |
| 60 | + |
| 61 | + |
| 62 | +Install Python interpreters |
| 63 | +--------------------------- |
| 64 | + |
| 65 | +.. csv-table:: |
| 66 | + :align: left |
| 67 | + :header-rows: 1 |
| 68 | + :stub-columns: 1 |
| 69 | + |
| 70 | + ,Install Python interpreters |
| 71 | + pyenv,yes |
| 72 | + Pyflow,yes |
| 73 | + |
| 74 | + |
| 75 | +Install packages |
| 76 | +---------------- |
| 77 | + |
| 78 | +.. csv-table:: |
| 79 | + :align: left |
| 80 | + :header-rows: 1 |
| 81 | + :stub-columns: 1 |
| 82 | + |
| 83 | + ,Dependency resolution,Editable |
| 84 | + pip,yes,yes |
| 85 | + pip-tools,yes,yes |
| 86 | + Pipenv,yes,yes |
| 87 | + pipx,yes,no |
| 88 | + |
| 89 | +``pipx`` is intended to be used to install standalone applications |
| 90 | +rather than to install packages in a virtual environment. |
| 91 | + |
| 92 | + |
| 93 | +Build distributions |
| 94 | +------------------- |
| 95 | + |
| 96 | +These tools are also called "*build front-ends*". |
| 97 | + |
| 98 | +.. csv-table:: |
| 99 | + :align: left |
| 100 | + :header-rows: 1 |
| 101 | + :stub-columns: 1 |
| 102 | + |
| 103 | + ,``[build-system]`` (PEP-517),sdist,wheel |
| 104 | + build,yes,yes,yes |
| 105 | + pip,yes,no,yes |
| 106 | + wheel,no,no,yes |
| 107 | + "dev workflow tools (Hatch, Flit, PDM, Poetry, etc.)",yes,yes,yes |
| 108 | + |
| 109 | + |
| 110 | +Build back-ends |
| 111 | +--------------- |
| 112 | + |
| 113 | +.. csv-table:: |
| 114 | + :align: left |
| 115 | + :header-rows: 1 |
| 116 | + :stub-columns: 1 |
| 117 | + |
| 118 | + ,``[build-system]`` (PEP-517),``[project]`` (PEP-621),editable (PEP-660),C extensions |
| 119 | + ``enscons``,yes,yes,yes,yes |
| 120 | + ``flit-core``,yes,yes,yes,no |
| 121 | + ``hatchling``,yes,yes,yes,no |
| 122 | + ``pdm-backend``,yes,yes,yes,no |
| 123 | + ``poetry-core``,yes,no,yes,[#]_ |
| 124 | + ``pymsbuild``,yes,no,no,yes |
| 125 | + ``trampolim``,yes,yes,no,no |
| 126 | + ``setuptools``,yes,yes,yes,yes |
| 127 | + ``whey``,yes,yes,yes,no |
| 128 | + |
| 129 | +.. [#] Poetry has an undocumented feature allowing |
| 130 | + the customization of the build process via a ``build.py`` file, |
| 131 | + which indirectly allows the handling of C extensions |
| 132 | + (this is comparable to ``setuptools`` own `setup.py`). |
| 133 | +
|
| 134 | +
|
| 135 | +Upload distributions |
| 136 | +-------------------- |
| 137 | + |
| 138 | +.. csv-table:: |
| 139 | + :align: left |
| 140 | + :header-rows: 1 |
| 141 | + :stub-columns: 1 |
| 142 | + |
| 143 | + ,Upload |
| 144 | + Flit,yes |
| 145 | + Hatch,yes |
| 146 | + PDM,yes |
| 147 | + Poetry,yes |
| 148 | + twine,yes |
| 149 | + |
| 150 | + |
| 151 | +Manage virtual environments |
| 152 | +--------------------------- |
| 153 | + |
| 154 | +.. csv-table:: |
| 155 | + :align: left |
| 156 | + :header-rows: 1 |
| 157 | + :stub-columns: 1 |
| 158 | + |
| 159 | + ,For any Python interpreter,Description in file |
| 160 | + Hatch,yes,yes [#]_ |
| 161 | + nox,yes,yes [#]_ |
| 162 | + PDM,yes,no |
| 163 | + Pipenv,yes,no |
| 164 | + Poetry,yes,no |
| 165 | + tox,yes,yes [#]_ |
| 166 | + venv,no,no |
| 167 | + virtualenv,yes,no |
| 168 | + virtualenvwrapper,yes,no |
| 169 | + |
| 170 | +Unlike the other tools presented in this section, |
| 171 | +``venv`` is part of Python's own standard library, |
| 172 | +it should be always available without having to be installed separately. |
| 173 | +But note that some Linux distributions (e.g. Debian, Ubuntu, and derivatives) |
| 174 | +made the decision to package ``venv`` separately from the rest of the Python distribution |
| 175 | +and consequently it might be necessary to install ``venv`` explicitly |
| 176 | +(typically with a command such as ``apt install python3-venv``, |
| 177 | +consult the documentation of the Linux distribution for exact details). |
| 178 | + |
| 179 | +.. [#] ``[tool.hatch.envs]`` section of ``pyproject.toml`` |
| 180 | +.. [#] ``noxfile.py`` |
| 181 | +.. [#] ``tox.ini`` |
| 182 | +
|
| 183 | +
|
| 184 | +Lock files |
| 185 | +---------- |
| 186 | + |
| 187 | +There is no PyPA standard for the concept of "*lock files*". |
| 188 | +There is some kind of a *de facto* convention |
| 189 | +around *pip*'s ``requirements.txt`` file format |
| 190 | +but it can not be considered a good enough *lock file* format. |
| 191 | + |
| 192 | +.. csv-table:: |
| 193 | + :align: left |
| 194 | + :header-rows: 1 |
| 195 | + :stub-columns: 1 |
| 196 | + |
| 197 | + ,Format |
| 198 | + pip,``requirements.txt`` |
| 199 | + pip-tools,``requirements.txt`` |
| 200 | + Pipenv,``Pipfile.lock`` |
| 201 | + poetry,``poetry.lock`` |
| 202 | + PDM,``pdm.lock`` |
0 commit comments