-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1635 from mathbunnyru/asalikhov/fix_cython
Fix cython in scipy-notebook
- Loading branch information
Showing
5 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
print("Hello World") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from setuptools import setup | ||
from Cython.Build import cythonize | ||
|
||
setup(ext_modules=cythonize("helloworld.pyx")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright (c) Jupyter Development Team. | ||
# Distributed under the terms of the Modified BSD License. | ||
|
||
from pathlib import Path | ||
|
||
from conftest import TrackedContainer | ||
|
||
THIS_DIR = Path(__file__).parent.resolve() | ||
|
||
|
||
def test_cython(container: TrackedContainer) -> None: | ||
host_data_dir = THIS_DIR / "data/cython" | ||
cont_data_dir = "/home/jovyan/data" | ||
|
||
logs = container.run_and_wait( | ||
timeout=10, | ||
volumes={str(host_data_dir): {"bind": cont_data_dir, "mode": "ro"}}, | ||
tty=True, | ||
command=[ | ||
"start.sh", | ||
"bash", | ||
"-c", | ||
# We copy our data to temporary folder to be able to modify the directory | ||
f"cp -r {cont_data_dir}/ /tmp/test/ && cd /tmp/test && python3 setup.py build_ext", | ||
], | ||
) | ||
assert "building 'helloworld' extension" in logs |