std_pip_args: use PythonPipBuilder.std_args(...) instead (#47260)
This commit is contained in:
parent
4de5b664cd
commit
161b2d7cb0
@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -76,5 +77,4 @@ def install(self, spec, prefix):
|
|||||||
make("install")
|
make("install")
|
||||||
|
|
||||||
if spec.satisfies("+python"):
|
if spec.satisfies("+python"):
|
||||||
args = std_pip_args + ["--prefix=" + prefix, "."]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={prefix}", ".")
|
||||||
pip(*args)
|
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from spack.build_systems import autotools, cmake, python
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -91,7 +92,7 @@ def setup_run_environment(self, env):
|
|||||||
env.append_path("LD_LIBRARY_PATH", os.path.join(python_platlib, "faiss"))
|
env.append_path("LD_LIBRARY_PATH", os.path.join(python_platlib, "faiss"))
|
||||||
|
|
||||||
|
|
||||||
class CMakeBuilder(spack.build_systems.cmake.CMakeBuilder):
|
class CMakeBuilder(cmake.CMakeBuilder):
|
||||||
def cmake_args(self):
|
def cmake_args(self):
|
||||||
spec = self.spec
|
spec = self.spec
|
||||||
args = [
|
args = [
|
||||||
@ -113,20 +114,19 @@ def install(self, pkg, spec, prefix):
|
|||||||
super().install(pkg, spec, prefix)
|
super().install(pkg, spec, prefix)
|
||||||
if spec.satisfies("+python"):
|
if spec.satisfies("+python"):
|
||||||
|
|
||||||
class CustomPythonPipBuilder(spack.build_systems.python.PythonPipBuilder):
|
class CustomPythonPipBuilder(python.PythonPipBuilder):
|
||||||
def __init__(self, pkg, build_dirname):
|
def __init__(self, pkg, build_dirname):
|
||||||
spack.build_systems.python.PythonPipBuilder.__init__(self, pkg)
|
python.PythonPipBuilder.__init__(self, pkg)
|
||||||
self.build_dirname = build_dirname
|
self.build_dirname = build_dirname
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def build_directory(self):
|
def build_directory(self):
|
||||||
return os.path.join(self.pkg.stage.path, self.build_dirname, "faiss", "python")
|
return os.path.join(self.pkg.stage.path, self.build_dirname, "faiss", "python")
|
||||||
|
|
||||||
customPip = CustomPythonPipBuilder(pkg, self.build_dirname)
|
CustomPythonPipBuilder(pkg, self.build_dirname).install(pkg, spec, prefix)
|
||||||
customPip.install(pkg, spec, prefix)
|
|
||||||
|
|
||||||
|
|
||||||
class AutotoolsBuilder(spack.build_systems.autotools.AutotoolsBuilder):
|
class AutotoolsBuilder(autotools.AutotoolsBuilder):
|
||||||
def configure_args(self):
|
def configure_args(self):
|
||||||
args = []
|
args = []
|
||||||
args.extend(self.with_or_without("cuda", activation_value="prefix"))
|
args.extend(self.with_or_without("cuda", activation_value="prefix"))
|
||||||
@ -156,8 +156,7 @@ def install(self, pkg, spec, prefix):
|
|||||||
|
|
||||||
if self.spec.satisfies("+python"):
|
if self.spec.satisfies("+python"):
|
||||||
with working_dir("python"):
|
with working_dir("python"):
|
||||||
args = std_pip_args + ["--prefix=" + prefix, "."]
|
pip(*python.PythonPipBuilder.std_args(pkg), f"--prefix={prefix}", ".")
|
||||||
pip(*args)
|
|
||||||
|
|
||||||
if "+tests" not in self.spec:
|
if "+tests" not in self.spec:
|
||||||
return
|
return
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
from spack.pkg.builtin.boost import Boost
|
from spack.pkg.builtin.boost import Boost
|
||||||
|
|
||||||
@ -194,5 +195,4 @@ def setup_run_environment(self, env):
|
|||||||
def install_python_interface(self):
|
def install_python_interface(self):
|
||||||
if self.spec.satisfies("+python"):
|
if self.spec.satisfies("+python"):
|
||||||
with working_dir("python"):
|
with working_dir("python"):
|
||||||
args = std_pip_args + ["--prefix=" + self.prefix, "."]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", ".")
|
||||||
pip(*args)
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -59,8 +60,7 @@ def python_install(self):
|
|||||||
if self.spec.satisfies("+python"):
|
if self.spec.satisfies("+python"):
|
||||||
pydir = join_path(self.stage.source_path, "python")
|
pydir = join_path(self.stage.source_path, "python")
|
||||||
with working_dir(pydir):
|
with working_dir(pydir):
|
||||||
args = std_pip_args + ["--prefix=" + self.prefix, "."]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", ".")
|
||||||
pip(*args)
|
|
||||||
|
|
||||||
def cmake_args(self):
|
def cmake_args(self):
|
||||||
args = []
|
args = []
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -40,5 +41,4 @@ def install_targets(self):
|
|||||||
@run_after("install")
|
@run_after("install")
|
||||||
def python_install(self):
|
def python_install(self):
|
||||||
if "+python" in self.spec:
|
if "+python" in self.spec:
|
||||||
args = std_pip_args + ["--prefix=" + self.prefix, "."]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", ".")
|
||||||
pip(*args)
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from spack.build_environment import optimization_flags
|
from spack.build_environment import optimization_flags
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -1003,5 +1004,4 @@ def install_python(self):
|
|||||||
os.environ["LAMMPS_VERSION_FILE"] = join_path(
|
os.environ["LAMMPS_VERSION_FILE"] = join_path(
|
||||||
self.stage.source_path, "src", "version.h"
|
self.stage.source_path, "src", "version.h"
|
||||||
)
|
)
|
||||||
args = std_pip_args + ["--prefix=" + self.prefix, "."]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", ".")
|
||||||
pip(*args)
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -126,5 +127,4 @@ def cmake_args(self):
|
|||||||
def install_python(self):
|
def install_python(self):
|
||||||
if "+python" in self.spec:
|
if "+python" in self.spec:
|
||||||
with working_dir("python"):
|
with working_dir("python"):
|
||||||
args = std_pip_args + ["--prefix=" + prefix, "."]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", ".")
|
||||||
pip(*args)
|
|
||||||
|
@ -48,6 +48,5 @@ def install(self, spec, prefix):
|
|||||||
|
|
||||||
install("./nvtx-config.cmake", prefix) # added by the patch above
|
install("./nvtx-config.cmake", prefix) # added by the patch above
|
||||||
|
|
||||||
args = std_pip_args + ["--prefix=" + prefix, "."]
|
|
||||||
with working_dir(self.build_directory):
|
with working_dir(self.build_directory):
|
||||||
pip(*args)
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", ".")
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -132,8 +133,7 @@ def cmake_args(self):
|
|||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
with working_dir("python"):
|
with working_dir("python"):
|
||||||
args = std_pip_args + ["--prefix=" + prefix, "."]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", ".")
|
||||||
pip(*args)
|
|
||||||
|
|
||||||
# Older versions do not install correctly
|
# Older versions do not install correctly
|
||||||
if self.spec.satisfies("@:0.4.3"):
|
if self.spec.satisfies("@:0.4.3"):
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
rocm_dependencies = [
|
rocm_dependencies = [
|
||||||
@ -194,7 +195,6 @@ def install(self, spec, prefix):
|
|||||||
|
|
||||||
python(*args)
|
python(*args)
|
||||||
with working_dir(self.wrapped_package_object.tmp_path):
|
with working_dir(self.wrapped_package_object.tmp_path):
|
||||||
args = std_pip_args + ["--prefix=" + self.prefix, "."]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", ".")
|
||||||
pip(*args)
|
|
||||||
remove_linked_tree(self.wrapped_package_object.tmp_path)
|
remove_linked_tree(self.wrapped_package_object.tmp_path)
|
||||||
remove_linked_tree(self.wrapped_package_object.buildtmp)
|
remove_linked_tree(self.wrapped_package_object.buildtmp)
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -199,6 +200,5 @@ def install(self, spec, prefix):
|
|||||||
build_pip_package("--src", buildpath)
|
build_pip_package("--src", buildpath)
|
||||||
|
|
||||||
with working_dir(buildpath):
|
with working_dir(buildpath):
|
||||||
args = std_pip_args + ["--prefix=" + prefix, "."]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", ".")
|
||||||
pip(*args)
|
|
||||||
remove_linked_tree(self.tmp_path)
|
remove_linked_tree(self.tmp_path)
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -52,11 +53,10 @@ def cmake_args(self):
|
|||||||
|
|
||||||
@run_after("install")
|
@run_after("install")
|
||||||
def install_python(self):
|
def install_python(self):
|
||||||
args = std_pip_args + ["--prefix=" + prefix, "."]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", ".")
|
||||||
pip(*args)
|
|
||||||
with working_dir(join_path(self.build_directory, "python")):
|
with working_dir(join_path(self.build_directory, "python")):
|
||||||
make("MeldPluginPatch")
|
make("MeldPluginPatch")
|
||||||
pip(*args)
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", ".")
|
||||||
for _, _, files in os.walk(self.spec["openmm"].prefix.lib.plugins):
|
for _, _, files in os.walk(self.spec["openmm"].prefix.lib.plugins):
|
||||||
for f in files:
|
for f in files:
|
||||||
os.symlink(
|
os.symlink(
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -211,6 +212,5 @@ def cmake_args(self):
|
|||||||
@run_after("install")
|
@run_after("install")
|
||||||
def install_python(self):
|
def install_python(self):
|
||||||
"""Install everything from build directory."""
|
"""Install everything from build directory."""
|
||||||
args = std_pip_args + ["--prefix=" + prefix, "."]
|
|
||||||
with working_dir(self.build_directory):
|
with working_dir(self.build_directory):
|
||||||
pip(*args)
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", ".")
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -57,5 +58,4 @@ def install(self, spec, prefix):
|
|||||||
with working_dir(self.build_directory):
|
with working_dir(self.build_directory):
|
||||||
make("install")
|
make("install")
|
||||||
with working_dir(join_path(self.build_directory, "python")):
|
with working_dir(join_path(self.build_directory, "python")):
|
||||||
args = std_pip_args + ["--prefix=" + prefix, "."]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", ".")
|
||||||
pip(*args)
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -143,8 +144,7 @@ def build(self, pkg, spec, prefix):
|
|||||||
python("setup.py", "build_ext", *args)
|
python("setup.py", "build_ext", *args)
|
||||||
|
|
||||||
def install(self, pkg, spec, prefix):
|
def install(self, pkg, spec, prefix):
|
||||||
pip_args = std_pip_args + [f"--prefix={prefix}", "."]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", ".")
|
||||||
pip(*pip_args)
|
|
||||||
super().install(pkg, spec, prefix)
|
super().install(pkg, spec, prefix)
|
||||||
|
|
||||||
@run_after("install")
|
@run_after("install")
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -113,8 +114,7 @@ def build(self, pkg, spec, prefix):
|
|||||||
python("setup.py", "build_ext", *args)
|
python("setup.py", "build_ext", *args)
|
||||||
|
|
||||||
def install(self, pkg, spec, prefix):
|
def install(self, pkg, spec, prefix):
|
||||||
pip_args = std_pip_args + ["--prefix=" + prefix, "."]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", ".")
|
||||||
pip(*pip_args)
|
|
||||||
super().install(pkg, spec, prefix)
|
super().install(pkg, spec, prefix)
|
||||||
|
|
||||||
@run_after("install")
|
@run_after("install")
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -76,15 +77,14 @@ def install(self, spec, prefix):
|
|||||||
# itself, see:
|
# itself, see:
|
||||||
# https://discuss.python.org/t/bootstrapping-a-specific-version-of-pip/12306
|
# https://discuss.python.org/t/bootstrapping-a-specific-version-of-pip/12306
|
||||||
whl = self.stage.archive_file
|
whl = self.stage.archive_file
|
||||||
args = std_pip_args + ["--prefix=" + prefix, whl]
|
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
# On Windows for newer versions of pip, you must bootstrap pip first.
|
# On Windows for newer versions of pip, you must bootstrap pip first.
|
||||||
# In order to achieve this, use the pip.pyz zipapp version of pip to
|
# In order to achieve this, use the pip.pyz zipapp version of pip to
|
||||||
# bootstrap the pip wheel install.
|
# bootstrap the pip wheel install.
|
||||||
args.insert(0, os.path.join(self.stage.source_path, "pip.pyz"))
|
script = os.path.join(self.stage.source_path, "pip.pyz")
|
||||||
else:
|
else:
|
||||||
args.insert(0, os.path.join(whl, "pip"))
|
script = os.path.join(whl, "pip")
|
||||||
python(*args)
|
python(script, *PythonPipBuilder.std_args(self), f"--prefix={prefix}", whl)
|
||||||
|
|
||||||
def setup_dependent_package(self, module, dependent_spec: Spec):
|
def setup_dependent_package(self, module, dependent_spec: Spec):
|
||||||
setattr(module, "pip", python.with_default_args("-m", "pip"))
|
setattr(module, "pip", python.with_default_args("-m", "pip"))
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -59,11 +60,9 @@ def setup_build_environment(self, env):
|
|||||||
|
|
||||||
@run_before("install")
|
@run_before("install")
|
||||||
def install_python(self):
|
def install_python(self):
|
||||||
prefix = self.prefix
|
|
||||||
for subpackage in ["packageTools", "base", "metisCy", "fem", "multilevelSolver", "nl"]:
|
for subpackage in ["packageTools", "base", "metisCy", "fem", "multilevelSolver", "nl"]:
|
||||||
with working_dir(subpackage):
|
with working_dir(subpackage):
|
||||||
args = std_pip_args + ["--prefix=" + prefix, "."]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", ".")
|
||||||
pip(*args)
|
|
||||||
|
|
||||||
@run_after("install")
|
@run_after("install")
|
||||||
def install_additional_files(self):
|
def install_additional_files(self):
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -95,5 +96,4 @@ def install(self, spec, prefix):
|
|||||||
#
|
#
|
||||||
# We work around this issue by installing setuptools from wheels
|
# We work around this issue by installing setuptools from wheels
|
||||||
whl = self.stage.archive_file
|
whl = self.stage.archive_file
|
||||||
args = ["-m", "pip"] + std_pip_args + ["--prefix=" + prefix, whl]
|
python("-m", "pip", *PythonPipBuilder.std_args(self), f"--prefix={prefix}", whl)
|
||||||
python(*args)
|
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
import glob
|
import glob
|
||||||
|
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -60,5 +61,4 @@ def install(self, spec, prefix):
|
|||||||
)
|
)
|
||||||
|
|
||||||
wheel = glob.glob("*.whl")[0]
|
wheel = glob.glob("*.whl")[0]
|
||||||
args = std_pip_args + ["--prefix=" + prefix, wheel]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={prefix}", wheel)
|
||||||
pip(*args)
|
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -97,6 +98,5 @@ def install(self, spec, prefix):
|
|||||||
buildpath = join_path(self.stage.source_path, "spack-build")
|
buildpath = join_path(self.stage.source_path, "spack-build")
|
||||||
build_pip_package("--src", buildpath)
|
build_pip_package("--src", buildpath)
|
||||||
with working_dir(buildpath):
|
with working_dir(buildpath):
|
||||||
args = std_pip_args + ["--prefix=" + prefix, "."]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", ".")
|
||||||
pip(*args)
|
|
||||||
remove_linked_tree(self.tmp_path)
|
remove_linked_tree(self.tmp_path)
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -78,8 +79,7 @@ def install(self, spec, prefix):
|
|||||||
)
|
)
|
||||||
|
|
||||||
with working_dir(insttmp_path):
|
with working_dir(insttmp_path):
|
||||||
args = std_pip_args + ["--prefix=" + prefix, "."]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", ".")
|
||||||
pip(*args)
|
|
||||||
|
|
||||||
remove_linked_tree(tmp_path)
|
remove_linked_tree(tmp_path)
|
||||||
remove_linked_tree(insttmp_path)
|
remove_linked_tree(insttmp_path)
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -118,7 +119,6 @@ def install(self, spec, prefix):
|
|||||||
bazel(*args)
|
bazel(*args)
|
||||||
|
|
||||||
with working_dir(join_path("bazel-bin", "pip_pkg.runfiles", "tensorflow_probability")):
|
with working_dir(join_path("bazel-bin", "pip_pkg.runfiles", "tensorflow_probability")):
|
||||||
args = std_pip_args + ["--prefix=" + prefix, "."]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", ".")
|
||||||
pip(*args)
|
|
||||||
|
|
||||||
remove_linked_tree(self.tmp_path)
|
remove_linked_tree(self.tmp_path)
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
from spack.build_environment import optimization_flags
|
from spack.build_environment import optimization_flags
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
rocm_dependencies = [
|
rocm_dependencies = [
|
||||||
@ -888,12 +889,10 @@ def install(self, spec, prefix):
|
|||||||
)
|
)
|
||||||
with working_dir(buildpath):
|
with working_dir(buildpath):
|
||||||
wheel = glob.glob("*.whl")[0]
|
wheel = glob.glob("*.whl")[0]
|
||||||
args = std_pip_args + ["--prefix=" + prefix, wheel]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", wheel)
|
||||||
pip(*args)
|
|
||||||
else:
|
else:
|
||||||
buildpath = join_path(self.stage.source_path, "spack-build")
|
buildpath = join_path(self.stage.source_path, "spack-build")
|
||||||
with working_dir(buildpath):
|
with working_dir(buildpath):
|
||||||
args = std_pip_args + ["--prefix=" + prefix, "."]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", ".")
|
||||||
pip(*args)
|
|
||||||
|
|
||||||
remove_linked_tree(tmp_path)
|
remove_linked_tree(tmp_path)
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -40,8 +41,7 @@ def cmake_args(self):
|
|||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
with working_dir("python"):
|
with working_dir("python"):
|
||||||
args = std_pip_args + ["--prefix=" + prefix, "."]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", ".")
|
||||||
pip(*args)
|
|
||||||
|
|
||||||
def setup_run_environment(self, env):
|
def setup_run_environment(self, env):
|
||||||
# Prevent TensorFlow from taking over the whole GPU
|
# Prevent TensorFlow from taking over the whole GPU
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -43,5 +44,4 @@ def install(self, spec, prefix):
|
|||||||
# To build wheel from source, you need setuptools and wheel already installed.
|
# To build wheel from source, you need setuptools and wheel already installed.
|
||||||
# We get around this by using a pre-built wheel, see:
|
# We get around this by using a pre-built wheel, see:
|
||||||
# https://discuss.python.org/t/bootstrapping-a-specific-version-of-pip/12306
|
# https://discuss.python.org/t/bootstrapping-a-specific-version-of-pip/12306
|
||||||
args = std_pip_args + ["--prefix=" + prefix, self.stage.archive_file]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={prefix}", self.stage.archive_file)
|
||||||
pip(*args)
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
from spack.pkg.builtin.boost import Boost
|
from spack.pkg.builtin.boost import Boost
|
||||||
|
|
||||||
@ -190,5 +191,4 @@ def install_args(self, spec, prefix):
|
|||||||
@run_after("install")
|
@run_after("install")
|
||||||
def python_install(self):
|
def python_install(self):
|
||||||
if "+python" in self.spec:
|
if "+python" in self.spec:
|
||||||
args = std_pip_args + ["--prefix=" + self.prefix, "."]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", ".")
|
||||||
pip(*args)
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -35,8 +36,7 @@ def install(self, spec, prefix):
|
|||||||
cargo = Executable("cargo")
|
cargo = Executable("cargo")
|
||||||
cargo("build", "--release")
|
cargo("build", "--release")
|
||||||
# install python package
|
# install python package
|
||||||
args = std_pip_args + ["--prefix=" + prefix, "."]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={prefix}", ".")
|
||||||
pip(*args)
|
|
||||||
# move sourmash.so into expected place
|
# move sourmash.so into expected place
|
||||||
site_packages = join_path(python_platlib, "sourmash")
|
site_packages = join_path(python_platlib, "sourmash")
|
||||||
lib_ext = "dylib" if spec.platform == "Darwin" else "so"
|
lib_ext = "dylib" if spec.platform == "Darwin" else "so"
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -101,5 +102,4 @@ def install(self, spec, prefix):
|
|||||||
scons("install-lib", *args)
|
scons("install-lib", *args)
|
||||||
|
|
||||||
if spec.satisfies("+python"):
|
if spec.satisfies("+python"):
|
||||||
args = ["-m", "pip"] + std_pip_args + ["--prefix=" + prefix, "build-release/python"]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={prefix}", "build-release/python")
|
||||||
python(*args)
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
from spack.build_systems.python import PythonPipBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -50,5 +51,4 @@ def cmake_args(self):
|
|||||||
def python_install(self):
|
def python_install(self):
|
||||||
if "+python" in self.spec:
|
if "+python" in self.spec:
|
||||||
with working_dir("python"):
|
with working_dir("python"):
|
||||||
args = std_pip_args + ["--prefix=" + self.prefix, "."]
|
pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", ".")
|
||||||
pip(*args)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user