summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2020-03-08 19:20:18 +0100
committerIlya Etingof <etingof@gmail.com>2020-03-08 19:22:13 +0100
commit4078c15c718b3668245ecdb7899f8f4e0c501fb2 (patch)
treedce3faf8f2030e2aa51e1e6dfe541f18649e4bed
parentacb78299d1270a2fea0d11e5509777b7c5777f3f (diff)
downloadpyasn1-git-4078c15c718b3668245ecdb7899f8f4e0c501fb2.tar.gz
Add tox.ini with some basic runners
-rw-r--r--.bandit.yml3
-rw-r--r--tox.ini47
2 files changed, 50 insertions, 0 deletions
diff --git a/.bandit.yml b/.bandit.yml
new file mode 100644
index 0000000..a0e3247
--- /dev/null
+++ b/.bandit.yml
@@ -0,0 +1,3 @@
+skips:
+- B603 # Ignore warnings about calling subprocess.Popen without shell=True
+- B607 # Ignore warnings about calling subprocess.Popen without a full path to executable
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..52d8772
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,47 @@
+[tox]
+minversion = 3.5.0
+envlist = unittest, docs, bandit, build
+
+[testenv]
+basepython = python3
+usedevelop = True
+setenv =
+ VIRTUAL_ENV={envdir}
+ PYTHONWARNINGS=default::DeprecationWarning
+install_command = pip install {opts} {packages}
+
+[testenv:unittest]
+deps =
+ discover
+ -r{toxinidir}/devel-requirements.txt
+ -r{toxinidir}/requirements.txt
+commands = discover -s tests
+
+[testenv:cover]
+setenv =
+ {[testenv]setenv}
+ PYTHON=coverage run --parallel-mode
+deps =
+ coverage
+ discover
+commands = coverage erase
+ coverage run --source pyasn1 -m unittest discover {posargs}
+ coverage report --fail-under 80
+
+[testenv:bandit]
+skip_install = true
+deps =
+ bandit
+commands =
+ bandit -r pyasn1 -c .bandit.yml
+
+[testenv:docs]
+commands = make -C docs html
+
+[testenv:build]
+skip_install = true
+deps =
+ wheel
+ setuptools
+commands =
+ python setup.py -q sdist bdist_wheel