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/python-package-build-tools.md
+13-5Lines changed: 13 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,7 +68,7 @@ to a package build that does not have extensions that are written in another
68
68
programming language (such as `C` or `C++`).
69
69
70
70
Other packages that have C and C++ extensions (or that wrap other languages such as fortran) require additional code compilation steps when built.
71
-
Back-ends such as and **setuptools.build**, **meson.build**
71
+
Back-ends such as **setuptools.build**, **meson.build**
72
72
and **scikit-build** support complex builds with custom steps. If your
73
73
build is particularly complex (i.e. you have more than a few `C`/`C++`
74
74
extensions), then we suggest you use **meson.build** or **scikit-build**.
@@ -78,7 +78,7 @@ extensions), then we suggest you use **meson.build** or **scikit-build**.
78
78
A packaging front-end tool refers to a tool that makes it easier for you to
79
79
perform common packaging tasks using similar commands. These tasks include:
80
80
81
-
-[Build your packages (create the sdist and wheel distributions](python-package-distribution-files-sdist-wheel)
81
+
-[Build your packages (create the sdist and wheel distributions)](python-package-distribution-files-sdist-wheel)
82
82
- Installing your package in a development mode (so it updates when you update your code)
83
83
- Publishing to PyPI
84
84
- Running tests
@@ -260,6 +260,14 @@ Build your sdist and wheel distributions|✅| Similar to all of the other tools
260
260
✨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 `__pypackages__` directory in your working directory).
261
261
```
262
262
263
+
```{admonition} PEP 582 was rejected
264
+
:class: important
265
+
266
+
While [PEP 582](https://peps.python.org/pep-0582), use of local packages directory `__pypackages__`,
267
+
sought to implement a more lightweight form of Python environment management it currently stands
268
+
as a rejected standard in the broader Python community.
269
+
```
270
+
263
271
```{admonition} PDM vs. Poetry
264
272
The functionality of PDM is similar to Poetry. However, PDM also offers
265
273
additional, documented support for C extensions and version control based
@@ -349,7 +357,7 @@ Publish to PyPI and test PyPI|✅|Hatch supports publishing to both test PyPI an
349
357
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`.
350
358
Version bumping| ✅ | Hatch supports you bumping the version of your package using standard semantic version terms patch; minor; major
351
359
Follows current packaging standards|✅|Hatch supports current packaging standards for adding metadata to the **pyproject.toml** file.
352
-
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.
360
+
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.
353
361
Build your sdist and wheel distributions|✅| Hatch will build the sdist and wheel distributions
354
362
✨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).
355
363
✨[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.
@@ -395,7 +403,7 @@ Lock files| ✅ | Poetry creates a **poetry.lock** file that you can use if you
395
403
Publish to PyPI and test PyPI|✅|Poetry supports publishing to both test PyPI and PyPI
396
404
Version Control based versioning|✅ | The plugin [Poetry dynamic versioning](https://github.com/mtkennerly/poetry-dynamic-versioning) supports versioning using git tags with Poetry.
397
405
Version bumping| ✅ | Poetry supports you bumping the version of your package using standard semantic version terms patch; minor; major
398
-
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.
406
+
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.
399
407
Install your package in editable mode|✅|Poetry supports installing your package in editable mode using `--editable`
400
408
Build your sdist and wheel distributions|✅|Poetry will build your sdist and wheel distributions using `poetry build`
401
409
```
@@ -477,6 +485,6 @@ when using setuptools. For instance:
477
485
478
486
- setuptools will build a project without a name or version if you are not using a **pyproject.toml** file
479
487
to store metadata.
480
-
\*Setuptools also will include all of the files in your package
488
+
- setuptools also will include all of the files in your package
481
489
repository if you do not explicitly tell it to exclude files using a
Copy file name to clipboardExpand all lines: package-structure-code/python-package-distribution-files-sdist-wheel.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ Also note that we are not discussing conda build workflows in this section.
24
24
package. These are the "raw / as-is" files that you store on GitHub or whatever
25
25
platform you use to manage your code.
26
26
27
-
**S**ource **D**istributions are referred to as sdist. As the name implies, a SDIST contains the source code; it has not been
27
+
**S**ource **Dist**ributions are referred to as sdist. As the name implies, a SDIST contains the source code; it has not been
28
28
built or compiled in any way. Thus, when a user installs your source
29
29
distribution using pip, pip needs to run a build step first. For this reason, you could define a source distribution as a compressed archive that contains everything required to build a wheel (except for project dependencies) without network access.
30
30
@@ -103,7 +103,7 @@ distribution.
103
103
The wheel (.whl) is your built binary distribution. **Binary files** are the built / compiled source files. These files are ready to be installed. A wheel (**.whl**) is a **zip** file containing all of the files needed to directly install your package. All of the files in a wheel are binaries - this means that code is already compiled / built. Wheels are thus faster to install - particularly if you have a package that requires build steps.
104
104
105
105
The wheel does not contain any of your
106
-
packages configuration files such as **setup.cfg** or **pyproject.toml**. This
106
+
package's configuration files such as **setup.cfg** or **pyproject.toml**. This
107
107
distribution is already built so it's ready to install.
108
108
109
109
Because it is built, the wheel file will be faster to install for pure Python
0 commit comments