
Pipenv is a tool that brings better package dependency management to python. It can automatically create and manage virtualenv as well as managing package dependencies using Pipfile and Pipfile.lock. Adding this dependency manager into Airship projects will decrease package version conflicts between projects and help increase security through hash validation of packages and vulnerability scans. Changes: - Imports requirements.txt type files into Pipfile - Pipenv dependency management in tox - Switches Safety package for "pipenv check", an implementation of Safety - Unpins or loosens pins on all development packages - Soft pins package dependencies to encourage adoption of bug fixes and prevent small version mismatches Pipenv Docs: https://docs.pipenv.org/en/latest/ Helpful Pipenv Guide: https://realpython.com/pipenv-guide/ Change-Id: I2c9cec8acf6b6c6157f807b010def873c349d3ae
91 lines
1.8 KiB
INI
91 lines
1.8 KiB
INI
[tox]
|
|
envlist = py36, py37, pep8, docs, cover
|
|
minversion = 2.3.1
|
|
skipsdist = True
|
|
|
|
[testenv]
|
|
usedevelop = True
|
|
setenv =
|
|
VIRTUAL_ENV={envdir}
|
|
LANGUAGE=en_US
|
|
LC_ALL=en_US.utf-8
|
|
PIPENV_VERBOSITY=-1
|
|
deps =
|
|
pipenv
|
|
passenv = http_proxy https_proxy HTTP_PROXY HTTPS_PROXY no_proxy NO_PROXY PBR_VERSION
|
|
whitelist_externals =
|
|
find
|
|
commands =
|
|
pipenv install --dev
|
|
find . -type f -name "*.pyc" -delete
|
|
{toxinidir}/tools/gate/run-unit-tests.sh '{posargs}'
|
|
|
|
[testenv:fmt]
|
|
basepython = python3
|
|
deps =
|
|
pipenv
|
|
commands =
|
|
pipenv install --dev
|
|
yapf -ir {toxinidir}/spyglass {toxinidir}/tests
|
|
|
|
[testenv:pep8]
|
|
basepython = python3
|
|
deps =
|
|
pipenv
|
|
commands =
|
|
pipenv install --dev
|
|
bash -c {toxinidir}/tools/gate/whitespace-linter.sh
|
|
yapf -dr {toxinidir}/spyglass {toxinidir}/setup.py {toxinidir}/tests
|
|
flake8 {toxinidir}/spyglass {toxinidir}/tests
|
|
bandit -r spyglass -n 5
|
|
pipenv check
|
|
whitelist_externals =
|
|
bash
|
|
|
|
[testenv:safety]
|
|
deps =
|
|
pipenv
|
|
commands =
|
|
pipenv install --dev
|
|
pipenv check
|
|
|
|
[testenv:bandit]
|
|
deps =
|
|
pipenv
|
|
commands =
|
|
pipenv install --dev
|
|
bandit -r spyglass -n 5
|
|
|
|
[testenv:update-requirements]
|
|
deps =
|
|
pipenv
|
|
commands =
|
|
pipenv lock --clear
|
|
bash -c "pipenv lock -r > {toxinidir}/requirements.txt"
|
|
whitelist_externals =
|
|
bash
|
|
|
|
[flake8]
|
|
ignore = W503
|
|
|
|
[testenv:docs]
|
|
basepython = python3
|
|
deps =
|
|
-r{toxinidir}/doc/requirements.txt
|
|
commands =
|
|
rm -rf doc/build
|
|
sphinx-build -b html doc/source doc/build/html -n -W -v
|
|
whitelist_externals = rm
|
|
|
|
[testenv:cover]
|
|
basepython = python3
|
|
deps =
|
|
pipenv
|
|
commands =
|
|
pipenv install --dev
|
|
bash -c 'PATH=$PATH:~/.local/bin; pytest --cov=spyglass \
|
|
--cov-report html:cover --cov-report xml:cover/coverage.xml \
|
|
--cov-report term --cov-fail-under 60 tests/'
|
|
whitelist_externals =
|
|
bash
|