#!/bin/env python -B import os import sipconfig from PyQt5 import QtCore basename = "sample" # The name of the SIP build file generated by SIP and used by the build system. build_file = basename + ".sbf" # Get the SIP configuration information. config = sipconfig.Configuration() # Run SIP to generate the code. os.system(" ".join([config.sip_bin, "-c", ".", "-b", build_file, QtCore.PYQT_CONFIGURATION["sip_flags"], basename + ".sip"])) # Create the Makefile. makefile = sipconfig.SIPModuleMakefile(config, build_file) # Generate the Makefile itself. makefile.generate() # https://github.com/zanton/hello-sip-pyqt5