Skip to content

Commit

Permalink
Merge fb8747e into 23610d4
Browse files Browse the repository at this point in the history
  • Loading branch information
lbdreyer committed Sep 26, 2018
2 parents 23610d4 + fb8747e commit 02ef8e3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ omit =
cf_units/etc/*
cf_units/tests/*
.eggs
plugins = Cython.Coverage


[report]
Expand Down
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,18 @@ install:
- conda create --name $ENV_NAME python=$TRAVIS_PYTHON_VERSION udunits2 --file requirements.txt --file requirements-dev.txt
- source activate $ENV_NAME

# Enable coverage of cython.
- export CYTHON_COVERAGE=1

# Output debug info.
- conda list
- conda info -a

# cf_units.
# Install cf_units.
- PREFIX=$HOME/miniconda/envs/$ENV_NAME

- pip install -e .

script:
- coverage run -m pytest cf_units cf_units
- pytest --pyargs --cov

after_success: coveralls
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ def read(*parts):
extra_extension_args = dict(
runtime_library_dirs=library_dirs)

# Enable cython coverage
cython_coverage_enabled = os.environ.get('CYTHON_COVERAGE', None)
if cython_coverage_enabled:
extra_extension_args.update({'define_macros': [('CYTHON_TRACE_NOGIL', '1')]})

ext = 'pyx' if cythonize else 'c'

udunits_ext = Extension('cf_units._udunits2',
Expand All @@ -55,7 +60,7 @@ def read(*parts):
**extra_extension_args)

if cythonize:
[udunits_ext] = cythonize(udunits_ext)
[udunits_ext] = cythonize(udunits_ext, compiler_directives={'linetrace': True})

cmdclass = {}
cmdclass.update(versioneer.get_cmdclass())
Expand Down

0 comments on commit 02ef8e3

Please sign in to comment.