Skip to content

Commit

Permalink
Merge pull request #137 from swt2c/sip5
Browse files Browse the repository at this point in the history
Add support for building with sip 5
  • Loading branch information
Simsys authored Oct 23, 2022
2 parents 46b8573 + ce17d35 commit 7f22526
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
29 changes: 29 additions & 0 deletions project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""The build configuration file for QHexEdit, used by sip."""

import os
from os.path import abspath, join
from sipbuild import Option
from pyqtbuild import PyQtBindings, PyQtProject
import PyQt5


class QHexEditProject(PyQtProject):
"""The QHexEdit Project class."""

def __init__(self):
super().__init__()
self.bindings_factories = [QHexEditBindings]

def update(self, tool):
"""Allows SIP to find PyQt5 .sip files."""
super().update(tool)
self.sip_include_dirs.append(join(PyQt5.__path__[0], 'bindings'))


class QHexEditBindings(PyQtBindings):
"""The QHexEdit Bindings class."""

def __init__(self, project):
super().__init__(project, name='QHexEdit',
sip_file='qhexedit.sip',
qmake_QT=['widgets'])
14 changes: 14 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[build-system]
requires = ["sip >=5", "PyQt-builder", "PyQt5"]
build-backend = "sipbuild.api"

[tool.sip.metadata]
name = "QHexEdit"
version = "0.8.9"

[tools.sip]
abi-version = "12.8"
project-factory = "pyqtbuild:PyQtProject"

[tool.sip.project]
sip-files-dir = "src"
2 changes: 1 addition & 1 deletion src/qhexedit.sip
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%Module(name=qhexedit, version=1)
%Module(name=qhexedit)

%Import QtCore/QtCoremod.sip
%Import QtGui/QtGuimod.sip
Expand Down

0 comments on commit 7f22526

Please sign in to comment.