add tox and fix poetry

This commit is contained in:
Istvan Ruzman
2020-08-17 09:11:57 +02:00
parent b827713875
commit ba131f3741
3 changed files with 33 additions and 12 deletions

9
.gitignore vendored
View File

@@ -1,6 +1,9 @@
.coverage
dist
docs/.build/ docs/.build/
.mypy_cache
.pytest_cache
.tox
**egg-info
**.pyc **.pyc
**__pycache__ **__pycache__
**.mypy_cache
**.pytest_cache
.coverage

View File

@@ -1,6 +1,6 @@
[build-system] [build-system]
requires = ["poetry_core"] requires = ["poetry>=0.12"]
build-backend = "poetry.core.masonry.api" build-backend = "poetry.masonry.api"
[tool.poetry] [tool.poetry]
@@ -21,9 +21,6 @@ classifiers = [
"Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Systems Administration :: Authentication/Directory" "Topic :: System :: Systems Administration :: Authentication/Directory"
] ]
packages = [
{ include = "src/pyrad3"},
]
include = [ include = [
"LICENSE-APACHE", "LICENSE-APACHE",
"LICENSE-MIT", "LICENSE-MIT",
@@ -34,6 +31,7 @@ include = [
[tool.poetry.urls] [tool.poetry.urls]
repository = "https://github.com/pyradius/pyrad3" repository = "https://github.com/pyradius/pyrad3"
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = "^3.7" python = "^3.7"
@@ -43,6 +41,8 @@ black = "^19.3.10b0"
pytest = "^5.4" pytest = "^5.4"
pytest-black = "^0.3.10" pytest-black = "^0.3.10"
pytest-cov = "^2.10" pytest-cov = "^2.10"
pytest-flake8 = "^1.0"
pytest-isort = "^1.1.0"
pytest-mypy = "^0.6" pytest-mypy = "^0.6"
pytest-pylint = "^0.17" pytest-pylint = "^0.17"
@@ -53,12 +53,27 @@ include = '\.py'
[tool.isort] [tool.isort]
multi_line_output = 3
include_trailing_comma = true
use_parentheses = true
line_length = 88
combine_as_imports = true combine_as_imports = true
include_trailing_comma = true
line_length = 88
multi_line_output = 3
use_parentheses = true
[tool.pylint.messages_control] [tool.pylint.messages_control]
disable = "bad-continuation" disable = "bad-continuation"
[tool.tox]
legacy_tox_ini = """
[tox]
envlist = py37,py38
isolated_build = True
[testenv]
# whitelist_externals = poetry
deps =
poetry
commands =
poetry install -v
poetry run pytest --black --isort --pylint --pylint-jobs=4 --mypy --flake8 --cov=pyrad3
"""

View File

@@ -5,6 +5,8 @@ pkgs.mkShell {
buildInputs = with pkgs; [ buildInputs = with pkgs; [
git git
nixfmt nixfmt
pkgs.python37
pkgs.python38
pkgs.python3 pkgs.python3
pkgs.python3Packages.coveralls pkgs.python3Packages.coveralls
pkgs.python3Packages.black pkgs.python3Packages.black
@@ -16,6 +18,7 @@ pkgs.mkShell {
pkgs.python3Packages.pytest-isort pkgs.python3Packages.pytest-isort
pkgs.python3Packages.pytest-mypy pkgs.python3Packages.pytest-mypy
pkgs.python3Packages.pytest-pylint pkgs.python3Packages.pytest-pylint
pkgs.python3Packages.tox
]; ];
shellHook = '' shellHook = ''