Skip to content

Commit

Permalink
updating all wrap.cxx in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
parcollet committed Nov 14, 2024
1 parent 4d05511 commit aa1cd74
Show file tree
Hide file tree
Showing 18 changed files with 24 additions and 24 deletions.
14 changes: 7 additions & 7 deletions test/annote.wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ template <> constexpr bool c2py::is_wrapped<A> = true;

template <> inline const std::string c2py::cpp_name<A> = "A";
template <> inline constexpr auto c2py::tp_name<A> = "annote.A";
template <> inline constexpr const char *c2py::tp_doc<A> = R"DOC( * k: int = 12)DOC";
template <> inline constexpr const char *c2py::tp_doc<A> = R"DOC( )DOC";

static int synth_constructor_0(PyObject *self, PyObject *args, PyObject *kwargs) {
if (args and PyTuple_Check(args) and (PyTuple_Size(args) > 0)) {
Expand All @@ -46,7 +46,7 @@ static int synth_constructor_0(PyObject *self, PyObject *args, PyObject *kwargs)
return -1;
}
auto &self_c = *(((c2py::wrap<A> *)self)->_c);
de("k", self_c.k, true);

return de.check();
}

Expand All @@ -59,7 +59,6 @@ PyMethodDef c2py::tp_methods<A>[] = {
{nullptr, nullptr, 0, nullptr} // Sentinel
};

constexpr auto doc_member_0 = R"DOC()DOC";
static PyObject *prop_get_dict_0(PyObject *self, void *) {
auto &self_c = *(((c2py::wrap<A> *)self)->_c);
c2py::pydict dic;
Expand All @@ -70,9 +69,10 @@ static PyObject *prop_get_dict_0(PyObject *self, void *) {
// ----- Method table ----

template <>
constinit PyGetSetDef c2py::tp_getset<A>[] = {c2py::getsetdef_from_member<&A::k, A>("k", doc_member_0),
{"__dict__", (getter)prop_get_dict_0, nullptr, "", nullptr},
{nullptr, nullptr, nullptr, nullptr, nullptr}};
constinit PyGetSetDef c2py::tp_getset<A>[] = {

{"__dict__", (getter)prop_get_dict_0, nullptr, "", nullptr},
{nullptr, nullptr, nullptr, nullptr, nullptr}};

// ==================== module functions ====================

Expand Down Expand Up @@ -105,7 +105,7 @@ static struct PyModuleDef module_def = {PyModuleDef_HEAD_INIT,

extern "C" __attribute__((visibility("default"))) PyObject *PyInit_annote() {

if (not c2py::check_python_version()) return NULL;
if (not c2py::check_python_version("annote")) return NULL;

// import numpy iff 'numpy/arrayobject.h' included
#ifdef Py_ARRAYOBJECT_H
Expand Down
2 changes: 1 addition & 1 deletion test/basicfun.wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ static struct PyModuleDef module_def = {PyModuleDef_HEAD_INIT,

extern "C" __attribute__((visibility("default"))) PyObject *PyInit_basicfun() {

if (not c2py::check_python_version()) return NULL;
if (not c2py::check_python_version("basicfun")) return NULL;

// import numpy iff 'numpy/arrayobject.h' included
#ifdef Py_ARRAYOBJECT_H
Expand Down
2 changes: 1 addition & 1 deletion test/callables.wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static struct PyModuleDef module_def = {PyModuleDef_HEAD_INIT,

extern "C" __attribute__((visibility("default"))) PyObject *PyInit_callables() {

if (not c2py::check_python_version()) return NULL;
if (not c2py::check_python_version("callables")) return NULL;

// import numpy iff 'numpy/arrayobject.h' included
#ifdef Py_ARRAYOBJECT_H
Expand Down
2 changes: 1 addition & 1 deletion test/callback.wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static struct PyModuleDef module_def = {PyModuleDef_HEAD_INIT,

extern "C" __attribute__((visibility("default"))) PyObject *PyInit_callback() {

if (not c2py::check_python_version()) return NULL;
if (not c2py::check_python_version("callback")) return NULL;

// import numpy iff 'numpy/arrayobject.h' included
#ifdef Py_ARRAYOBJECT_H
Expand Down
2 changes: 1 addition & 1 deletion test/cls_basic.wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ static struct PyModuleDef module_def = {PyModuleDef_HEAD_INIT,

extern "C" __attribute__((visibility("default"))) PyObject *PyInit_cls_basic() {

if (not c2py::check_python_version()) return NULL;
if (not c2py::check_python_version("cls_basic")) return NULL;

// import numpy iff 'numpy/arrayobject.h' included
#ifdef Py_ARRAYOBJECT_H
Expand Down
2 changes: 1 addition & 1 deletion test/cls_der.wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ static struct PyModuleDef module_def = {PyModuleDef_HEAD_INIT,

extern "C" __attribute__((visibility("default"))) PyObject *PyInit_cls_der() {

if (not c2py::check_python_version()) return NULL;
if (not c2py::check_python_version("cls_der")) return NULL;

// import numpy iff 'numpy/arrayobject.h' included
#ifdef Py_ARRAYOBJECT_H
Expand Down
2 changes: 1 addition & 1 deletion test/comparison.wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ static struct PyModuleDef module_def = {PyModuleDef_HEAD_INIT,

extern "C" __attribute__((visibility("default"))) PyObject *PyInit_comparison() {

if (not c2py::check_python_version()) return NULL;
if (not c2py::check_python_version("comparison")) return NULL;

// import numpy iff 'numpy/arrayobject.h' included
#ifdef Py_ARRAYOBJECT_H
Expand Down
2 changes: 1 addition & 1 deletion test/enumcxx.wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static struct PyModuleDef module_def = {PyModuleDef_HEAD_INIT,

extern "C" __attribute__((visibility("default"))) PyObject *PyInit_enumcxx() {

if (not c2py::check_python_version()) return NULL;
if (not c2py::check_python_version("enumcxx")) return NULL;

// import numpy iff 'numpy/arrayobject.h' included
#ifdef Py_ARRAYOBJECT_H
Expand Down
2 changes: 1 addition & 1 deletion test/generator.wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static struct PyModuleDef module_def = {PyModuleDef_HEAD_INIT,

extern "C" __attribute__((visibility("default"))) PyObject *PyInit_generator() {

if (not c2py::check_python_version()) return NULL;
if (not c2py::check_python_version("generator")) return NULL;

// import numpy iff 'numpy/arrayobject.h' included
#ifdef Py_ARRAYOBJECT_H
Expand Down
2 changes: 1 addition & 1 deletion test/ignore.wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ static PyMethodDef module_methods[] = {
static struct PyModuleDef module_def = {PyModuleDef_HEAD_INIT,
"ignore", /* name of module */
R"RAWDOC()RAWDOC", /* module documentation, may be NULL */
-1, /* size of per-interpreter state of the module, or -1 if the module keeps state in global variables. */
-1, /* size of per-interpreter state of the module, or -1 if the module keeps state in global variables. */
module_methods,
NULL,
NULL,
Expand Down
2 changes: 1 addition & 1 deletion test/issue9.wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static struct PyModuleDef module_def = {PyModuleDef_HEAD_INIT,

extern "C" __attribute__((visibility("default"))) PyObject *PyInit_issue9() {

if (not c2py::check_python_version()) return NULL;
if (not c2py::check_python_version("issue9")) return NULL;

// import numpy iff 'numpy/arrayobject.h' included
#ifdef Py_ARRAYOBJECT_H
Expand Down
2 changes: 1 addition & 1 deletion test/itertool.wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static struct PyModuleDef module_def = {PyModuleDef_HEAD_INIT,

extern "C" __attribute__((visibility("default"))) PyObject *PyInit_itertool() {

if (not c2py::check_python_version()) return NULL;
if (not c2py::check_python_version("itertool")) return NULL;

// import numpy iff 'numpy/arrayobject.h' included
#ifdef Py_ARRAYOBJECT_H
Expand Down
2 changes: 1 addition & 1 deletion test/pointer.wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static PyMethodDef module_methods[] = {
static struct PyModuleDef module_def = {PyModuleDef_HEAD_INIT,
"pointer", /* name of module */
R"RAWDOC()RAWDOC", /* module documentation, may be NULL */
-1, /* size of per-interpreter state of the module, or -1 if the module keeps state in global variables. */
-1, /* size of per-interpreter state of the module, or -1 if the module keeps state in global variables. */
module_methods,
NULL,
NULL,
Expand Down
2 changes: 1 addition & 1 deletion test/synth_init.wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ static struct PyModuleDef module_def = {PyModuleDef_HEAD_INIT,

extern "C" __attribute__((visibility("default"))) PyObject *PyInit_synth_init() {

if (not c2py::check_python_version()) return NULL;
if (not c2py::check_python_version("synth_init")) return NULL;

// import numpy iff 'numpy/arrayobject.h' included
#ifdef Py_ARRAYOBJECT_H
Expand Down
2 changes: 1 addition & 1 deletion test/tpl_cls.wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static struct PyModuleDef module_def = {PyModuleDef_HEAD_INIT,

extern "C" __attribute__((visibility("default"))) PyObject *PyInit_tpl_cls() {

if (not c2py::check_python_version()) return NULL;
if (not c2py::check_python_version("tpl_cls")) return NULL;

// import numpy iff 'numpy/arrayobject.h' included
#ifdef Py_ARRAYOBJECT_H
Expand Down
2 changes: 1 addition & 1 deletion test/tpl_derived.wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ static struct PyModuleDef module_def = {PyModuleDef_HEAD_INIT,

extern "C" __attribute__((visibility("default"))) PyObject *PyInit_tpl_derived() {

if (not c2py::check_python_version()) return NULL;
if (not c2py::check_python_version("tpl_derived")) return NULL;

// import numpy iff 'numpy/arrayobject.h' included
#ifdef Py_ARRAYOBJECT_H
Expand Down
2 changes: 1 addition & 1 deletion test/two_module_1.wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static struct PyModuleDef module_def = {PyModuleDef_HEAD_INIT,

extern "C" __attribute__((visibility("default"))) PyObject *PyInit_two_module_1() {

if (not c2py::check_python_version()) return NULL;
if (not c2py::check_python_version("two_module_1")) return NULL;

// import numpy iff 'numpy/arrayobject.h' included
#ifdef Py_ARRAYOBJECT_H
Expand Down
2 changes: 1 addition & 1 deletion test/two_module_2.wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static struct PyModuleDef module_def = {PyModuleDef_HEAD_INIT,

extern "C" __attribute__((visibility("default"))) PyObject *PyInit_two_module_2() {

if (not c2py::check_python_version()) return NULL;
if (not c2py::check_python_version("two_module_2")) return NULL;

// import numpy iff 'numpy/arrayobject.h' included
#ifdef Py_ARRAYOBJECT_H
Expand Down

0 comments on commit aa1cd74

Please sign in to comment.