py-pyqt6: add new package (#32696)

This commit is contained in:
Adam J. Stewart 2023-08-04 18:49:54 -05:00 committed by GitHub
parent 5996aaa4e3
commit 4eed832653
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 187 additions and 136 deletions

View File

@ -32,7 +32,7 @@ By default, these phases run:
.. code-block:: console .. code-block:: console
$ python configure.py --bindir ... --destdir ... $ sip-build --verbose --target-dir ...
$ make $ make
$ make install $ make install
@ -41,30 +41,30 @@ By default, these phases run:
Important files Important files
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
Each SIP package comes with a custom ``configure.py`` build script, Each SIP package comes with a custom configuration file written in Python.
written in Python. This script contains instructions to build the project. For newer packages, this is called ``project.py``, while in older packages,
it may be called ``configure.py``. This script contains instructions to build
the project.
^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^
Build system dependencies Build system dependencies
^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^
``SIPPackage`` requires several dependencies. Python is needed to run ``SIPPackage`` requires several dependencies. Python and SIP are needed at build-time
the ``configure.py`` build script, and to run the resulting Python to run the aforementioned configure script. Python is also needed at run-time to
libraries. Qt is needed to provide the ``qmake`` command. SIP is also actually use the installed Python library. And as we are building Python bindings
needed to build the package. All of these dependencies are automatically for C/C++ libraries, Python is also needed as a link dependency. All of these
added via the base class dependencies are automatically added via the base class.
.. code-block:: python .. code-block:: python
extends('python') extends("python", type=("build", "link", "run"))
depends_on("py-sip", type="build")
depends_on('qt', type='build')
depends_on('py-sip', type='build') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Passing arguments to ``sip-build``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Passing arguments to ``configure.py``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Each phase comes with a ``<phase_args>`` function that can be used to pass Each phase comes with a ``<phase_args>`` function that can be used to pass
arguments to that particular phase. For example, if you need to pass arguments to that particular phase. For example, if you need to pass
@ -73,10 +73,10 @@ arguments to the configure phase, you can use:
.. code-block:: python .. code-block:: python
def configure_args(self): def configure_args(self):
return ['--no-python-dbus'] return ["--no-python-dbus"]
A list of valid options can be found by running ``python configure.py --help``. A list of valid options can be found by running ``sip-build --help``.
^^^^^^^ ^^^^^^^
Testing Testing

View File

@ -7,13 +7,14 @@
import re import re
import llnl.util.tty as tty import llnl.util.tty as tty
from llnl.util.filesystem import find, join_path, working_dir from llnl.util.filesystem import find, working_dir
import spack.builder import spack.builder
import spack.install_test import spack.install_test
import spack.package_base import spack.package_base
from spack.directives import build_system, depends_on, extends from spack.directives import build_system, depends_on, extends
from spack.multimethod import when from spack.multimethod import when
from spack.util.executable import Executable
from ._checks import BaseBuilder, execute_install_time_tests from ._checks import BaseBuilder, execute_install_time_tests
@ -39,9 +40,8 @@ class SIPPackage(spack.package_base.PackageBase):
build_system("sip") build_system("sip")
with when("build_system=sip"): with when("build_system=sip"):
extends("python") extends("python", type=("build", "link", "run"))
depends_on("qt") depends_on("py-sip", type="build")
depends_on("py-sip")
@property @property
def import_modules(self): def import_modules(self):
@ -113,13 +113,13 @@ class SIPBuilder(BaseBuilder):
* install * install
The configure phase already adds a set of default flags. To see more The configure phase already adds a set of default flags. To see more
options, run ``python configure.py --help``. options, run ``sip-build --help``.
""" """
phases = ("configure", "build", "install") phases = ("configure", "build", "install")
#: Names associated with package methods in the old build-system format #: Names associated with package methods in the old build-system format
legacy_methods = ("configure_file", "configure_args", "build_args", "install_args") legacy_methods = ("configure_args", "build_args", "install_args")
#: Names associated with package attributes in the old build-system format #: Names associated with package attributes in the old build-system format
legacy_attributes = ( legacy_attributes = (
@ -130,34 +130,17 @@ class SIPBuilder(BaseBuilder):
"build_directory", "build_directory",
) )
def configure_file(self): build_directory = "build"
"""Returns the name of the configure file to use."""
return "configure.py"
def configure(self, pkg, spec, prefix): def configure(self, pkg, spec, prefix):
"""Configure the package.""" """Configure the package."""
configure = self.configure_file()
args = self.configure_args() # https://www.riverbankcomputing.com/static/Docs/sip/command_line_tools.html
args = ["--verbose", "--target-dir", inspect.getmodule(self.pkg).python_platlib]
args.extend(self.configure_args())
args.extend( sip_build = Executable(spec["py-sip"].prefix.bin.join("sip-build"))
[ sip_build(*args)
"--verbose",
"--confirm-license",
"--qmake",
spec["qt"].prefix.bin.qmake,
"--sip",
spec["py-sip"].prefix.bin.sip,
"--sip-incdir",
join_path(spec["py-sip"].prefix, spec["python"].package.include),
"--bindir",
prefix.bin,
"--destdir",
inspect.getmodule(self.pkg).python_platlib,
]
)
self.pkg.python(configure, *args)
def configure_args(self): def configure_args(self):
"""Arguments to pass to configure.""" """Arguments to pass to configure."""
@ -167,6 +150,7 @@ def build(self, pkg, spec, prefix):
"""Build the package.""" """Build the package."""
args = self.build_args() args = self.build_args()
with working_dir(self.build_directory):
inspect.getmodule(self.pkg).make(*args) inspect.getmodule(self.pkg).make(*args)
def build_args(self): def build_args(self):
@ -177,21 +161,11 @@ def install(self, pkg, spec, prefix):
"""Install the package.""" """Install the package."""
args = self.install_args() args = self.install_args()
inspect.getmodule(self.pkg).make("install", parallel=False, *args) with working_dir(self.build_directory):
inspect.getmodule(self.pkg).make("install", *args)
def install_args(self): def install_args(self):
"""Arguments to pass to install.""" """Arguments to pass to install."""
return [] return []
spack.builder.run_after("install")(execute_install_time_tests) spack.builder.run_after("install")(execute_install_time_tests)
@spack.builder.run_after("install")
def extend_path_setup(self):
# See github issue #14121 and PR #15297
module = self.pkg.spec["py-sip"].variants["module"].value
if module != "sip":
module = module.split(".")[0]
with working_dir(inspect.getmodule(self.pkg).python_platlib):
with open(os.path.join(module, "__init__.py"), "a") as f:
f.write("from pkgutil import extend_path\n")
f.write("__path__ = extend_path(__path__, __name__)\n")

View File

@ -177,13 +177,16 @@ class PyMatplotlib(PythonPackage):
depends_on("tk@8.4:8.5,8.6.2:", when="backend=" + backend, type="run") depends_on("tk@8.4:8.5,8.6.2:", when="backend=" + backend, type="run")
depends_on("python+tkinter", when="backend=" + backend, type="run") depends_on("python+tkinter", when="backend=" + backend, type="run")
# Qt # Qt
# matplotlib/backends/qt_compat.py
for backend in ["qt4agg", "qt4cairo"]: for backend in ["qt4agg", "qt4cairo"]:
depends_on("py-pyqt4@4.6:", when="backend=" + backend, type="run") depends_on("py-pyqt4@4.6:", when="backend=" + backend, type="run")
depends_on("qt+gui", when="backend=" + backend, type="run")
for backend in ["qt5agg", "qt5cairo"]: for backend in ["qt5agg", "qt5cairo"]:
depends_on("py-pyqt5", when="backend=" + backend, type="run") depends_on("py-pyqt5", when="backend=" + backend, type="run")
# https://github.com/spack/spack/pull/32696 depends_on("qt+gui", when="backend=" + backend, type="run")
# for backend in ["qtagg", "qtcairo"]: for backend in ["qtagg", "qtcairo"]:
# depends_on("py-pyqt6@6.1:", when="backend=" + backend, type="run") depends_on("py-pyqt6@6.1:", when="backend=" + backend, type="run")
depends_on("qt-base+gui+widgets", when="backend=" + backend, type="run")
# GTK # GTK
for backend in ["gtk", "gtkagg", "gtkcairo", "gtk3agg", "gtk3cairo", "gtk4agg", "gtk4cairo"]: for backend in ["gtk", "gtkagg", "gtkcairo", "gtk3agg", "gtk3cairo", "gtk4agg", "gtk4cairo"]:
depends_on("py-pygobject", when="backend=" + backend, type="run") depends_on("py-pygobject", when="backend=" + backend, type="run")

View File

@ -12,9 +12,10 @@ class PyPyqtBuilder(PythonPackage):
homepage = "https://www.riverbankcomputing.com/hg/PyQt-builder/" homepage = "https://www.riverbankcomputing.com/hg/PyQt-builder/"
pypi = "PyQt-builder/PyQt-builder-1.12.2.tar.gz" pypi = "PyQt-builder/PyQt-builder-1.12.2.tar.gz"
version("1.15.1", sha256="a2bd3cfbf952e959141dfe55b44b451aa945ca8916d1b773850bb2f9c0fa2985")
version("1.12.2", sha256="f62bb688d70e0afd88c413a8d994bda824e6cebd12b612902d1945c5a67edcd7") version("1.12.2", sha256="f62bb688d70e0afd88c413a8d994bda824e6cebd12b612902d1945c5a67edcd7")
depends_on("python@3.5:", type=("build", "run"))
depends_on("py-setuptools@30.3:", type="build") depends_on("py-setuptools@30.3:", type="build")
depends_on("py-packaging", type=("build", "run")) depends_on("py-packaging", type=("build", "run"))
depends_on("py-sip@6.7:6", when="@1.15:", type=("build", "run"))
depends_on("py-sip@6.3:6", type=("build", "run")) depends_on("py-sip@6.3:6", type=("build", "run"))

View File

@ -13,11 +13,7 @@ class PyPyqt4(SIPPackage):
against Qt v5.""" against Qt v5."""
homepage = "https://www.riverbankcomputing.com/software/pyqt/intro" homepage = "https://www.riverbankcomputing.com/software/pyqt/intro"
url = ( url = "https://www.riverbankcomputing.com/static/Downloads/PyQt4/4.12.3/PyQt4_gpl_x11-4.12.3.tar.gz"
"http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.12.3/PyQt4_gpl_x11-4.12.3.tar.gz"
)
sip_module = "PyQt4.sip"
version("4.12.3", sha256="a00f5abef240a7b5852b7924fa5fdf5174569525dc076cd368a566619e56d472") version("4.12.3", sha256="a00f5abef240a7b5852b7924fa5fdf5174569525dc076cd368a566619e56d472")
version( version(
@ -33,16 +29,28 @@ class PyPyqt4(SIPPackage):
# Requires distutils # Requires distutils
depends_on("python@:3.11", type=("build", "link", "run")) depends_on("python@:3.11", type=("build", "link", "run"))
depends_on("qt@4") depends_on("qt@4.1:4")
depends_on("qt@4.1:", when="@4.12.3")
# configure-ng.py
depends_on("py-sip@4.19.12:4.19.18 module=PyQt4.sip") depends_on("py-sip@4.19.12:4.19.18 module=PyQt4.sip")
# https://www.riverbankcomputing.com/static/Docs/PyQt4/installation.html build_directory = "."
def configure_file(self):
return "configure-ng.py"
def configure_args(self): def configure_args(self):
# https://www.riverbankcomputing.com/static/Docs/PyQt4/installation.html
args = [ args = [
"--verbose",
"--confirm-license",
"--qmake",
self.spec["qt"].prefix.bin.qmake,
"--sip",
self.spec["py-sip"].prefix.bin.sip,
"--sip-incdir",
join_path(self.spec["py-sip"].prefix, self.spec["python"].package.include),
"--bindir",
self.prefix.bin,
"--destdir",
python_platlib,
"--pyuic4-interpreter", "--pyuic4-interpreter",
self.spec["python"].command.path, self.spec["python"].command.path,
"--sipdir", "--sipdir",
@ -53,3 +61,18 @@ def configure_args(self):
if "+qsci_api" in self.spec: if "+qsci_api" in self.spec:
args.extend(["--qsci-api", "--qsci-api-destdir", self.prefix.share.qsci]) args.extend(["--qsci-api", "--qsci-api-destdir", self.prefix.share.qsci])
return args return args
def configure(self, spec, prefix):
python("configure-ng.py", *self.configure_args())
@run_after("install")
def extend_path_setup(self):
# https://github.com/spack/spack/issues/14121
# https://github.com/spack/spack/pull/15297
# Same code comes by default with py-pyqt5 and py-pyqt6
text = """
# Support PyQt4 sub-packages that have been created by setuptools.
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
"""
with open(join_path(python_platlib, "PyQt4", "__init__.py"), "a") as f:
f.write(text)

View File

@ -10,9 +10,9 @@ class PyPyqt5Sip(PythonPackage):
"""The sip module support for PyQt5.""" """The sip module support for PyQt5."""
homepage = "https://www.riverbankcomputing.com/software/sip/" homepage = "https://www.riverbankcomputing.com/software/sip/"
pypi = "PyQt5_sip/PyQt5_sip-12.9.0.tar.gz" pypi = "PyQt5-sip/PyQt5_sip-12.9.0.tar.gz"
version("12.12.1", sha256="8fdc6e0148abd12d977a1d3828e7b79aae958e83c6cb5adae614916d888a6b10")
version("12.9.0", sha256="d3e4489d7c2b0ece9d203ae66e573939f7f60d4d29e089c9f11daa17cfeaae32") version("12.9.0", sha256="d3e4489d7c2b0ece9d203ae66e573939f7f60d4d29e089c9f11daa17cfeaae32")
depends_on("python@3.5:", type=("build", "run")) depends_on("py-setuptools@30.3:", type="build")
depends_on("py-setuptools", type="build")

View File

@ -12,44 +12,36 @@ class PyPyqt5(SIPPackage):
Windows, OS X, Linux, iOS and Android. PyQt5 supports Qt v5.""" Windows, OS X, Linux, iOS and Android. PyQt5 supports Qt v5."""
homepage = "https://www.riverbankcomputing.com/software/pyqt/intro" homepage = "https://www.riverbankcomputing.com/software/pyqt/intro"
url = ( url = "https://files.pythonhosted.org/packages/source/P/PyQt5/PyQt5-5.15.9.tar.gz"
"https://www.riverbankcomputing.com/static/Downloads/PyQt5/5.13.0/PyQt5_gpl-5.13.0.tar.gz" list_url = "https://pypi.org/simple/PyQt5/"
version("5.15.9", sha256="dc41e8401a90dc3e2b692b411bd5492ab559ae27a27424eed4bd3915564ec4c0")
version(
"5.13.1",
sha256="54b7f456341b89eeb3930e786837762ea67f235e886512496c4152ebe106d4af",
deprecated=True,
)
version(
"5.13.0",
sha256="0cdbffe5135926527b61cc3692dd301cd0328dd87eeaf1313e610787c46faff9",
deprecated=True,
)
version(
"5.12.3",
sha256="0db0fa37debab147450f9e052286f7a530404e2aaddc438e97a7dcdf56292110",
deprecated=True,
) )
list_url = "https://www.riverbankcomputing.com/software/pyqt/download5"
sip_module = "PyQt5.sip" # pyproject.toml
depends_on("py-sip@6.6.2:6", type="build")
depends_on("py-pyqt-builder@1.14.1:1", type="build")
version("5.13.1", sha256="54b7f456341b89eeb3930e786837762ea67f235e886512496c4152ebe106d4af") # PKG-INFO
version("5.13.0", sha256="0cdbffe5135926527b61cc3692dd301cd0328dd87eeaf1313e610787c46faff9") depends_on("py-pyqt5-sip@12.11:12", type=("build", "run"))
version("5.12.3", sha256="0db0fa37debab147450f9e052286f7a530404e2aaddc438e97a7dcdf56292110")
# API files can be installed regardless if Qscintilla is installed or not # README
variant("qsci_api", default=False, description="Install PyQt API file for QScintilla") depends_on("qt@5+opengl")
# Without opengl support, I got the following error:
# sip: QOpenGLFramebufferObject is undefined
depends_on("qt@5:+opengl")
depends_on("python@2.6:", type=("build", "run"))
depends_on("py-sip module=PyQt5.sip", type=("build", "run"))
depends_on("py-sip@:4.19.18 module=PyQt5.sip", type=("build", "run"), when="@:5.13.0")
# https://www.riverbankcomputing.com/static/Docs/PyQt5/installation.html
def configure_args(self): def configure_args(self):
args = [ # https://www.riverbankcomputing.com/static/Docs/PyQt5/installation.html
"--pyuic5-interpreter", return ["--confirm-license", "--no-make", "--qmake", self.spec["qt"].prefix.bin.qmake]
self.spec["python"].command.path,
"--sipdir",
self.prefix.share.sip.PyQt5,
"--designer-plugindir",
self.prefix.plugins.designer,
"--qml-plugindir",
self.prefix.plugins.PyQt5,
"--stubsdir",
join_path(python_platlib, "PyQt5"),
]
if "+qsci_api" in self.spec:
args.extend(["--qsci-api", "--qsci-api-destdir", self.prefix.share.qsci])
return args
def setup_run_environment(self, env):
env.prepend_path("QT_PLUGIN_PATH", self.prefix.plugins)

View File

@ -0,0 +1,17 @@
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class PyPyqt6Sip(PythonPackage):
"""The sip module support for PyQt6."""
homepage = "https://www.riverbankcomputing.com/software/sip/"
pypi = "PyQt6-sip/PyQt6_sip-13.5.1.tar.gz"
version("13.5.1", sha256="d1e9141752966669576d04b37ba0b122abbc41cc9c35493751028d7d91c4dd49")
depends_on("py-setuptools@30.3:", type="build")

View File

@ -0,0 +1,36 @@
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class PyPyqt6(SIPPackage):
"""PyQt6 is a comprehensive set of Python bindings for Qt v6."""
homepage = "https://www.riverbankcomputing.com/software/pyqt/"
url = "https://files.pythonhosted.org/packages/source/P/PyQt6/PyQt6-6.5.1.tar.gz"
list_url = "https://pypi.org/simple/PyQt6/"
version("6.5.1", sha256="e166a0568c27bcc8db00271a5043936226690b6a4a74ce0a5caeb408040a97c3")
# pyproject.toml
depends_on("py-sip@6.5:6", type="build")
depends_on("py-pyqt-builder@1.15:1", type="build")
# PKG-INFO
depends_on("py-pyqt6-sip@13.4:13", type=("build", "run"))
# README
depends_on("qt-base@6")
def setup_build_environment(self, env):
# Detected system locale encoding (US-ASCII, locale "C") is not UTF-8.
# Qt shall use a UTF-8 locale ("UTF-8") instead. If this causes problems,
# reconfigure your locale. See the locale(1) manual for more information.
env.set("LC_ALL", "en_US.UTF-8")
def configure_args(self):
# https://www.riverbankcomputing.com/static/Docs/PyQt6/installation.html
return ["--confirm-license", "--no-make", "--qmake", self.spec["qt-base"].prefix.bin.qmake]

View File

@ -14,9 +14,11 @@ class PySip(PythonPackage):
homepage = "https://www.riverbankcomputing.com/software/sip" homepage = "https://www.riverbankcomputing.com/software/sip"
pypi = "sip/sip-6.4.0.tar.gz" pypi = "sip/sip-6.4.0.tar.gz"
version("6.7.9", sha256="35d51fc10f599d3696abb50f29d068ad04763df7b77808c76b74597660f99b17")
version("6.6.2", sha256="0e3efac1c5dfd8e525ae57140927df26993e13f58b89d1577c314f4105bfd90d") version("6.6.2", sha256="0e3efac1c5dfd8e525ae57140927df26993e13f58b89d1577c314f4105bfd90d")
version("6.4.0", sha256="42ec368520b8da4a0987218510b1b520b4981e4405086c1be384733affc2bcb0") version("6.4.0", sha256="42ec368520b8da4a0987218510b1b520b4981e4405086c1be384733affc2bcb0")
version("5.5.0", sha256="5d024c419b30fea8a6de8c71a560c7ab0bc3c221fbfb14d55a5b865bd58eaac5") version("5.5.0", sha256="5d024c419b30fea8a6de8c71a560c7ab0bc3c221fbfb14d55a5b865bd58eaac5")
version("4.19.25", sha256="3d36986f7327b7b966bb6eacf22bcf6e4d0a3d24e392276ef92af89988818062")
version("4.19.21", sha256="3bfd58e875a87471c00e008f25a01d8312885aa01efc4f688e5cac861c8676e4") version("4.19.21", sha256="3bfd58e875a87471c00e008f25a01d8312885aa01efc4f688e5cac861c8676e4")
version("4.19.20", sha256="475f85277a6601c406ade508b6c935b9f2a170c16fd3ae9dd4cdee7a4f7f340d") version("4.19.20", sha256="475f85277a6601c406ade508b6c935b9f2a170c16fd3ae9dd4cdee7a4f7f340d")
version("4.19.19", sha256="348cd6229b095a3090e851555814f5147bffcb601cec891f1038eb6b38c9d856") version("4.19.19", sha256="348cd6229b095a3090e851555814f5147bffcb601cec891f1038eb6b38c9d856")
@ -33,27 +35,25 @@ class PySip(PythonPackage):
multi=False, multi=False,
) )
depends_on("python@3.7:", when="@6.6:", type=("build", "link", "run"))
depends_on("python@3.6:", when="@6:", type=("build", "link", "run"))
depends_on("py-ply", when="@6.6:", type=("build", "run")) depends_on("py-ply", when="@6.6:", type=("build", "run"))
with when("@5:"): with when("@5:"):
depends_on("python@3.5.1:", type=("build", "link", "run")) depends_on("python", type=("build", "link", "run"))
depends_on("py-packaging", type="build") depends_on("py-packaging", type=("build", "run"))
depends_on("py-setuptools@30.3:", type="build") depends_on("py-setuptools@30.3:", type=("build", "run"))
depends_on("py-toml", type="build") depends_on("py-tomli", when="@6.7: ^python@:3.10", type=("build", "run"))
depends_on("py-toml", when="@:6.6", type=("build", "run"))
with when("@:4"): with when("@:4"):
depends_on("python", type=("build", "link", "run")) # Requires distutils
depends_on("python@:3.11", type=("build", "link", "run"))
depends_on("flex", type="build") depends_on("flex", type="build")
depends_on("bison", type="build") depends_on("bison", type="build")
def url_for_version(self, version): def url_for_version(self, version):
if version < Version("5.0.0"): if version < Version("5"):
return "https://www.riverbankcomputing.com/hg/sip/archive/{0}.tar.gz".format( url = "https://www.riverbankcomputing.com/hg/sip/archive/{0}.tar.gz"
version.dotted return url.format(version.dotted)
)
return super().url_for_version(version) return super().url_for_version(version)
@when("@:4") @when("@:4")
@ -75,12 +75,20 @@ def install(self, spec, prefix):
@run_after("install") @run_after("install")
def extend_path_setup(self): def extend_path_setup(self):
if self.spec.satisfies("@:4"): # https://github.com/spack/spack/issues/14121
# See github issue #14121 and PR #15297 # https://github.com/spack/spack/pull/15297
# Same code comes by default with py-pyqt5 and py-pyqt6
if self.spec.satisfies("@5:"):
return
module = self.spec.variants["module"].value module = self.spec.variants["module"].value
if module != "sip": if module == "sip":
return
module = module.split(".")[0] module = module.split(".")[0]
with working_dir(python_platlib): text = f"""
with open(os.path.join(module, "__init__.py"), "w") as f: # Support {module} sub-packages that have been created by setuptools.
f.write("from pkgutil import extend_path\n") __path__ = __import__('pkgutil').extend_path(__path__, __name__)
f.write("__path__ = extend_path(__path__, __name__)\n") """
with open(join_path(python_platlib, module, "__init__.py"), "w") as f:
f.write(text)

View File

@ -161,9 +161,6 @@ class Qgis(CMakePackage):
depends_on("qt@5.9.0:", when="@3.10.0:") depends_on("qt@5.9.0:", when="@3.10.0:")
depends_on("qtkeychain@:1.5", when="^qt@4") depends_on("qtkeychain@:1.5", when="^qt@4")
depends_on("qt@:4", when="@2") depends_on("qt@:4", when="@2")
# Help concretizer
# +qsci_api is implied by qscintilla+python dependency
depends_on("py-pyqt5@5.3: +qsci_api", when="@3")
patch("pyqt5.patch", when="@:3.14 ^qt@5") patch("pyqt5.patch", when="@:3.14 ^qt@5")
patch("pyqt5_3165x.patch", when="@3.16.5:3.21 ^qt@5") patch("pyqt5_3165x.patch", when="@3.16.5:3.21 ^qt@5")

View File

@ -46,7 +46,7 @@ class Qscintilla(QMakePackage):
depends_on("qt+opengl", when="+python") depends_on("qt+opengl", when="+python")
depends_on("qt") depends_on("qt")
depends_on("py-pyqt5 +qsci_api", type=("build", "run"), when="+python ^qt@5") depends_on("py-pyqt5", type=("build", "run"), when="+python ^qt@5")
depends_on("py-pyqt4 +qsci_api", type=("build", "run"), when="+python ^qt@4") depends_on("py-pyqt4 +qsci_api", type=("build", "run"), when="+python ^qt@4")
depends_on("python", type=("build", "run"), when="+python") depends_on("python", type=("build", "run"), when="+python")
# adter install inquires py-sip variant : so we need to have it # adter install inquires py-sip variant : so we need to have it