Jeremy Stanley 85c494e219 build-python-release: pyproject-build by default
The PyPA "build" project is the canonical pyproject (PEP 517) build
frontend, and is necessary in cases where SetupTools-based projects
want to do modern Python packaging standards-compliant builds. The
SetupTools maintainers have long since deprecated direct calls to
setup.py scripts, with this as the preferred solution.

Note that pyproject-build is designed to be backwards-compatible
with old-style SetupTools projects that don't have a pyproject.toml
file, so this should be a safe and transparent change. That said, we
include a failsafe switch to bring back the old behavior just in
case it's needed by some projects for unexpected reasons.

Change-Id: I9b28c97092c32870bf730f5ca6cac966435370bc
2025-01-27 22:35:32 +00:00

33 lines
930 B
YAML

- name: Build sdist and wheel with setup.py
when: legacy_setup
block:
- name: Build a tarball and wheel
command: "{{ release_python }} setup.py sdist bdist_wheel {{ bdist_wheel_xargs }}"
args:
chdir: "{{ zuul_work_dir }}"
when: build_wheel
- name: Just build a tarball
command: "{{ release_python }} setup.py sdist"
args:
chdir: "{{ zuul_work_dir }}"
when: not build_wheel
- name: Build sdist and wheel with pyproject-build
when: not legacy_setup
block:
- name: Make sure pyproject-build is available
include_role:
name: ensure-pyproject-build
- name: Build a tarball and wheel
command: "{{ ensure_pyproject_build_executable }}"
args:
chdir: "{{ zuul_work_dir }}"
when: build_wheel
- name: Just build a tarball
command: "{{ ensure_pyproject_build_executable }} --sdist"
args:
chdir: "{{ zuul_work_dir }}"
when: not build_wheel