Skip to content

Commit

Permalink
py-pyside: fix build with python3.8 (spack#38886)
Browse files Browse the repository at this point in the history
* py-pyside: fix build for version 1.2.2

* Remove check for python version

* Fix style

* Remove unnecessary patch

* Update var/spack/repos/builtin/packages/py-pyside/package.py

Co-authored-by: Adam J. Stewart <[email protected]>

* Update var/spack/repos/builtin/packages/py-pyside/package.py

Co-authored-by: Adam J. Stewart <[email protected]>

* Remove py-markupsafe conflict

* Update var/spack/repos/builtin/packages/py-pyside/package.py

Co-authored-by: Adam J. Stewart <[email protected]>

* Update var/spack/repos/builtin/packages/py-pyside/package.py

Co-authored-by: Adam J. Stewart <[email protected]>

* Move python check removal below suprocess patch

* Remove preference of 1.2.2

---------

Co-authored-by: Adam J. Stewart <[email protected]>
  • Loading branch information
manuelakuhn and adamjstewart authored Jul 17, 2023
1 parent 1730bca commit 1fa60a6
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions var/spack/repos/builtin/packages/py-pyside/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,19 @@ class PyPyside(PythonPackage):
"1.2.4", sha256="1421bc1bf612c396070de9e1ffe227c07c1f3129278bc7d30c754b5146be2433"
) # rpath problems

# v1.2.2 does not work with Python3
version(
"1.2.2",
sha256="53129fd85e133ef630144c0598d25c451eab72019cdcb1012f2aec773a3f25be",
preferred=True,
)

depends_on("cmake", type="build")
version("1.2.2", sha256="53129fd85e133ef630144c0598d25c451eab72019cdcb1012f2aec773a3f25be")

# to prevent error: 'PyTypeObject' {aka 'struct _typeobject'} has no member
# named 'tp_print'
depends_on("python@:3.8", type=("build", "run"))
depends_on("py-setuptools", type="build")
# in newer pip versions --install-option does not exist
depends_on("py-pip@:23.0", type="build")
depends_on("[email protected]:", type="build")

depends_on("py-sphinx", type=("build", "run"))
depends_on("py-sphinx@:3.5.0", type=("build", "run"), when="@:1.2.2")
depends_on("qt@4.5:4.9")
depends_on("qt@4.6:4.8")
depends_on("[email protected]:")
depends_on("[email protected]:")

Expand All @@ -59,6 +57,9 @@ def patch(self):
)
filter_file("^ if subprocess.mswindows:", " if mswindows:", "popenasync.py")

# Remove check for python version because the above patch adds support for newer versions
filter_file("^check_allowed_python_version()", "", "setup.py")

# Add Spack's standard CMake args to the sub-builds.
# They're called BY setup.py so we have to patch it.
filter_file(
Expand All @@ -84,14 +85,5 @@ def patch(self):
# PySide can't find the Shiboken library, even though it comes
# bundled with it and is installed in the same directory.

# PySide does not provide official support for
# Python 3.5, but it should work fine
filter_file(
"'Programming Language :: Python :: 3.4'",
"'Programming Language :: Python :: 3.4',\r\n "
"'Programming Language :: Python :: 3.5'",
"setup.py",
)

def install_options(self, spec, prefix):
return ["--jobs={0}".format(make_jobs)]

0 comments on commit 1fa60a6

Please sign in to comment.