Skip to content

Commit 4e7c173

Browse files
committed
Add specialized environment for tox
1 parent d035f10 commit 4e7c173

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
import tempfile
2626
from pathlib import Path
2727

28-
from Cython.Build import cythonize
29-
3028
from setuptools import Extension, find_packages, setup
3129
from setuptools.command.build_ext import build_ext
3230

@@ -65,6 +63,9 @@ def build_extension(self, ext):
6563
os.path.join(isa_l_prefix_dir, "lib", "libisal.a")]
6664

6765
if os.getenv("CYTHON_COVERAGE") is not None:
66+
# Import cython here so python setup.py can be used without
67+
# installing cython.
68+
from Cython.Build import cythonize
6869
# Add cython directives and macros for coverage support.
6970
cythonized_exts = cythonize(ext, compiler_directives=dict(
7071
linetrace=True

tox.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
# python3 interpreter of the user.
44
envlist=py3
55
[testenv]
6+
deps=pytest
7+
passenv=
8+
PYTHON_ISAL_LINK_DYNAMIC
9+
commands =
10+
# Create HTML coverage report for humans and xml coverage report for external services.
11+
pytest -v tests
12+
13+
[testenv:coverage]
614
deps=coverage[toml]
715
cython
816
pytest

0 commit comments

Comments
 (0)