Modernize build/install to pyproject.toml#457
Open
facundobatista wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
setup.pywas over a decade old and carried a lot of legacy cruft:distutils.core.setup(removed from the stdlib in 3.12), a hand-rolled regexversion parser, and a
CustomInstallclass doing platform-specific scriptselection plus manual man-page copying. This migrates everything to a
declarative
pyproject.toml(PEP 621, setuptools backend).What changed
Packaging
pyproject.tomlreplacessetup.pyfor all metadata.fades/_version.py:__version__(no more regex parsing).
fadescommand is now a console-scripts entry point(
fades.main:console_entry_point) instead of the shippedbin/fades/bin/fades.cmdscripts. setuptools generates the right launcher per platform(including
fades.exeon Windows), so the wholeCustomInstall/platform-selection logic is gone.
console_entry_point()infades/main.py(handlesFadesError);python -m fadesnow reuses it, so there is a single entry path.Dependency fixes
setuptoolsfrom the runtime dependencies — fades never imports it,and it's irrelevant to the child venvs it builds.
packagingfrom an optional extra to a hard dependency: it isimported unconditionally at module top level (
parsing.py,helpers.py), sopip install fadespreviously produced a broken install unlesspackaginghappened to already be present.
pyxdgstays an extra (imported lazily, witha fallback).
The one remaining
setup.pyshare/man/man1viadata_files. PEP 621 has no equivalent, and modernsetuptools rejects
data_filesinpyproject.toml. It's consumed bypip --prefix, the Debianpybuildflow and the snap build.Callers updated
test,testdev,testdev.bat,build_readme→python -m fades(
build_readmeno longer relies onsetup.py --long-description)..github/workflows/integtests.yaml→ runs via-m fades; the minimumsupported Python is now read from
requires-pythoninpyproject.toml.HOWTO_RELEASE.txt→python -m buildinstead of./setup.py clean sdist.Verification
python -m buildproduces a valid sdist + wheel; sdist includesman/,COPYING,AUTHORS,README.rst.pip installof the wheel pullspackagingautomatically and doesnot install
setuptools.fades -Vandpython -m fades -Vboth work; a usage error exits non-zero(
FadesErrorhandled).<prefix>/share/man/man1/fades.1.