diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2022-02-16 00:14:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-15 16:14:39 -0700 |
commit | 5b34b947a83e9e2ea8d180bcd6eaea8200552d2d (patch) | |
tree | 87445ba0c1b737330f16547d1a439c03e0a2131b | |
parent | dea9766336b0ec8097ce7fc5aabe33d1ce7ffa1c (diff) | |
download | spack-5b34b947a83e9e2ea8d180bcd6eaea8200552d2d.tar.gz spack-5b34b947a83e9e2ea8d180bcd6eaea8200552d2d.tar.bz2 spack-5b34b947a83e9e2ea8d180bcd6eaea8200552d2d.tar.xz spack-5b34b947a83e9e2ea8d180bcd6eaea8200552d2d.zip |
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
-rw-r--r-- | var/spack/repos/builtin/packages/py-archspec/package.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/py-archspec/package.py b/var/spack/repos/builtin/packages/py-archspec/package.py index 5e208f20e1..6c14451ccc 100644 --- a/var/spack/repos/builtin/packages/py-archspec/package.py +++ b/var/spack/repos/builtin/packages/py-archspec/package.py @@ -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' + ) |