diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2022-12-06 11:54:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-06 11:54:02 +0100 |
commit | 4c05fe569c257d7615c85898bb2b31f680c6d2dd (patch) | |
tree | 6b715898f75de8420667bd9cc1c45f1340b5b401 /var/spack/repos/builtin/packages/py-platformdirs/package.py | |
parent | e550665df7b62f4ad205f84081c09375a8e6f4e8 (diff) | |
download | spack-4c05fe569c257d7615c85898bb2b31f680c6d2dd.tar.gz spack-4c05fe569c257d7615c85898bb2b31f680c6d2dd.tar.bz2 spack-4c05fe569c257d7615c85898bb2b31f680c6d2dd.tar.xz spack-4c05fe569c257d7615c85898bb2b31f680c6d2dd.zip |
Bootstrap most of Spack dependencies using environments (#34029)
This commit reworks the bootstrapping procedure to use Spack environments
as much as possible.
The `spack.bootstrap` module has also been reorganized into a Python package.
A distinction is made among "core" Spack dependencies (clingo, GnuPG, patchelf)
and other dependencies. For a number of reasons, explained in the `spack.bootstrap.core`
module docstring, "core" dependencies are bootstrapped with the current ad-hoc
method.
All the other dependencies are instead bootstrapped using a Spack environment
that lives in a directory specific to the interpreter and the architecture being used.
Diffstat (limited to 'var/spack/repos/builtin/packages/py-platformdirs/package.py')
-rw-r--r-- | var/spack/repos/builtin/packages/py-platformdirs/package.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/py-platformdirs/package.py b/var/spack/repos/builtin/packages/py-platformdirs/package.py index f226506db5..ee5a832315 100644 --- a/var/spack/repos/builtin/packages/py-platformdirs/package.py +++ b/var/spack/repos/builtin/packages/py-platformdirs/package.py @@ -3,6 +3,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import spack.build_systems.python from spack.package import * @@ -18,9 +19,24 @@ class PyPlatformdirs(PythonPackage): version("2.4.0", sha256="367a5e80b3d04d2428ffa76d33f124cf11e8fff2acdaa9b43d545f5c7d661ef2") version("2.3.0", sha256="15b056538719b1c94bdaccb29e5f81879c7f7f0f4a153f46086d155dffcd4f0f") + variant( + "wheel", + default=False, + sticky=True, + description="Install from wheel (required for bootstrapping Spack)", + ) + depends_on("python@3.7:", when="@2.4.1:", type=("build", "run")) depends_on("python@3.6:", type=("build", "run")) depends_on("py-setuptools@44:", when="@:2.5.1", type="build") depends_on("py-setuptools-scm@5:+toml", when="@:2.5.1", type="build") depends_on("py-hatchling@0.22.0:", when="@2.5.2:", type="build") depends_on("py-hatch-vcs", when="@2.5.2:", type="build") + + +class PythonPipBuilder(spack.build_systems.python.PythonPipBuilder): + @when("+wheel") + def install(self, pkg, spec, prefix): + args = list(filter(lambda x: x != "--no-index", self.std_args(self.pkg))) + args += [f"--prefix={prefix}", self.spec.format("platformdirs=={version}")] + pip(*args) |