Skip to content

Commit b082fb1

Browse files
committed
Fix: csv table delim and numerous other review fixes
1 parent fbf3ded commit b082fb1

File tree

3 files changed

+56
-53
lines changed

3 files changed

+56
-53
lines changed

package-structure-code/complex-python-package-builds.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Hatch has the worst take on building compiled code by some distance. Unless its
5050
5151
HEnry: Poetry will move to PEP 621 configuration in version 2.
5252
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.
5454
* 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
5555
* 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.
5656
* hatch both offers a plugin type approach to support custom build steps

package-structure-code/pyproject-toml-python-package-metadata.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ resources working with complex builds in the future.
3434
Below is an example build configuration for a Python project. This example
3535
package setup uses:
3636

37-
- **pdm.pep517.api** to build the [package's sdist and wheels](python-package-distribution-files-sdist-wheel)
37+
- **pdm.backend** to build the [package's sdist and wheels](python-package-distribution-files-sdist-wheel)
3838

3939
```
4040
[build-system]
41-
requires = ["pdm-pep517>=1.0.0"]
42-
build-back-end = "pdm.pep517.api"
41+
requires = ["pdm-backend>=1.0.0"]
42+
build-back-end = "pdm.backend"
4343
4444
[project]
4545
name = "examplePy"

package-structure-code/python-package-build-tools.md

Lines changed: 52 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -238,14 +238,15 @@ included in the table.
238238
```{csv-table}
239239
:header: Feature, Flit, Hatch, PDM, Poetry
240240
:widths: 36, 10,10,10,10
241-
242-
Default Build Back-end, Flit-core, hatchling, PDM, Poetry-core
243-
Use Other Build Backends,✖ , ✖,✅ ,✖
244-
Dependency management, ✖,✖,✅,✅
245-
Publish to PyPI, ✅,✅,✅,✅
246-
Version Control based versioning (using `git tags`),✖,✅,✅,✅
247-
Version bumping,✖,✅, ✅, ✅
248-
More than one maintainer? (bus factor),✖,✖, ✖, ✅
241+
:delim: "|"
242+
243+
Default Build Back-end| Flit-core| hatchling| PDM| Poetry-core
244+
Use Other Build Backends|✖ | ✖|✅ |✖
245+
Dependency management| ✖|✖|✅|✅
246+
Publish to PyPI| ✅|✅|✅|✅
247+
Version Control based versioning (using `git tags`)|✖|✅|✅|✅
248+
Version bumping|✖|✅| ✅| ✅
249+
More than one maintainer? (bus factor)|✖|✖| ✖| ✅
249250
```
250251

251252
Notes:
@@ -272,17 +273,18 @@ packages them with the pure Python files.
272273
```{csv-table}
273274
:header: Feature, PDM, Notes
274275
: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).
286288
```
287289

288290
```{admonition} PDM vs. Poetry
@@ -318,12 +320,13 @@ building a basic package to use in a local workflow that doesn't require any adv
318320
```{csv-table}
319321
:header: Feature, Flit, Notes
320322
:widths: 20,5,50
323+
:delim: "|"
321324
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.
327330
```
328331

329332
```{admonition} Learn more about flit
@@ -357,19 +360,20 @@ using a tool like **Make** or **Nox**.
357360
```{csv-table}
358361
:header: Feature, Hatch, Notes
359362
: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.
373377
374378
```
375379

@@ -383,8 +387,6 @@ so it might be similar to Poetry in that regard -->
383387
There are a few features that hatch is missing that may be important for some.
384388
These include:
385389

386-
Hatch:
387-
388390
- Doesn't support dependency pinning
389391
- 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
390392
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
412414
```{csv-table}
413415
:header: Feature, Poetry, Notes
414416
: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`
425428
```
426429

427430
<!-- TODO: update this given responses here: https://github.com/python-poetry/poetry/discussions/7525 -->

0 commit comments

Comments
 (0)