Description
The project currently uses the legacy setup.py for packaging. The Python packaging ecosystem has standardized on pyproject.toml as defined by PEP 517, PEP 518, and PEP 621.
Why This Matters
- setuptools deprecation path:
setup.py-based builds are being phased out. pip already emits deprecation warnings for projects without pyproject.toml.
- Build isolation:
pyproject.toml enables proper build isolation, preventing dependency conflicts during installation.
- Declarative metadata: All project metadata (name, version, dependencies, entry points) lives in one standard file instead of being split between
setup.py, setup.cfg, and requirements.txt.
- Tool configuration: Tools like
black, ruff, mypy, and pytest can all be configured in pyproject.toml, reducing the number of config files.
Migration
The current setup.py is straightforward enough that migration would be a direct translation:
[build-system]
requires = ["setuptools>=68.0", "wheel"]
build-backend = "setuptools.backends._legacy:_Backend"
[project]
name = "platformio"
dynamic = ["version", "dependencies"]
requires-python = ">=3.9"
The get_pip_dependencies() function and dynamic version import can be handled via setuptools dynamic fields.
This is a non-functional change that modernizes the packaging without affecting runtime behavior.
Description
The project currently uses the legacy
setup.pyfor packaging. The Python packaging ecosystem has standardized onpyproject.tomlas defined by PEP 517, PEP 518, and PEP 621.Why This Matters
setup.py-based builds are being phased out.pipalready emits deprecation warnings for projects withoutpyproject.toml.pyproject.tomlenables proper build isolation, preventing dependency conflicts during installation.setup.py,setup.cfg, andrequirements.txt.black,ruff,mypy, andpytestcan all be configured inpyproject.toml, reducing the number of config files.Migration
The current
setup.pyis straightforward enough that migration would be a direct translation:The
get_pip_dependencies()function and dynamic version import can be handled viasetuptoolsdynamic fields.This is a non-functional change that modernizes the packaging without affecting runtime behavior.