Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ install:
- conda update -q conda
- conda info -a
# Host dependencies
- 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
- 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
# Build dependencies
- conda install cmake -c conda-forge
# Build and install xeus-python
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ OPTION(XPYT_DOWNLOAD_GTEST "build gtest from downloaded sources" OFF)
# ============

set(xeus_REQUIRED_VERSION 0.25.0)
set(pybind11_REQUIRED_VERSION 2.2.4)
set(pybind11_REQUIRED_VERSION 2.6.0)
set(pybind11_json_REQUIRED_VERSION 0.2.2)

if (NOT TARGET xeus AND NOT TARGET xeus-static)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ xeus-python does not cover 100% of the features of ipykernel. For example, only

| `xeus-python`| `xeus` | `xtl` | `cppzmq` | `nlohmann_json` | `pybind11` | `pybind11_json` | `jedi` | `pygments` | `ptvsd` | `debugpy` |
|--------------|------------------|-----------------|----------|-----------------|----------------|-------------------|-------------------|-------------------|---------|-----------|
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
Expand Down
2 changes: 1 addition & 1 deletion environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies:
- cppzmq
- xtl
- jedi
- pybind11=2.5.0
- pybind11=2.6.0
- pybind11_json=0.2.6
- pygments
- ipython=7.14.0
Expand Down
6 changes: 4 additions & 2 deletions src/xdisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
#include "pybind11/functional.h"
#include "pybind11/stl.h"

#include "xdisplay.hpp"
#include "xeus-python/xutils.hpp"

#include "xdisplay.hpp"
#include "xinternal_utils.hpp"

#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wattributes"
Expand Down Expand Up @@ -1065,7 +1067,7 @@ namespace xpyt

py::module get_display_module_impl()
{
py::module display_module("display");
py::module display_module = create_module("display");

py::class_<xdisplayhook>(display_module, "DisplayHook")
.def(py::init<>())
Expand Down
5 changes: 5 additions & 0 deletions src/xinternal_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ namespace nl = nlohmann;

namespace xpyt
{
py::module create_module(const std::string& module_name)
{
return py::module_::create_extension_module(module_name.c_str(), nullptr, new py::module_::module_def);
}

std::string red_text(const std::string& text)
{
return "\033[0;31m" + text + "\033[0m";
Expand Down
2 changes: 2 additions & 0 deletions src/xinternal_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ namespace py = pybind11;

namespace xpyt
{
py::module create_module(const std::string& module_name);

std::string red_text(const std::string& text);
std::string green_text(const std::string& text);
std::string blue_text(const std::string& text);
Expand Down
4 changes: 3 additions & 1 deletion src/xis_complete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

#include "xeus-python/xutils.hpp"

#include "xinternal_utils.hpp"

namespace py = pybind11;

namespace xpyt
Expand All @@ -23,7 +25,7 @@ namespace xpyt

py::module get_completion_module_impl()
{
py::module completion_module("completion");
py::module completion_module = create_module("completion");

exec(py::str(R"(
# Implementation from https://github.com/ipython/ipython/blob/master/IPython/core/inputtransformer2.py
Expand Down
6 changes: 4 additions & 2 deletions src/xlinecache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
#include "pybind11/pybind11.h"
#include "pybind11/functional.h"

#include "xlinecache.hpp"
#include "xeus-python/xutils.hpp"

#include "xlinecache.hpp"
#include "xinternal_utils.hpp"

namespace py = pybind11;

namespace xpyt
Expand Down Expand Up @@ -53,7 +55,7 @@ namespace xpyt

py::module get_linecache_module_impl()
{
py::module linecache_module("linecache");
py::module linecache_module = create_module("linecache");

exec(py::str(R"(
from linecache import getline, getlines, updatecache, cache, clearcache, lazycache
Expand Down
6 changes: 4 additions & 2 deletions src/xnullcontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
#include "pybind11/pybind11.h"
#include "pybind11/functional.h"

#include "xnullcontext.hpp"
#include "xeus-python/xutils.hpp"

#include "xnullcontext.hpp"
#include "xinternal_utils.hpp"

namespace py = pybind11;

namespace xpyt
Expand All @@ -26,7 +28,7 @@ namespace xpyt

py::module get_nullcontext_module_impl()
{
py::module nullcontext_module("xeus_nullcontext");
py::module nullcontext_module = create_module("xeus_nullcontext");
exec(py::str(R"(
from contextlib import AbstractContextManager
class nullcontext(AbstractContextManager):
Expand Down
2 changes: 1 addition & 1 deletion src/xpython_kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ namespace xpyt

py::module get_kernel_module_impl()
{
py::module kernel_module = py::module("kernel");
py::module kernel_module = create_module("kernel");

py::class_<hooks_object>(kernel_module, "Hooks")
.def_static("show_in_pager", &hooks_object::show_in_pager);
Expand Down
3 changes: 2 additions & 1 deletion src/xstream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "pybind11/pybind11.h"

#include "xstream.hpp"
#include "xinternal_utils.hpp"

namespace py = pybind11;

Expand Down Expand Up @@ -75,7 +76,7 @@ namespace xpyt

py::module get_stream_module_impl()
{
py::module stream_module = py::module("stream");
py::module stream_module = create_module("stream");

py::class_<xstream>(stream_module, "Stream")
.def(py::init<std::string>())
Expand Down