python: use setuptools and put bindings into sigrok.core.lowlevel.
This commit is contained in:
parent
d0eec1eea1
commit
0220626994
|
@ -17,7 +17,7 @@
|
||||||
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
##
|
##
|
||||||
|
|
||||||
from distutils.core import setup, Extension
|
from setuptools import setup, find_packages, Extension
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
sr_includes = subprocess.check_output(
|
sr_includes = subprocess.check_output(
|
||||||
|
@ -31,12 +31,13 @@ sr_version = subprocess.check_output(
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name = 'libsigrok',
|
name = 'libsigrok',
|
||||||
|
namespace_packages = ['sigrok'],
|
||||||
|
packages = find_packages(),
|
||||||
version = sr_version,
|
version = sr_version,
|
||||||
description = "libsigrok API wrapper",
|
description = "libsigrok API wrapper",
|
||||||
py_modules = ['libsigrok'],
|
|
||||||
ext_modules = [
|
ext_modules = [
|
||||||
Extension('_libsigrok',
|
Extension('sigrok.core._lowlevel',
|
||||||
sources = ['libsigrok_python.i'],
|
sources = ['sigrok/core/lowlevel.i'],
|
||||||
swig_opts = sr_includes,
|
swig_opts = sr_includes,
|
||||||
include_dirs = [i[2:] for i in sr_includes if i.startswith('-I')],
|
include_dirs = [i[2:] for i in sr_includes if i.startswith('-I')],
|
||||||
library_dirs = [l[2:] for l in sr_libs if l.startswith('-L')],
|
library_dirs = [l[2:] for l in sr_libs if l.startswith('-L')],
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
__import__("pkg_resources").declare_namespace(__name__)
|
|
@ -0,0 +1 @@
|
||||||
|
import lowlevel
|
|
@ -17,7 +17,9 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
%include "../swig/libsigrok.i"
|
%module lowlevel
|
||||||
|
|
||||||
|
%include "../../../swig/libsigrok.i"
|
||||||
|
|
||||||
%{
|
%{
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
%module libsigrok
|
|
||||||
%include "cpointer.i"
|
%include "cpointer.i"
|
||||||
%include "carrays.i"
|
%include "carrays.i"
|
||||||
%include "cdata.i"
|
%include "cdata.i"
|
||||||
|
|
Loading…
Reference in New Issue