summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2023-07-17 08:03:05 -0500
committerGitHub <noreply@github.com>2023-07-17 08:03:05 -0500
commit2b5a7bb4d7428529d7603d1b711beab0baa76b1c (patch)
tree3a78dfebeebdd80763273a2569d4087ccf776134 /lib
parente91db7793038b4e7235c8ec7c82244afbb9dfc9e (diff)
downloadspack-2b5a7bb4d7428529d7603d1b711beab0baa76b1c.tar.gz
spack-2b5a7bb4d7428529d7603d1b711beab0baa76b1c.tar.bz2
spack-2b5a7bb4d7428529d7603d1b711beab0baa76b1c.tar.xz
spack-2b5a7bb4d7428529d7603d1b711beab0baa76b1c.zip
Update new PythonPackage template to prefer --config-settings (#38918)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/build_systems/python.py7
-rw-r--r--lib/spack/spack/cmd/create.py15
-rw-r--r--lib/spack/spack/test/cmd/create.py7
3 files changed, 12 insertions, 17 deletions
diff --git a/lib/spack/spack/build_systems/python.py b/lib/spack/spack/build_systems/python.py
index 7a355490f7..01f7bd62be 100644
--- a/lib/spack/spack/build_systems/python.py
+++ b/lib/spack/spack/build_systems/python.py
@@ -401,7 +401,8 @@ class PythonPipBuilder(BaseBuilder):
def config_settings(self, spec, prefix):
"""Configuration settings to be passed to the PEP 517 build backend.
- Requires pip 22.1+, which requires Python 3.7+.
+
+ Requires pip 22.1 or newer.
Args:
spec (spack.spec.Spec): build spec
@@ -415,6 +416,8 @@ class PythonPipBuilder(BaseBuilder):
def install_options(self, spec, prefix):
"""Extra arguments to be supplied to the setup.py install command.
+ Requires pip 23.0 or older.
+
Args:
spec (spack.spec.Spec): build spec
prefix (spack.util.prefix.Prefix): installation prefix
@@ -428,6 +431,8 @@ class PythonPipBuilder(BaseBuilder):
"""Extra global options to be supplied to the setup.py call before the install
or bdist_wheel command.
+ Deprecated in pip 23.1.
+
Args:
spec (spack.spec.Spec): build spec
prefix (spack.util.prefix.Prefix): installation prefix
diff --git a/lib/spack/spack/cmd/create.py b/lib/spack/spack/cmd/create.py
index 41562c98ec..ab84da4151 100644
--- a/lib/spack/spack/cmd/create.py
+++ b/lib/spack/spack/cmd/create.py
@@ -325,6 +325,7 @@ class PythonPackageTemplate(PackageTemplate):
# FIXME: Add a build backend, usually defined in pyproject.toml. If no such file
# exists, use setuptools.
# depends_on("py-setuptools", type="build")
+ # depends_on("py-hatchling", type="build")
# depends_on("py-flit-core", type="build")
# depends_on("py-poetry-core", type="build")
@@ -332,17 +333,11 @@ class PythonPackageTemplate(PackageTemplate):
# depends_on("py-foo", type=("build", "run"))"""
body_def = """\
- def global_options(self, spec, prefix):
- # FIXME: Add options to pass to setup.py
+ def config_settings(self, spec, prefix):
+ # FIXME: Add configuration settings to be passed to the build backend
# FIXME: If not needed, delete this function
- options = []
- return options
-
- def install_options(self, spec, prefix):
- # FIXME: Add options to pass to setup.py install
- # FIXME: If not needed, delete this function
- options = []
- return options"""
+ settings = {}
+ return settings"""
def __init__(self, name, url, *args, **kwargs):
# If the user provided `--name py-numpy`, don't rename it py-py-numpy
diff --git a/lib/spack/spack/test/cmd/create.py b/lib/spack/spack/test/cmd/create.py
index ed7a6404bb..b99d221d02 100644
--- a/lib/spack/spack/test/cmd/create.py
+++ b/lib/spack/spack/test/cmd/create.py
@@ -91,12 +91,7 @@ create = SpackCommand("create")
(
["-t", "python", "/test-python"],
"py-test-python",
- [
- r"PyTestPython(PythonPackage)",
- r'depends_on("py-',
- r"def global_options(self",
- r"def install_options(self",
- ],
+ [r"PyTestPython(PythonPackage)", r'depends_on("py-', r"def config_settings(self"],
),
(
["-t", "qmake", "/test-qmake"],