Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
kwant
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Joseph Weston
kwant
Commits
ff6b2b54
There was a problem fetching the pipeline summary.
Commit
ff6b2b54
authored
Jul 25, 2016
by
Joseph Weston
Browse files
Options
Downloads
Patches
Plain Diff
enable coverage reports for cython modules
parent
242518ab
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#
Changes
3
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.coveragerc
+1
-0
1 addition, 0 deletions
.coveragerc
.gitlab-ci.yml
+2
-2
2 additions, 2 deletions
.gitlab-ci.yml
setup.py
+21
-1
21 additions, 1 deletion
setup.py
with
24 additions
and
3 deletions
.coveragerc
+
1
−
0
View file @
ff6b2b54
[run]
plugins = Cython.Coverage
omit = */tests/*
This diff is collapsed.
Click to expand it.
.gitlab-ci.yml
+
2
−
2
View file @
ff6b2b54
job
:
script
:
-
python3 setup.py build
-
python3 setup.py build_ext -i
-
python3 setup.py build
--cython-trace
-
python3 setup.py build_ext
--cython-trace
-i
-
make -C doc clean && make -C doc html
-
py.test --cov=kwant --flakes kwant
This diff is collapsed.
Click to expand it.
setup.py
+
21
−
1
View file @
ff6b2b54
...
...
@@ -48,6 +48,7 @@ README_END_BEFORE = 'See also in this directory:'
STATIC_VERSION_PATH
=
(
'
kwant
'
,
'
_kwant_version.py
'
)
REQUIRED_CYTHON_VERSION
=
(
0
,
22
)
CYTHON_OPTION
=
'
--cython
'
CYTHON_TRACE_OPTION
=
'
--cython-trace
'
TUT_DIR
=
'
tutorial
'
TUT_GLOB
=
'
doc/source/tutorial/*.py
'
TUT_HIDDEN_PREFIX
=
'
#HIDDEN
'
...
...
@@ -80,6 +81,16 @@ try:
except
ValueError
:
use_cython
=
version_is_from_git
try
:
sys
.
argv
.
remove
(
CYTHON_TRACE_OPTION
)
trace_cython
=
True
if
not
use_cython
:
print
(
'
error: --cython-trace provided, but cython will not be run
'
,
file
=
sys
.
stderr
)
exit
(
1
)
except
ValueError
:
trace_cython
=
False
if
use_cython
:
try
:
import
Cython
...
...
@@ -312,6 +323,13 @@ def extensions():
'
kwant/graph/c_slicer/partitioner.h
'
,
'
kwant/graph/c_slicer/slicer.h
'
]})]
#### Add cython tracing macro
if
trace_cython
:
for
args
,
kwargs
in
result
:
macros
=
kwargs
.
get
(
'
define_macros
'
,
[])
macros
.
append
((
'
CYTHON_TRACE
'
,
'
1
'
))
kwargs
[
'
define_macros
'
]
=
macros
#### Add components of Kwant with external compile-time dependencies.
config
=
configparser
.
ConfigParser
()
try
:
...
...
@@ -383,7 +401,9 @@ def ext_modules(extensions):
"""
if
use_cython
and
cython_version
>=
REQUIRED_CYTHON_VERSION
:
return
cythonize
([
Extension
(
*
args
,
**
kwrds
)
for
args
,
kwrds
in
extensions
],
language_level
=
3
)
for
args
,
kwrds
in
extensions
],
language_level
=
3
,
compiler_directives
=
{
'
linetrace
'
:
trace_cython
}
)
# Cython is not going to be run: replace pyx extension by that of
# the shipped translated file.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment