summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattip <matti.picus@gmail.com>2020-10-27 22:43:37 +0200
committermattip <matti.picus@gmail.com>2020-10-27 22:58:06 +0200
commit76d12d3fcabad0371b24753ba7d36ca5b1d61bcf (patch)
tree2cfc25f54e3e9dab18d289d4f4060ff2f55079cb
parenta8a3fdeec2c19a1ec776c3a33062502962e09cce (diff)
downloadnumpy-76d12d3fcabad0371b24753ba7d36ca5b1d61bcf.tar.gz
TST: simplify source path names in compilation test
-rw-r--r--numpy/core/tests/examples/setup.py3
-rw-r--r--numpy/core/tests/test_cython.py8
-rw-r--r--numpy/random/_examples/cython/setup.py4
3 files changed, 6 insertions, 9 deletions
diff --git a/numpy/core/tests/examples/setup.py b/numpy/core/tests/examples/setup.py
index 9860bf5f7..6e34aa778 100644
--- a/numpy/core/tests/examples/setup.py
+++ b/numpy/core/tests/examples/setup.py
@@ -9,12 +9,11 @@ from Cython.Build import cythonize
from setuptools.extension import Extension
import os
-here = os.path.dirname(__file__)
macros = [("NPY_NO_DEPRECATED_API", 0)]
checks = Extension(
"checks",
- sources=[os.path.join(here, "checks.pyx")],
+ sources=[os.path.join('.', "checks.pyx")],
include_dirs=[np.get_include()],
define_macros=macros,
)
diff --git a/numpy/core/tests/test_cython.py b/numpy/core/tests/test_cython.py
index bfdb692d7..a1f09d0fe 100644
--- a/numpy/core/tests/test_cython.py
+++ b/numpy/core/tests/test_cython.py
@@ -34,21 +34,19 @@ def install_temp(request, tmp_path):
here = os.path.dirname(__file__)
ext_dir = os.path.join(here, "examples")
- tmp_path = tmp_path._str
- cytest = os.path.join(tmp_path, "cytest")
+ cytest = str(tmp_path / "cytest")
shutil.copytree(ext_dir, cytest)
# build the examples and "install" them into a temporary directory
- install_log = os.path.join(tmp_path, "tmp_install_log.txt")
+ install_log = str(tmp_path / "tmp_install_log.txt")
subprocess.check_call(
[
sys.executable,
"setup.py",
"build",
"install",
- "--prefix",
- os.path.join(tmp_path, "installdir"),
+ "--prefix", str(tmp_path / "installdir"),
"--single-version-externally-managed",
"--record",
install_log,
diff --git a/numpy/random/_examples/cython/setup.py b/numpy/random/_examples/cython/setup.py
index 42425c2c1..83f06fde8 100644
--- a/numpy/random/_examples/cython/setup.py
+++ b/numpy/random/_examples/cython/setup.py
@@ -19,7 +19,7 @@ inc_path = np.get_include()
lib_path = join(np.get_include(), '..', '..', 'random', 'lib')
extending = Extension("extending",
- sources=[join(path, 'extending.pyx')],
+ sources=[join('.', 'extending.pyx')],
include_dirs=[
np.get_include(),
join(path, '..', '..')
@@ -27,7 +27,7 @@ extending = Extension("extending",
define_macros=defs,
)
distributions = Extension("extending_distributions",
- sources=[join(path, 'extending_distributions.pyx')],
+ sources=[join('.', 'extending_distributions.pyx')],
include_dirs=[inc_path],
library_dirs=[lib_path],
libraries=['npyrandom'],