archspec: remove pyproject.toml to workaround PEP517 (#28956)

* archspec: remove pyproject.toml to workaround PEP517

If pyproject.toml is in the folder, that is preferred to the
setup.py packaged by poetry itself. Adding a dependency on
poetry for deploying a pure Python package seems wasteful,
since the package to be deployed just needs to be copied in
place, so we don't want to built rust for that.

* archspec: patch pyproject.toml to comply to PEP517

See https://python-poetry.org/docs/pyproject/#poetry-and-pep-517

* Fix style issues
This commit is contained in:
Massimiliano Culpo 2022-02-16 00:14:39 +01:00 committed by GitHub
parent dea9766336
commit 5b34b947a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,3 +20,13 @@ class PyArchspec(PythonPackage):
depends_on('py-six@1.13.0:1', type=('build', 'run'))
depends_on('py-setuptools', type='build')
depends_on('py-poetry-core@1.0.0:', type='build')
def patch(self):
# See https://python-poetry.org/docs/pyproject/#poetry-and-pep-517
with working_dir(self.build_directory):
if self.spec.satisfies('@:0.1.3'):
filter_file("poetry>=0.12", "poetry_core>=1.0.0", 'pyproject.toml')
filter_file(
"poetry.masonry.api", "poetry.core.masonry.api", 'pyproject.toml'
)