Skip to content

Commit 9fda0dc

Browse files
committed
Fix warnings
Signed-off-by: martinRenou <[email protected]>
1 parent f8055b5 commit 9fda0dc

11 files changed

+27
-12
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ install:
2727
- conda update -q conda
2828
- conda info -a
2929
# Host dependencies
30-
- conda install xeus=0.25.3 nlohmann_json cppzmq xtl jedi pybind11=2.5.0 pybind11_json=0.2.6 pygments gtest=1.8.0 debugpy ipython=7.14.0 -c conda-forge
30+
- conda install xeus=0.25.3 nlohmann_json cppzmq xtl jedi pybind11=2.6.0 pybind11_json=0.2.6 pygments gtest=1.8.0 debugpy ipython=7.14.0 -c conda-forge
3131
# Build dependencies
3232
- conda install cmake -c conda-forge
3333
# Build and install xeus-python

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ OPTION(XPYT_DOWNLOAD_GTEST "build gtest from downloaded sources" OFF)
7070
# ============
7171

7272
set(xeus_REQUIRED_VERSION 0.25.0)
73-
set(pybind11_REQUIRED_VERSION 2.2.4)
73+
set(pybind11_REQUIRED_VERSION 2.6.0)
7474
set(pybind11_json_REQUIRED_VERSION 0.2.2)
7575

7676
if (NOT TARGET xeus AND NOT TARGET xeus-static)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ xeus-python does not cover 100% of the features of ipykernel. For example, only
134134

135135
| `xeus-python`| `xeus` | `xtl` | `cppzmq` | `nlohmann_json` | `pybind11` | `pybind11_json` | `jedi` | `pygments` | `ptvsd` | `debugpy` |
136136
|--------------|------------------|-----------------|----------|-----------------|----------------|-------------------|-------------------|-------------------|---------|-----------|
137-
| master | >=0.25.3,<0.26 | >=0.6.8,<0.7 | ~4.4.1 | >=3.6.1,<4.0 | >=2.2.4,<3.0 | >=0.2.6,<0.3 | >=0.15.1 | >=2.3.1,<3.0.0 | | >=1.1.0 |
137+
| master | >=0.25.3,<0.26 | >=0.6.8,<0.7 | ~4.4.1 | >=3.6.1,<4.0 | >=2.6.0,<3.0 | >=0.2.6,<0.3 | >=0.15.1 | >=2.3.1,<3.0.0 | | >=1.1.0 |
138138
| 0.9.2 | >=0.25.3,<0.26 | >=0.6.8,<0.7 | ~4.4.1 | >=3.6.1,<4.0 | >=2.2.4,<3.0 | >=0.2.6,<0.3 | >=0.15.1 | >=2.3.1,<3.0.0 | | >=1.1.0 |
139139
| 0.9.1 | >=0.25.0,<0.26 | >=0.6.8,<0.7 | ~4.4.1 | >=3.6.1,<4.0 | >=2.2.4,<3.0 | >=0.2.6,<0.3 | >=0.15.1 | >=2.3.1,<3.0.0 | | >=1.1.0 |
140140
| 0.9.0 | >=0.25.0,<0.26 | >=0.6.8,<0.7 | ~4.4.1 | >=3.6.1,<4.0 | >=2.2.4,<3.0 | >=0.2.6,<0.3 | >=0.15.1 | >=2.3.1,<3.0.0 | | >=1.1.0 |

environment-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ dependencies:
1010
- cppzmq
1111
- xtl
1212
- jedi
13-
- pybind11=2.5.0
13+
- pybind11=2.6.0
1414
- pybind11_json=0.2.6
1515
- pygments
1616
- ipython=7.14.0

src/xdisplay.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@
2424
#include "pybind11/functional.h"
2525
#include "pybind11/stl.h"
2626

27-
#include "xdisplay.hpp"
2827
#include "xeus-python/xutils.hpp"
2928

29+
#include "xdisplay.hpp"
30+
#include "xinternal_utils.hpp"
31+
3032
#ifdef __GNUC__
3133
#pragma GCC diagnostic push
3234
#pragma GCC diagnostic ignored "-Wattributes"
@@ -1065,7 +1067,7 @@ namespace xpyt
10651067

10661068
py::module get_display_module_impl()
10671069
{
1068-
py::module display_module("display");
1070+
py::module display_module = create_module("display");
10691071

10701072
py::class_<xdisplayhook>(display_module, "DisplayHook")
10711073
.def(py::init<>())

src/xinternal_utils.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ namespace nl = nlohmann;
3232

3333
namespace xpyt
3434
{
35+
py::module create_module(const std::string& module_name)
36+
{
37+
return py::module_::create_extension_module(module_name, nullptr, new py::module_::module_def);
38+
}
39+
3540
std::string red_text(const std::string& text)
3641
{
3742
return "\033[0;31m" + text + "\033[0m";

src/xinternal_utils.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ namespace py = pybind11;
2323

2424
namespace xpyt
2525
{
26+
py::module create_module(const std::string& module_name);
27+
2628
std::string red_text(const std::string& text);
2729
std::string green_text(const std::string& text);
2830
std::string blue_text(const std::string& text);

src/xis_complete.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
#include "xeus-python/xutils.hpp"
1414

15+
#include "xinternal_utils.hpp"
16+
1517
namespace py = pybind11;
1618

1719
namespace xpyt
@@ -23,7 +25,7 @@ namespace xpyt
2325

2426
py::module get_completion_module_impl()
2527
{
26-
py::module completion_module("completion");
28+
py::module completion_module = create_module("completion");
2729

2830
exec(py::str(R"(
2931
# Implementation from https://github.com/ipython/ipython/blob/master/IPython/core/inputtransformer2.py

src/xlinecache.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
#include "pybind11/pybind11.h"
1414
#include "pybind11/functional.h"
1515

16-
#include "xlinecache.hpp"
1716
#include "xeus-python/xutils.hpp"
1817

18+
#include "xlinecache.hpp"
19+
#include "xinternal_utils.hpp"
20+
1921
namespace py = pybind11;
2022

2123
namespace xpyt
@@ -53,7 +55,7 @@ namespace xpyt
5355

5456
py::module get_linecache_module_impl()
5557
{
56-
py::module linecache_module("linecache");
58+
py::module linecache_module = create_module("linecache");
5759

5860
exec(py::str(R"(
5961
from linecache import getline, getlines, updatecache, cache, clearcache, lazycache

src/xnullcontext.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
#include "pybind11/pybind11.h"
1414
#include "pybind11/functional.h"
1515

16-
#include "xnullcontext.hpp"
1716
#include "xeus-python/xutils.hpp"
1817

18+
#include "xnullcontext.hpp"
19+
#include "xinternal_utils.hpp"
20+
1921
namespace py = pybind11;
2022

2123
namespace xpyt
@@ -26,7 +28,7 @@ namespace xpyt
2628

2729
py::module get_nullcontext_module_impl()
2830
{
29-
py::module nullcontext_module("xeus_nullcontext");
31+
py::module nullcontext_module = create_module("xeus_nullcontext");
3032
exec(py::str(R"(
3133
from contextlib import AbstractContextManager
3234
class nullcontext(AbstractContextManager):

src/xpython_kernel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ namespace xpyt
405405

406406
py::module get_kernel_module_impl()
407407
{
408-
py::module kernel_module = py::module("kernel");
408+
py::module kernel_module = create_module("kernel");
409409

410410
py::class_<hooks_object>(kernel_module, "Hooks")
411411
.def_static("show_in_pager", &hooks_object::show_in_pager);

0 commit comments

Comments
 (0)