[tox] envlist = # The test vectors depend on new features now, # so until release we can only effectively test the local version of the ESDK. py{37,38,39,310}-awses_local, # 1.2.0 and 1.2.max are being difficult because of attrs bandit, doc8, readme, {flake8,pylint}{,-tests}, # prone to false positives vulture # Additional test environments: # # vulture :: Runs vulture. Prone to false-positives. # linters :: Runs all linters over all source code. # linters-tests :: Runs all linters over all tests. # Autoformatter helper environments: # # autoformat : Apply all autoformatters # # black-check : Check for "black" issues # blacken : Fix all "black" issues # # isort-seed : Generate a known_third_party list for isort. # NOTE: make the "known_third_party = " line in setup.cfg before running this # NOTE: currently it incorrectly identifies this library too; make sure you remove it # isort-check : Check for isort issues # isort : Fix isort issues # Operational helper environments: # # build :: Builds source and wheel dist files. # test-release :: Builds dist files and uploads to testpypi pypirc profile. # release :: Builds dist files and uploads to pypi pypirc profile. [testenv:base-command] commands = pytest --basetemp={envtmpdir} -l --cov awses_test_vectors test/ {posargs} [testenv] passenv = # Pass through AWS credentials AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN \ # AWS Role access in CodeBuild is via the contaner URI AWS_CONTAINER_CREDENTIALS_RELATIVE_URI \ # Pass through AWS profile name (useful for local testing) AWS_PROFILE sitepackages = False deps = -rtest/requirements.txt .. commands = {[testenv:base-command]commands} [testenv:full-encrypt] basepython = python3 sitepackages = False deps = .. commands = awses-full-message-encrypt {posargs} [testenv:full-decrypt-generate] basepython = python3 sitepackages = False deps = .. commands = awses-full-message-decrypt-generate {posargs} [testenv:full-decrypt] basepython = python3 sitepackages = False deps = .. commands = awses-full-message-decrypt {posargs} # mypy [testenv:mypy-coverage] commands = # Make mypy linecoverage report readable by coverage python -c \ "t = open('.coverage', 'w');\ c = open('build/coverage.json').read();\ t.write('!coverage.py: This is a private format, don\'t read it directly!\n');\ t.write(c);\ t.close()" coverage report -m [testenv:mypy-common] basepython = python3 deps = coverage mypy>=0.600 mypy_extensions typing>=3.6.2 [testenv:mypy-py3] basepython = {[testenv:mypy-common]basepython} deps = {[testenv:mypy-common]deps} commands = python -m mypy \ --linecoverage-report build \ src/awses_test_vectors/ \ {posargs} {[testenv:mypy-coverage]commands} # Linters [testenv:flake8] basepython = python3 deps = -r../dev_requirements/linter-requirements.txt commands = flake8 \ src/awses_test_vectors/ \ setup.py \ {posargs} [testenv:flake8-tests] basepython = {[testenv:flake8]basepython} deps = -r../dev_requirements/linter-requirements.txt commands = flake8 \ # Ignore F811 redefinition errors in tests (breaks with pytest-mock use) # E203 is not PEP8 compliant https://github.com/ambv/black#slices # W503 is not PEP8 compliant https://github.com/ambv/black#line-breaks--binary-operators --ignore F811,E203,W503,D \ test/ [testenv:pylint] basepython = python3 deps = -rtest/requirements.txt -r../dev_requirements/linter-requirements.txt commands = pylint \ --rcfile=src/pylintrc \ src/awses_test_vectors/ \ setup.py \ {posargs} [testenv:pylint-tests] basepython = {[testenv:pylint]basepython} deps = {[testenv:pylint]deps} commands = pylint \ --rcfile=test/pylintrc \ test/integration/ \ {posargs} [testenv:blacken-src] basepython = python3 deps = -r../dev_requirements/linter-requirements.txt commands = black --line-length 120 \ src/awses_test_vectors/ \ setup.py \ test/ \ {posargs} [testenv:blacken] basepython = python3 deps = {[testenv:blacken-src]deps} commands = {[testenv:blacken-src]commands} [testenv:black-check] basepython = python3 deps = {[testenv:blacken]deps} commands = {[testenv:blacken-src]commands} --diff [testenv:isort-seed] basepython = python3 deps = -r../dev_requirements/linter-requirements.txt commands = seed-isort-config [testenv:isort] basepython = python3 deps = -r../dev_requirements/linter-requirements.txt commands = isort -rc \ src \ test \ setup.py \ {posargs} [testenv:isort-check] basepython = python3 deps = {[testenv:isort]deps} commands = {[testenv:isort]commands} -c [testenv:autoformat] basepython = python3 deps = {[testenv:blacken]deps} {[testenv:isort]deps} .. commands = {[testenv:blacken]commands} {[testenv:isort]commands} [testenv:doc8] basepython = python3 deps = -r../dev_requirements/linter-requirements.txt commands = doc8 README.rst [testenv:readme] basepython = python3 deps = -r../dev_requirements/linter-requirements.txt commands = python setup.py check -r -s [testenv:bandit] basepython = python3 deps = -r../dev_requirements/linter-requirements.txt commands = bandit -r src/awses_test_vectors/ # Prone to false positives: only run independently [testenv:vulture] basepython = python3 deps = -r../dev_requirements/linter-requirements.txt commands = vulture src/awses_test_vectors/ [testenv:linters] basepython = python3 deps = {[testenv:flake8]deps} {[testenv:pylint]deps} {[testenv:doc8]deps} {[testenv:readme]deps} {[testenv:bandit]deps} commands = {[testenv:flake8]commands} {[testenv:pylint]commands} {[testenv:doc8]commands} {[testenv:readme]commands} {[testenv:bandit]commands} [testenv:linters-tests] basepython = python3 deps = {[testenv:flake8-tests]deps} {[testenv:pylint-tests]deps} commands = {[testenv:flake8-tests]commands} {[testenv:pylint-tests]commands} # Release tooling [testenv:park] basepython = python3 skip_install = true deps = -r../dev_requirements/release-requirements.txt commands = python setup.py park [testenv:build] basepython = python3 skip_install = true deps = -r../dev_requirements/release-requirements.txt commands = python setup.py sdist bdist_wheel [testenv:test-release] basepython = python3 skip_install = true deps = {[testenv:build]deps} twine commands = {[testenv:build]commands} twine upload --skip-existing --repository testpypi dist/* [testenv:release] basepython = python3 skip_install = true deps = {[testenv:build]deps} twine commands = {[testenv:build]commands} twine upload --skip-existing --repository pypi dist/*