thewalrus
thewalrus copied to clipboard
Build/package The Walrus using PEP 517/518
PEP 517 and PEP 518 introduced a new paradigm for building/packaging Python projects.
-
Configuring requirements and build settings is now done via a top-level
pyproject.toml
configuration file -
The build system (e.g.,
setuptools
,Poetry
) is independent of project requirements and build settings, allowing the build system to be switched out independently. -
The interim package
pep517
can be used to trigger various build/packaging hooks.
The major advantage are the requirements being separated from the build. Currently in The Walrus, the setup.py
file requires Cython for the line
from Cython.Build import cythonize
This import occurs before the call to the setup()
function, so a user installing from source must manually install Cython before running pip
(this has been a recurring issue with The Walrus installations). Using PEP 517, however, Cython would be automatically installed, if needed.
@josh146 @nquesada, is this still relevant knowing that The Walrus does not depend on cython any longer?
Hey @sduquemesa, it would still be useful long term to port to using PEP517/518, since this is the future of Python packaging, but as you note the reasons for doing it listed in the main comment are no longer relevant