Skip to content

Instantly share code, notes, and snippets.

@ishideo
Last active March 3, 2020 05:34
Show Gist options
  • Save ishideo/4e6db6f25ec92bad22069ca0d7b7e771 to your computer and use it in GitHub Desktop.
Save ishideo/4e6db6f25ec92bad22069ca0d7b7e771 to your computer and use it in GitHub Desktop.
[flake8]
ignore = E203, E266, E501, W503, F403, F401
max-line-length = 88
max-complexity = 18
select = B,C,E,F,W,T4,B9
#!/usr/bin/env bash
# download & install poetry
curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python
# pyenv command
pyenv install 3.8.1
pyenv local 3.8.1
# local poetry config command
poetry config --local virtualenvs.in-project true
# install packages accordingly to pyproject.toml
poetry install
[tool.poetry]
name = "pyproject template"
version = "0.1.0"
description = ""
authors = [""]
[tool.poetry.dependencies]
python = "^3.8"
pandas = "^0.25.1"
returns = "^0.13.0"
retry = "^0.9.2"
[tool.poetry.dev-dependencies]
pytest = "^5.3.2"
black = "^19.10b0"
isort = "^4.3.21"
flake8 = "^3.7.9"
pytest-mock = "^2.0.0"
tox = "^3.14.3"
coverage = "^5.0.3"
pytest-cov = "^2.8.1"
pynvim = "^0.4.1"
jedi = "^0.16.0"
mypy = "^0.761"
pyls-black = "^0.4.4"
pylint = "^2.4.4"
radon = "^4.1.0"
flake8-import-order = "^0.18.1"
jsonpickle = "^1.2"
flake8-bugbear = "^20.1.4"
flake8-pyi = "^19.3.0"
frosted = "^1.4.1"
bandit = "^1.6.2"
xenon = "^0.7.0"
nox = "^2019.11.9"
flake8-black = "^0.1.1"
flake8-annotations = "^1.1.3"
darglint = "^1.1.3"
safety = "^1.8.5"
pytype = "^2020.2.6"
flake8-bandit = "^2.1.2"
pytest-harvest = "^1.7.4"
pytest-spec = "^2.0.0"
pytest-instafail = "^0.4.1"
pytest-parallel = "^0.0.10"
pandas-vet = "^0.2.2"
pytest-mypy-plugins = "^1.2.0"
[tool.black]
line-length = 88
include = '\.pyi?$'
exclude = '''
(
migrations
| .mypy_cache
| .pytest_cache
| .tox
| .venv
| venv
| _build
| buck-out
| build
| dist
)
'''
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
[tox]
skipsdist = True
envlist = lint, mypy, py37, py38
skip_missing_interpreters = True
[testenv]
whitelist_externals = pytest
skip_install = true
passenv = APIKEY
deps = pytest-cov
commands =
pytest -s -v --tests-per-worker auto --spec --cov=tests --cov-report=term-missing
[testenv:lint]
whitelist_externals = bandit, black, flake8, isort, radon, xenon
skip_install = true
deps =
bandit
black
flake8
isort
radon
xenon
commands =
isort --recursive my_apps tests
black my_apps tests
flake8 my_apps tests
bandit my_apps tests
radon cc -s my_apps tests
radon cc -s my_apps tests
xenon my_apps tests --max-absolute B --max-modules A --max-average A
[testenv:mypy]
whitelist_externals = mypy
deps = mypy
commands = mypy my_apps tests --ignore-missing-imports --strict
#!/usr/bin/env bash
poetry run tox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment