summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2019-04-15 08:26:36 +0200
committerChristian Heimes <christian@python.org>2019-04-15 08:57:31 +0200
commitefb01586d912f3fd7e16098c8768a147ce21bb96 (patch)
treedd1943b0bfcb1e0fd21ab3e9366d3a07b8b718c5
parent49fe241089cac233ea59dd3c2a056a4de7f51257 (diff)
downloaddefusedxml-git-efb01586d912f3fd7e16098c8768a147ce21bb96.tar.gz
Add codecov and badges
Signed-off-by: Christian Heimes <christian@python.org>
-rw-r--r--.coveragerc10
-rw-r--r--.travis.yml5
-rw-r--r--Makefile18
-rw-r--r--README.md13
-rw-r--r--README.txt26
-rw-r--r--tox.ini9
6 files changed, 58 insertions, 23 deletions
diff --git a/.coveragerc b/.coveragerc
new file mode 100644
index 0000000..9dd169a
--- /dev/null
+++ b/.coveragerc
@@ -0,0 +1,10 @@
+[run]
+branch = True
+source =
+ defusedxml/
+ tests.py
+
+[paths]
+source =
+ defusedxml/
+ .tox/py*/lib/python*/site-packages/defusedxml/
diff --git a/.travis.yml b/.travis.yml
index e729b8d..5f60377 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -30,8 +30,11 @@ matrix:
install:
- pip install --upgrade pip setuptools
- pip --version
- - pip install tox
+ - pip install tox codecov
- tox --version
script:
- tox
+
+after_success:
+ - codecov
diff --git a/Makefile b/Makefile
index 83e5dc8..2e7cd2d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,7 @@
-PYTHON=python
+PYTHON=python3
SETUPFLAGS=
COMPILEFLAGS=
INSTALLFLAGS=
-PYTHONS=python2.6 python2.7 python3.1 python3.2 python3.3 python3.4
.PHONY: inplace all rebuild test_inplace test fulltests clean distclean
.PHONY: sdist install black
@@ -12,6 +11,7 @@ all: inplace black README.html README.md
README.md: README.txt CHANGES.txt
pandoc --from=rst --to=gfm README.txt > $@
pandoc --from=rst --to=gfm CHANGES.txt >> $@
+ sed -i ':a;N;$$!ba;s/\n\[!/[!/g' $@
README.html: README.txt CHANGES.txt void.css
@echo | cat README.txt - CHANGES.txt | \
@@ -31,20 +31,6 @@ test: test_inplace
black:
black $(CURDIR) || true
-fulltest:
- $(MAKE) clean
- @set -e; \
- for python in $(PYTHONS); do \
- if [ -z $$(which $$python) ]; then \
- echo "*** $$python not found ***\n"; \
- continue; \
- fi; \
- echo "*** $$python ***"; \
- $$python $(SETUPFLAGS) setup.py -q test; \
- echo ""; \
- done
- $(MAKE) clean
-
clean:
@find . \( -name '*.o' -or -name '*.so' -or -name '*.sl' -or \
-name '*.py[cod]' -or -name README.html \) \
diff --git a/README.md b/README.md
index db784b7..5e9d0c3 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,15 @@
# defusedxml -- defusing XML bombs and other exploits
-
-> "It's just XML, what could probably go wrong?"
+[![Latest
+Version](https://img.shields.io/pypi/v/defusedxml.svg)](https://pypi.org/project/defusedxml/)
+[![Supported Python
+versions](https://img.shields.io/pypi/pyversions/defusedxml.svg)](https://pypi.org/project/defusedxml/)
+[![Travis
+CI](https://travis-ci.org/tiran/defusedxml.svg?branch=master)](https://travis-ci.org/tiran/defusedxml)
+[![codecov](https://codecov.io/github/tiran/defusedxml/coverage.svg?branch=master)](https://codecov.io/github/tiran/defusedxml?branch=master)
+[![PyPI
+downloads](https://img.shields.io/pypi/dm/defusedxml.svg)](https://pypistats.org/packages/defusedxml)
+[![Code style:
+black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
Christian Heimes \<<christian@python.org>\>
diff --git a/README.txt b/README.txt
index ddfe33f..eb0f13a 100644
--- a/README.txt
+++ b/README.txt
@@ -2,6 +2,32 @@
defusedxml -- defusing XML bombs and other exploits
===================================================
+.. image:: https://img.shields.io/pypi/v/defusedxml.svg
+ :target: https://pypi.org/project/defusedxml/
+ :alt: Latest Version
+
+.. image:: https://img.shields.io/pypi/pyversions/defusedxml.svg
+ :target: https://pypi.org/project/defusedxml/
+ :alt: Supported Python versions
+
+.. image:: https://travis-ci.org/tiran/defusedxml.svg?branch=master
+ :target: https://travis-ci.org/tiran/defusedxml
+ :alt: Travis CI
+
+.. image:: https://codecov.io/github/tiran/defusedxml/coverage.svg?branch=master
+ :target: https://codecov.io/github/tiran/defusedxml?branch=master
+ :alt: codecov
+
+.. image:: https://img.shields.io/pypi/dm/defusedxml.svg
+ :target: https://pypistats.org/packages/defusedxml
+ :alt: PyPI downloads
+
+.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
+ :target: https://github.com/ambv/black
+ :alt: Code style: black
+
+..
+
"It's just XML, what could probably go wrong?"
Christian Heimes <christian@python.org>
diff --git a/tox.ini b/tox.ini
index 1920c59..8bae237 100644
--- a/tox.ini
+++ b/tox.ini
@@ -4,15 +4,16 @@ skip_missing_interpreters = true
[testenv]
commands =
- {envpython} setup.py test
+ coverage run --parallel-mode tests.py
+ coverage combine
+ coverage report -m
deps =
lxml
+ coverage
[testenv:py38]
-commands =
- {envpython} setup.py test
# lxml FTBFS because Python sets -Wimplicit-int
-deps =
+deps = coverage
[testenv:black]
commands = black --check --verbose \