Skip to content

Commit

Permalink
ci: Repair coverate measurements
Browse files Browse the repository at this point in the history
Measure the coverage an CircleCI and send to coveralls.
  • Loading branch information
Synss committed May 5, 2019
1 parent 3657b33 commit 8a2e5e0
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 10 deletions.
22 changes: 18 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,31 @@ jobs:
- run:
name: Create environment
command: python -m venv venv
command: |
python -m venv venv
. venv/bin/activate
pip install -r requirements-circleci.txt
- run:
name: run tests
command: |
eval "$(pyenv init -)"
pyenv shell 2.7.15 3.4.10 3.5.7 3.6.8 3.7.3
. venv/bin/activate
pip install tox
tox -p auto -e py27,py34,py35,py36,py37
tox -e doctest
tox -q -p auto -e py27,py34,py35,py36,py37
tox -q -p auto -e coverage,doctest
- run:
name: save coverage report
when: on_success
command: |
mkdir -p out/
cp -R htmlcov/ out/htmlcov/
eval "$(pyenv init -)"
pyenv shell 3.7.3
. venv/bin/activate
PYTHONPATH=src coveralls
- run:
name: build API documentation
Expand Down
4 changes: 2 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[run]
plugins = Cython.Coverage
source = mbedtls

[report]
omit = */__init__.py
include =
src/*
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Misc.

* *: Format Python files with `black`
* ci: Check that the docs build in CI.
* ci: Repair test coverage measurements on coveralls.


[0.17.1] - 2019-04-16
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Cryptographic library for Python with Mbed TLS back end
:target: https://travis-ci.org/Synss/python-mbedtls

.. image::
https://coveralls.io/repos/github/Synss/python-mbedtls/badge.svg?branch=develop
:target: https://coveralls.io/github/Synss/python-mbedtls?branch=develop
https://coveralls.io/repos/github/Synss/python-mbedtls/badge.svg?branch=master
:target: https://coveralls.io/github/Synss/python-mbedtls?branch=master


`python-mbedtls`_ is a free cryptographic library for Python that uses
Expand Down
3 changes: 3 additions & 0 deletions requirements-circleci.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
coveralls
cython
tox
22 changes: 22 additions & 0 deletions requirements-circleci.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile -o requirements-circleci.txt requirements-circleci.in
#
certifi==2019.3.9 # via requests
chardet==3.0.4 # via requests
coverage==4.5.3 # via coveralls
coveralls==1.7.0
cython==0.29.7
docopt==0.6.2 # via coveralls
filelock==3.0.10 # via tox
idna==2.8 # via requests
pluggy==0.9.0 # via tox
py==1.8.0 # via tox
requests==2.21.0 # via coveralls
six==1.12.0 # via tox
toml==0.10.0 # via tox
tox==3.9.0
urllib3==1.24.3 # via requests
virtualenv==16.5.0 # via tox
20 changes: 18 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{27,34,35,36,37},doctest,docs
envlist = py{27,34,35,36,37},doctest,docs,coverage

[testenv]
deps =
Expand All @@ -18,9 +18,25 @@ deps =
pytest-black
commands = {envpython} -m pytest --black --basetemp={envtmpdir} {posargs}

[testenv:coverage]
skip_install = True
basepython = python3.7
deps =
{[testenv]deps}
cython
pytest-cov
passenv =
LD_LIBRARY_PATH
DYLD_LIBRARY_PATH
C_INCLUDE_PATH
setenv = PYTHONPATH = {toxinidir}/src
commands =
{envpython} setup.py --with-coverage build_ext -i
{envpython} -m pytest --basetemp={envtmpdir} --cov=src tests/
coverage html

[testenv:doctest]
basepython = python3.7
envdir = {toxworkdir}/py37
commands = {envpython} -m doctest README.rst

[testenv:docs]
Expand Down

0 comments on commit 8a2e5e0

Please sign in to comment.