Skip to content

Commit

Permalink
Cibuildwheel/fix for cibuildwheel (#221)
Browse files Browse the repository at this point in the history
* typemap

- trying a typemap so that it'll work for PyPy and CPython.

* another attempt

- trying both in/out typemaps for PyPy.

* Typemaps

- typemaps for bith netsnmp and sessionbase.

* PyUnicode_AsUTF8

- switching to PyUnicode_AsUTF8

* Compiles

- this compiles, but does it "work".

* Compiles, but segfaults

- this compiles, but segfaults when running test_session.py.

* saving wio

- saving my wip. will try on linux with valgrind.

* Update setup.py

- include all c++ files, perhaps this fixes the linux compile.

* Revert Type Maps

- reverting the typemaps those didn't wrk

* No PyPY

- For now lets proceed with no PyPy. SWIG can't guarantee compatibility with PyPy. CPython Should be good enough for now.

* Update test_session.py

- undo tests
  • Loading branch information
carlkidcrypto authored Oct 11, 2024
1 parent 2577193 commit 25ebeea
Show file tree
Hide file tree
Showing 12 changed files with 27,916 additions and 33,750 deletions.
3 changes: 1 addition & 2 deletions ezsnmp/datatypes.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# This file was automatically generated by SWIG (https://www.swig.org).
# Version 4.2.1
# Version 4.2.0
#
# Do not make changes to this file unless you know what you are doing - modify
# the SWIG interface file instead.

from sys import version_info as _swig_python_version_info

# Pull in all the attributes from the low-level C/C++ module
if __package__ or "." in __name__:
from ._datatypes import *
Expand Down
10 changes: 0 additions & 10 deletions ezsnmp/interface/netsnmp.i
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@
%template(_string_list) std::vector<std::string>;
%template(_result_list) std::vector<Result>;

// Tell SWIG we want C++ errors converted to proper high-level language errors
%exception {
try {
$action
} catch (const std::runtime_error& e) {
PyErr_SetString(PyExc_RuntimeError, e.what());
SWIG_fail;
}
};

%include "snmpbulkget.i"
%include "snmpbulkwalk.i"
%include "snmpget.i"
Expand Down
3 changes: 3 additions & 0 deletions ezsnmp/interface/sessionbase.i
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
} catch (const std::runtime_error& e) {
PyErr_SetString(PyExc_RuntimeError, e.what());
SWIG_fail;
} catch (const std::invalid_argument& e) {
PyErr_SetString(PyExc_ValueError, e.what());
SWIG_fail;
}
};

Expand Down
3 changes: 1 addition & 2 deletions ezsnmp/netsnmp.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# This file was automatically generated by SWIG (https://www.swig.org).
# Version 4.2.1
# Version 4.2.0
#
# Do not make changes to this file unless you know what you are doing - modify
# the SWIG interface file instead.

from sys import version_info as _swig_python_version_info

# Pull in all the attributes from the low-level C/C++ module
if __package__ or "." in __name__:
from ._netsnmp import *
Expand Down
3 changes: 1 addition & 2 deletions ezsnmp/sessionbase.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# This file was automatically generated by SWIG (https://www.swig.org).
# Version 4.2.1
# Version 4.2.0
#
# Do not make changes to this file unless you know what you are doing - modify
# the SWIG interface file instead.

from sys import version_info as _swig_python_version_info

# Pull in all the attributes from the low-level C/C++ module
if __package__ or "." in __name__:
from ._sessionbase import *
Expand Down
Loading

0 comments on commit 25ebeea

Please sign in to comment.