summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2023-02-07 21:30:06 -0700
committerGitHub <noreply@github.com>2023-02-07 22:30:06 -0600
commitf5ed18f6a3b58cd4e32a2d2c7ae56dfd18d6de69 (patch)
treec602415a957adef748e7f2841e374f1d4a302caf
parentccd11666c6b840aa878133625745baf2e1edc618 (diff)
downloadspack-f5ed18f6a3b58cd4e32a2d2c7ae56dfd18d6de69.tar.gz
spack-f5ed18f6a3b58cd4e32a2d2c7ae56dfd18d6de69.tar.bz2
spack-f5ed18f6a3b58cd4e32a2d2c7ae56dfd18d6de69.tar.xz
spack-f5ed18f6a3b58cd4e32a2d2c7ae56dfd18d6de69.zip
py-installer: bootstrap without pip (#35341)
* py-installer: bootstrap without pip * [@spackbot] updating style on behalf of adamjstewart --------- Co-authored-by: adamjstewart <adamjstewart@users.noreply.github.com>
-rw-r--r--var/spack/repos/builtin/packages/py-installer/package.py39
1 files changed, 33 insertions, 6 deletions
diff --git a/var/spack/repos/builtin/packages/py-installer/package.py b/var/spack/repos/builtin/packages/py-installer/package.py
index 4bed499aa0..30a4a62072 100644
--- a/var/spack/repos/builtin/packages/py-installer/package.py
+++ b/var/spack/repos/builtin/packages/py-installer/package.py
@@ -3,16 +3,43 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+import os
+
from spack.package import *
-class PyInstaller(PythonPackage):
+class PyInstaller(Package, PythonExtension):
"""A library for installing Python wheels."""
- homepage = "https://github.com/pradyunsg/installer"
- pypi = "installer/installer-0.4.0.tar.gz"
+ homepage = "https://github.com/pypa/installer"
+ url = (
+ "https://files.pythonhosted.org/packages/py3/i/installer/installer-0.6.0-py3-none-any.whl"
+ )
+ list_url = "https://pypi.org/simple/installer/"
+
+ version(
+ "0.6.0",
+ sha256="ae7c62d1d6158b5c096419102ad0d01fdccebf857e784cee57f94165635fe038",
+ expand=False,
+ )
+
+ extends("python")
+
+ def install(self, spec, prefix):
+ # To build and install installer from source, you need flit-core, build, and installer
+ # already installed. We get around this by using a pre-built wheel to install itself.
+ # See https://github.com/pypa/installer/issues/150 for details.
+
+ # We can't do this in setup_build_environment because self.stage.archive_file is undefined
+ wheel = self.stage.archive_file
+ path = os.environ.get("PYTHONPATH", "")
+ os.environ["PYTHONPATH"] = os.pathsep.join([wheel, path])
- version("0.4.0", sha256="17d7ca174039fbd85f268e16042e3132ebb03d91e1bbe0f63b9ec6b40619414a")
+ args = ["-m", "installer", "--prefix", prefix, wheel]
+ python(*args)
- depends_on("python@2.7,3.5:", type=("build", "run"))
- depends_on("py-flit-core@2", type="build")
+ def setup_dependent_package(self, module, dependent_spec):
+ installer = dependent_spec["python"].command
+ installer.add_default_arg("-m")
+ installer.add_default_arg("installer")
+ setattr(module, "installer", installer)