Skip to content

Commit 810eac3

Browse files
authored
Drop the Python / IPython specific compilers (ipython#40)
* Remove IPython Python compilation conditions * Delete unnecessary files
1 parent f0b85f2 commit 810eac3

33 files changed

+243
-1892
lines changed

.pytest_cache/v/cache/lastfailed

-1
This file was deleted.

.pytest_cache/v/cache/nodeids

-26
This file was deleted.

classes_importnb.png

-193 KB
Binary file not shown.

packages_importnb.png

-82.1 KB
Binary file not shown.

readme.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@
409409
"output_type": "stream",
410410
"text": [
411411
"[NbConvertApp] Converting notebook readme.ipynb to markdown\n",
412-
"[NbConvertApp] Writing 6469 bytes to readme.md\n"
412+
"[NbConvertApp] Writing 7022 bytes to readme.md\n"
413413
]
414414
}
415415
],

readme.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,18 @@ For example, create a file called `tricks.yaml` containing
224224
```
225225

226226
test_import (src.importnb.tests.test_unittests.TestContext) ... ok
227-
test_reload_with_context (src.importnb.tests.test_unittests.TestContext) ...
227+
test_reload_with_context (src.importnb.tests.test_unittests.TestContext) ... ok
228+
test_failure (src.importnb.tests.test_unittests.TestExtension) ... expected failure
229+
test_import (src.importnb.tests.test_unittests.TestExtension) ... ok
230+
test_exception (src.importnb.tests.test_unittests.TestPartial) ... ok
231+
test_traceback (src.importnb.tests.test_unittests.TestPartial) ... ok
232+
test_imports (src.importnb.tests.test_unittests.TestRemote) ... skipped 'requires IP'
233+
234+
----------------------------------------------------------------------
235+
Ran 7 tests in 2.018s
236+
237+
OK (skipped=1, expected failures=1)
238+
228239

229240

230241
```python

readme_files/readme_33_1.png

-180 KB
Binary file not shown.

readme_files/readme_33_2.png

-77.9 KB
Binary file not shown.

src/importnb/__init__.py

-4
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
unload_ipython_extension,
1212
reload,
1313
Lazy,
14-
export,
15-
__IPYTHON__,
1614
)
1715
from .parameterize import Parameterize
1816
from .nbtest import NotebookTest, testmod
@@ -25,8 +23,6 @@
2523
unload_ipython_extension,
2624
reload,
2725
Lazy,
28-
export,
29-
__IPYTHON__,
3026
)
3127
from parameterize import Parameterize
3228
from nbtest import NotebookTest, testmod

src/importnb/capture.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,11 @@
66

77

88
try:
9-
from .compile import export, __IPYTHON__, export
10-
except:
11-
from compile import export, __IPYTHON__, export
12-
__all__ = "capture_output",
13-
14-
15-
if __IPYTHON__:
169
from IPython.utils.capture import capture_output
17-
else:
10+
from IPython import get_ipython
11+
12+
assert get_ipython(), """There is no interactive shell"""
13+
except:
1814
from contextlib import redirect_stdout, ExitStack
1915
from io import StringIO
2016

@@ -73,5 +69,9 @@ def stderr(self):
7369

7470

7571
if __name__ == "__main__":
72+
try:
73+
from .utils.export import export
74+
except:
75+
from utils.export import export
7676
export("capture.ipynb", "../capture.py")
7777
__import__("doctest").testmod()

src/importnb/compile.py

-141
This file was deleted.

src/importnb/compile_ipython.py

-66
This file was deleted.

src/importnb/compile_python.py

-76
This file was deleted.

0 commit comments

Comments
 (0)