diff options
Diffstat (limited to 'packaging/pep517_backend/_backend.py')
-rw-r--r-- | packaging/pep517_backend/_backend.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/packaging/pep517_backend/_backend.py b/packaging/pep517_backend/_backend.py index 9c253296ff..d4d10f2364 100644 --- a/packaging/pep517_backend/_backend.py +++ b/packaging/pep517_backend/_backend.py @@ -3,6 +3,7 @@ from __future__ import annotations import os +import re import subprocess import sys import typing as t @@ -131,6 +132,19 @@ def build_sdist( # noqa: WPS210, WPS430 ) rst_in.unlink() + Path('pyproject.toml').write_text( + re.sub( + r"""(?x) + backend-path\s=\s\[ # value is a list of double-quoted strings + [^]]+ + ].*\n + build-backend\s=\s"[^"]+".*\n # value is double-quoted + """, + 'build-backend = "setuptools.build_meta"\n', + Path('pyproject.toml').read_text(), + ) + ) + built_sdist_basename = _setuptools_build_sdist( sdist_directory=sdist_directory, config_settings=config_settings, |