Bootstrapping with python support files

This commit is contained in:
Luke Murphy 2020-03-28 16:49:11 +01:00
parent 2421813bd7
commit 831467ca74
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
7 changed files with 111 additions and 2 deletions

24
.drone.yml Normal file
View File

@ -0,0 +1,24 @@
---
kind: pipeline
name: default
matrix:
include:
- python: 3.8
env: TOXENV=py38
- python: 3.8
env: TOXENV=lint
- python: 3.8
env: TOXENV=sort
- python: 3.8
env: TOXENV=format
- python: 3.8
env: TOXENV=type
steps:
- name: Tox matrix testing
image: python:3.8.2-buster
commands:
- pip install tox==3.14.6
- tox

12
.gitignore vendored Normal file
View File

@ -0,0 +1,12 @@
*.egg-info/
*.pyc
.coverage
.eggs/
.mypy_cache/
.tox/
.venv/
__pycache__
build/
dist/
pip-wheel-metadata/
documentation/build/

View File

@ -1,5 +1,7 @@
#!/usr/bin/python3
from ansible.module_utils.basic import AnsibleModule
DOCUMENTATION = """
---
module: gandi_dns
@ -14,8 +16,6 @@ EXAMPLES = """
ipv4: 192.168.1.2
"""
from ansible.module_utils.basic import AnsibleModule
def main():
module = AnsibleModule(argument_spec={})

4
mypy.ini Normal file
View File

@ -0,0 +1,4 @@
[mypy]
python_version = 3.7
platform = linux
ignore_missing_imports = True

13
pyproject.toml Normal file
View File

@ -0,0 +1,13 @@
[build-system]
requires = [
"setuptools>=40.9.0",
"setuptools-scm",
"wheel",
]
build-backend = "setuptools.build_meta"
[tool.black]
line-length = 80
target-version = ["py38"]
skip-string-normalization = true
include = '\.pyi?$'

16
setup.cfg Normal file
View File

@ -0,0 +1,16 @@
[tool:pytest]
testpaths = test
[flake8]
max-line-length = 80
[isort]
line_length = 80
multi_line_output = 3
skip = .venv, .tox
include_trailing_comma = True
[metadata]
name = autonomic.gandi
author = decentral1se
version = 0.0.1

40
tox.ini Normal file
View File

@ -0,0 +1,40 @@
[tox]
envlist =
{py38}
lint
sort
format
type
skip_missing_interpreters = True
isolated_build = True
[testenv]
description = run the unit tests
deps =
pytest
pytest-cov
commands = pytest test/ --cov={toxinidir}/library/ --no-cov-on-fail {posargs}
[testenv:lint]
description = lint the source
skipdist = True
deps = flake8
commands = flake8 {posargs} library/ test/
[testenv:sort]
description = sort the source
skipdist = True
deps = isort
commands = isort {posargs:-rc -c} -sp setup.cfg library/ test/
[testenv:format]
description = format the source
skipdist = True
deps = black
commands = black {posargs:--check} library/ test/
[testenv:type]
description = type check the source
skipdist = True
deps = mypy
commands = mypy library/ test/