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
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[run]
branch = True
source = MDAnalysis
plugins = Cython.Coverage
omit =
*/migration/*
*/MDAnalysis/tests/*
Expand Down
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ env:
- PYTEST_LIST="testsuite/MDAnalysisTests"
- MAIN_CMD="pytest ${PYTEST_LIST}"
- SETUP_CMD="${PYTEST_FLAGS}"
- BUILD_CMD="pip install -v package/ && (cd testsuite/ && python setup.py build)"
- BUILD_CMD="pip install -e package/ && (cd testsuite/ && python setup.py build)"
- CONDA_MIN_DEPENDENCIES="mmtf-python mock six biopython networkx cython joblib matplotlib scipy griddataformats hypothesis gsd codecov"
- CONDA_DEPENDENCIES="${CONDA_MIN_DEPENDENCIES} seaborn>=0.7.0 clustalw=2.1 netcdf4 scikit-learn"
- CONDA_CHANNELS='biobuilds conda-forge'
- CONDA_CHANNEL_PRIORITY=True
- PIP_DEPENDENCIES="duecredit"
- NUMPY_VERSION=stable
- INSTALL_HOLE="true"
- CYTHON_TRACE_NOGIL=1

matrix:
# Run a coverage test for most versions
Expand Down
2 changes: 2 additions & 0 deletions package/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
plugins = Cython.Coverage
15 changes: 13 additions & 2 deletions package/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"parallelization module".format(
Cython.__version__, required_version))
cython_found = False
cython_linetrace = bool(os.environ.get('CYTHON_TRACE_NOGIL', False))
except ImportError:
cython_found = False
if not is_release:
Expand Down Expand Up @@ -320,6 +321,10 @@ def extensions(config):
else:
mathlib = ['m']

if cython_linetrace:
extra_compile_args.append("-DCYTHON_TRACE_NOGIL")
cpp_extra_compile_args.append("-DCYTHON_TRACE_NOGIL")

libdcd = MDAExtension('MDAnalysis.lib.formats.libdcd',
['MDAnalysis/lib/formats/libdcd' + source_suffix],
include_dirs=include_dirs + ['MDAnalysis/lib/formats/include'],
Expand Down Expand Up @@ -416,7 +421,13 @@ def extensions(config):

cython_generated = []
if use_cython:
extensions = cythonize(pre_exts)
extensions = cythonize(
pre_exts,
compiler_directives={'linetrace' : cython_linetrace,
'embedsignature' : False},
)
if cython_linetrace:
print("Cython coverage will be enabled")
for pre_ext, post_ext in zip(pre_exts, extensions):
for source in post_ext.sources:
if source not in pre_ext.sources:
Expand Down Expand Up @@ -608,7 +619,7 @@ def dynamic_author_list():
)

# Releases keep their cythonized stuff for shipping.
if not config.get('keep_cythonized', default=is_release):
if not config.get('keep_cythonized', default=is_release) and not cython_linetrace:
for cythonized in cythonfiles:
try:
os.unlink(cythonized)
Expand Down