Skip to content

Commit

Permalink
Merge pull request #27 from lsst/tickets/DM-14828
Browse files Browse the repository at this point in the history
DM-14828: Update pybind11 wrappers for 2.2
  • Loading branch information
r-owen committed Jul 21, 2018
2 parents 8aea5f4 + 17fac6d commit 928b041
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ config.log
*.pyc
.cache
pytest_session.txt
.coverage
lib/libbase.*
python/lsst/base/version.py
python/lsst64defs.py
Expand Down
6 changes: 1 addition & 5 deletions python/lsst/base/threads.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,11 @@ namespace py = pybind11;
namespace lsst {
namespace base {

PYBIND11_PLUGIN(threads) {
py::module mod("threads");

PYBIND11_MODULE(threads, mod) {
mod.def("haveThreads", &lsst::base::haveThreads);
mod.def("setNumThreads", &lsst::base::setNumThreads);
mod.def("getNumThreads", &lsst::base::getNumThreads);
mod.def("disableImplicitThreading", &lsst::base::disableImplicitThreading);

return mod.ptr();
}

} // lsst
Expand Down
6 changes: 1 addition & 5 deletions python/lsst/base/versions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,12 @@ namespace py = pybind11;
namespace lsst {
namespace base {

PYBIND11_PLUGIN(versions) {
py::module mod("versions");

PYBIND11_MODULE(versions, mod) {
mod.def("getRuntimeVersions", &lsst::base::getRuntimeVersions);
mod.def("getCfitsioVersion", &lsst::base::getCfitsioVersion);
mod.def("getFftwVersion", &lsst::base::getFftwVersion);
mod.def("getWcslibVersion", &lsst::base::getWcslibVersion);
mod.def("getGslVersion", &lsst::base::getGslVersion);

return mod.ptr();
}

} // lsst
Expand Down
6 changes: 1 addition & 5 deletions python/lsstcppimport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ void installPythonModuleImporter() { ModuleImporter::install(PythonModuleImporte

namespace py = pybind11;

PYBIND11_PLUGIN(_lsstcppimport) {
py::module mod("_lsstcppimport", "Access to the classes from the lsstcppimport library");

PYBIND11_MODULE(_lsstcppimport, mod) {
lsst::base::installPythonModuleImporter();

return mod.ptr();
}
10 changes: 5 additions & 5 deletions tests/testModuleImporterLib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@

namespace py = pybind11;

namespace {

bool doImport(char const * name) {
return lsst::base::ModuleImporter::import(name);
}

PYBIND11_PLUGIN(_testModuleImporterLib) {
pybind11::module mod("_testModuleImporterLib", "Tests for ModuleImporter");

mod.def("doImport", &doImport);
} // namespace

return mod.ptr();
PYBIND11_MODULE(_testModuleImporterLib, mod) {
mod.def("doImport", &doImport);
}

0 comments on commit 928b041

Please sign in to comment.