You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: package-structure-code/complex-python-package-builds.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ Hatch has the worst take on building compiled code by some distance. Unless its
50
50
51
51
HEnry: Poetry will move to PEP 621 configuration in version 2.
52
52
53
-
* pdm, hatch and poetry all have "ways" of supporting c extensions via pdm-build, hatchling and poetry's build back-end.
53
+
* pdm, hatch and poetry all have "ways" of supporting c extensions via pdm-backend, hatchling and poetry's build back-end.
54
54
* poetry's support for C extensions is not fully developed and documented (yet). * Poetry doesn't offer a way to facilitate "communication" between poetry front end and another back-end like meson to build via a build hook. so while some have used it with other back-end builds it's not ideal for this application
55
55
* pdm and poetry both rely on setuptools for C extensions. pdm's support claims to be fully developed and documented. poetry claims nothing, and doesn't document it.
56
56
* hatch both offers a plugin type approach to support custom build steps
Version Control based versioning (using `git tags`)|✖|✅|✅|✅
248
+
Version bumping|✖|✅| ✅| ✅
249
+
More than one maintainer? (bus factor)|✖|✖| ✖| ✅
249
250
```
250
251
251
252
Notes:
@@ -272,17 +273,18 @@ packages them with the pure Python files.
272
273
```{csv-table}
273
274
:header: Feature, PDM, Notes
274
275
:widths: 20,5,50
275
-
276
-
Use Other Build Backends, ✅, When you setup PDM it allows you to select from Hatch; PDM-517 and PDM-core build tools. PDM also can work with Meson-Python which supports move complex python builds.
277
-
Dependency management & lock files ,✅,PDM and Poetry are currently the only tools that support creating dependency lock files. Their default dependency constraint approach to creating lock files is different: Poetry uses a default [upper bound lock](https://python-poetry.org/docs/dependency-specification/#version-constraints) `^`. This means that Poetry will always never bump a dependency to the next major version (ie from 1.2 to 2.0). PDM uses an open lock `>=` approach by default but also allows you to [customize how you want locking constraints to be implemented](https://pdm.fming.dev/latest/usage/dependency/#about-update-strategy). Thus with PDM you can explicitly tell it to lock using upper bounds like Poetry. Or you can tell it to use other strategies. This makes PDM one of the most flexible tools for creating lock files. Lock files are often most useful to developers creating web apps where locking the environment is critical for consistent user experience.
278
-
Select your environment manager of choice (conda; venv; etc),✅ , PDM allows you to select the environment manager that you want to use for managing your package.
279
-
Publish to PyPI,✅,PDM supports publishing to both test PyPI and PyPI
280
-
Version Control based versioning,✅ , PDM has a setuptools_scm like tool built into it which allows you to use dynamic versioning that rely on git tags.
281
-
Version bumping, ✅ , PDM supports you bumping the version of your package using standard semantic version terms patch; minor; major
282
-
Follows current packaging standards,✅,PDM supports current packaging standards for adding metadata to the **pyproject.toml** file. It also supports pep 517? dependency management which relies upon a local directory containing a users environment.
283
-
Install your package in editable mode,✅,PDM supports installing your package in editable mode.
284
-
Build your sdist and wheel distributions,✅, Similar to all of the other tools PDM builds your packages sdist and wheel files for you.
285
-
✨Optional use of PEP 582 / local environment directory✨,✅, PDM is currently the only tool that optionally supports PEP 582 (having a local environment configuration stored within a `__packages__` directory in your working package directory).
276
+
:delim: "|"
277
+
278
+
Use Other Build Backends| ✅| When you setup PDM it allows you to select from Hatch; PDM-517 and PDM-core build tools. PDM also can work with Meson-Python which supports move complex python builds.
279
+
Dependency management & lock files |✅|PDM and Poetry are currently the only tools that support creating dependency lock files. Their default dependency constraint approach to creating lock files is different: Poetry uses a default [upper bound lock](https://python-poetry.org/docs/dependency-specification/#version-constraints) `^`. This means that Poetry will always never bump a dependency to the next major version (ie from 1.2 to 2.0). PDM uses an open lock `>=` approach by default but also allows you to [customize how you want locking constraints to be implemented](https://pdm.fming.dev/latest/usage/dependency/#about-update-strategy). Thus with PDM you can explicitly tell it to lock using upper bounds like Poetry. Or you can tell it to use other strategies. This makes PDM one of the most flexible tools for creating lock files. Lock files are often most useful to developers creating web apps where locking the environment is critical for consistent user experience.
280
+
Select your environment manager of choice (conda; venv; etc)|✅ | PDM allows you to select the environment manager that you want to use for managing your package.
281
+
Publish to PyPI|✅|PDM supports publishing to both test PyPI and PyPI
282
+
Version Control based versioning|✅ | PDM has a setuptools_scm like tool built into it which allows you to use dynamic versioning that rely on git tags.
283
+
Version bumping| ✅ | PDM supports you bumping the version of your package using standard semantic version terms patch; minor; major
284
+
Follows current packaging standards|✅|PDM supports current packaging standards for adding metadata to the **pyproject.toml** file. It also supports pep 517? dependency management which relies upon a local directory containing a users environment.
285
+
Install your package in editable mode|✅|PDM supports installing your package in editable mode.
286
+
Build your sdist and wheel distributions|✅| Similar to all of the other tools PDM builds your packages sdist and wheel files for you.
287
+
✨Optional use of PEP 582 / local environment directory✨|✅| PDM is currently the only tool that optionally supports PEP 582 (having a local environment configuration stored within a `__packages__` directory in your working package directory).
286
288
```
287
289
288
290
```{admonition} PDM vs. Poetry
@@ -318,12 +320,13 @@ building a basic package to use in a local workflow that doesn't require any adv
318
320
```{csv-table}
319
321
:header: Feature, Flit, Notes
320
322
:widths: 20,5,50
323
+
:delim: "|"
321
324
322
-
Publish to PyPI and test PyPI,✅,Flit supports publishing to both test PyPI and PyPI
323
-
Helps you add metadata to your pyproject.toml file,✅, .
324
-
Follows current packaging standards,✅,Flit supports current packaging standards for adding metadata to the **pyproject.toml** file.
325
-
Install your package in editable mode,✅,Flit supports installing your package in editable mode. However it does use a slightly different syntax from the usual `pip install -e .` to do so.
326
-
Build your sdist and wheel distributions,✅, .
325
+
Publish to PyPI and test PyPI|✅|Flit supports publishing to both test PyPI and PyPI
326
+
Helps you add metadata to your **pyproject.toml** file|✅| .
327
+
Follows current packaging standards|✅|Flit supports current packaging standards for adding metadata to the **pyproject.toml** file.
328
+
Install your package in editable mode|✅|Flit supports installing your package in editable mode. However, it does use a slightly different syntax from the usual `pip install -e .` to do so.
329
+
Build your sdist and wheel distributions|✅| Flit can be used to build your packages sdist and wheel distributions.
327
330
```
328
331
329
332
```{admonition} Learn more about flit
@@ -357,19 +360,20 @@ using a tool like **Make** or **Nox**.
357
360
```{csv-table}
358
361
:header: Feature, Hatch, Notes
359
362
:widths: 20,5,50
360
-
361
-
Use Other Build Backends,✖, Switching out build back-ends is not currently an option when using Hatch. However this feature is coming to the package in the near future.
362
-
Dependency management,✅,Hatch can help you add dependencies to your `pyproject.toml` metadata.
363
-
Select your environment manager of choice (conda; venv; etc),✅ , Hatch does allow you to select the (pip) environment that you want to use for managing and building your package. However if you want to use conda [you will need to use a plugin](https://github.com/OldGrumpyViking/hatch-conda).
364
-
Publish to PyPI and test PyPI,✅,Hatch supports publishing to both test PyPI and PyPI
365
-
Version Control based versioning,✅ , Hatch offers `hatch_vcs` which is a plugin that uses setuptools_scm to support versioning using git tags. The workflow with `hatch_vcs` is the same as that with `setuptools_scm`.
366
-
Version bumping, ✅ , Hatch supports you bumping the version of your package using standard semantic version terms patch; minor; major
367
-
Follows current packaging standards,✅,Hatch supports current packaging standards for adding metadata to the **pyproject.toml** file.
368
-
Install your package in editable mode,✖✅, You can install your package in editable mode using `pip install -e .` Hatch mentions [editable installs](https://hatch.pypa.io/latest/config/build/#dev-mode) but refers to pip in its documentation.
369
-
Build your sdist and wheel distributions,✅, Hatch will build the sdist and wheel distributions
370
-
✨Matrix environment creation to support testing across Python versions✨,✅, The matrix environment creation is a feature that is unique to Hatch in the packaging ecosystem. This feature is useful if you wish to test your package locally across Python versions (instead of using a tool such as tox).
371
-
✨[Nox / MAKEFILE like functionality](https://hatch.pypa.io/latest/environment/#selection)✨, ✅, This feature is also unique to Hatch. This functionality allows you to create workflows in the **pyproject.toml** configuration to do things like serve docs locally and clean your package build directory. This means you may have one less tool in your build workflow.
372
-
✨A flexible build back-end: **hatchling**✨, ✅, **The hatchling build back-end offered by the maintainer of Hatch allows developers to easily build plugins to support custom build steps when packaging.
363
+
:delim: "|"
364
+
365
+
Use Other Build Backends|✖| Switching out build back-ends is not currently an option when using Hatch. However this feature is coming to the package in the near future.
366
+
Dependency management|✅|Hatch can help you add dependencies to your **pyproject.toml** metadata.
367
+
Select your environment manager of choice (conda, venv, etc)|✅ | Hatch does allow you to select the (pip) environment that you want to use for managing and building your package. However if you want to use conda [you will need to use a plugin](https://github.com/OldGrumpyViking/hatch-conda).
368
+
Publish to PyPI and test PyPI|✅|Hatch supports publishing to both test PyPI and PyPI
369
+
Version Control based versioning|✅ | Hatch offers `hatch_vcs` which is a plugin that uses setuptools_scm to support versioning using git tags. The workflow with `hatch_vcs` is the same as that with `setuptools_scm`.
370
+
Version bumping| ✅ | Hatch supports you bumping the version of your package using standard semantic version terms patch; minor; major
371
+
Follows current packaging standards|✅|Hatch supports current packaging standards for adding metadata to the **pyproject.toml** file.
372
+
Install your package in editable mode|✖✅| You can install your package in editable mode using `pip install -e .` Hatch mentions [editable installs](https://hatch.pypa.io/latest/config/build/#dev-mode) but refers to pip in its documentation.
373
+
Build your sdist and wheel distributions|✅| Hatch will build the sdist and wheel distributions
374
+
✨Matrix environment creation to support testing across Python versions✨|✅| The matrix environment creation is a feature that is unique to Hatch in the packaging ecosystem. This feature is useful if you wish to test your package locally across Python versions (instead of using a tool such as tox).
375
+
✨[Nox / MAKEFILE like functionality](https://hatch.pypa.io/latest/environment/#selection)✨| ✅| This feature is also unique to Hatch. This functionality allows you to create workflows in the **pyproject.toml** configuration to do things like serve docs locally and clean your package build directory. This means you may have one less tool in your build workflow.
376
+
✨A flexible build back-end: **hatchling**✨| ✅| **The hatchling build back-end offered by the maintainer of Hatch allows developers to easily build plugins to support custom build steps when packaging.
373
377
374
378
```
375
379
@@ -383,8 +387,6 @@ so it might be similar to Poetry in that regard -->
383
387
There are a few features that hatch is missing that may be important for some.
384
388
These include:
385
389
386
-
Hatch:
387
-
388
390
- Doesn't support dependency pinning
389
391
- Currently doesn't support use with other build back-ends. Lack of support for other build back-ends makes Hatch less desirable for users with more complex package builds. If your package is pure
390
392
Python, this won't be an issue. NOTE: there is a plan for this feature to be added in the upcoming months.
@@ -412,16 +414,17 @@ is currently undocumented. Thus, we don't recommend using Poetry for more comple
412
414
```{csv-table}
413
415
:header: Feature, Poetry, Notes
414
416
:widths: 20,5,50
415
-
416
-
Dependency management,✅,Poetry helps you add dependencies to your `pyproject.toml` metadata. _NOTE: currently Poetry adds dependencies using an approach that is slightly out of alignment with current Python peps - however there is a plan to fix this in an upcoming release._ Allows you to organize dependencies in groups: docs; package; tests.
417
-
Dependency pinning,✅ ,Poetry offers dependency pinning however it's default approach can be problematic for some packages. Read below for more.
418
-
Select your environment manager of choice (conda; venv; etc),✅ , Poetry allows you to either use its simple environment management tool or select the environment manager that you want to use for managing your package. [Read more about its built in environment management options](https://python-poetry.org/docs/basic-usage/#using-your-virtual-environment).
419
-
Publish to PyPI and test PyPI,✅,Poetry supports publishing to both test PyPI and PyPI
420
-
Version Control based versioning,✅ , The plugin [Poetry dynamic versioning](https://github.com/mtkennerly/poetry-dynamic-versioning) supports versioning using git tags with Poetry.
421
-
Version bumping, ✅ , Poetry supports you bumping the version of your package using standard semantic version terms patch; minor; major
422
-
Follows current packaging standards,✖✅,Poetry does not quite support current packaging standards for adding metadata to the **pyproject.toml** file but plans to fix this in an upcoming release.
423
-
Install your package in editable mode,✅,Poetry supports installing your package in editable mode using `--editable`
424
-
Build your sdist and wheel distributions,✅,Poetry will build your sdist and wheel distributions using `poetry build`
417
+
:delim: "|"
418
+
419
+
Dependency management|✅|Poetry helps you add dependencies to your `pyproject.toml` metadata. _NOTE: currently Poetry adds dependencies using an approach that is slightly out of alignment with current Python peps - however there is a plan to fix this in an upcoming release._ Allows you to organize dependencies in groups: docs; package; tests.
420
+
Dependency pinning|✅ |Poetry offers dependency pinning however it's default approach can be problematic for some packages. Read below for more.
421
+
Select your environment manager of choice (conda; venv; etc)|✅ | Poetry allows you to either use its simple environment management tool or select the environment manager that you want to use for managing your package. [Read more about its built in environment management options](https://python-poetry.org/docs/basic-usage/#using-your-virtual-environment).
422
+
Publish to PyPI and test PyPI|✅|Poetry supports publishing to both test PyPI and PyPI
423
+
Version Control based versioning|✅ | The plugin [Poetry dynamic versioning](https://github.com/mtkennerly/poetry-dynamic-versioning) supports versioning using git tags with Poetry.
424
+
Version bumping| ✅ | Poetry supports you bumping the version of your package using standard semantic version terms patch; minor; major
425
+
Follows current packaging standards|✖✅|Poetry does not quite support current packaging standards for adding metadata to the **pyproject.toml** file but plans to fix this in an upcoming release.
426
+
Install your package in editable mode|✅|Poetry supports installing your package in editable mode using `--editable`
427
+
Build your sdist and wheel distributions|✅|Poetry will build your sdist and wheel distributions using `poetry build`
425
428
```
426
429
427
430
<!-- TODO: update this given responses here: https://github.com/python-poetry/poetry/discussions/7525 -->
0 commit comments