Setup Python project and CI
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Val Lorentz 2023-05-20 14:25:39 +02:00
parent 6429d9e6ee
commit b10f01d30b
6 changed files with 128 additions and 0 deletions

35
.woodpecker.yml Normal file
View File

@ -0,0 +1,35 @@
pipeline:
flake8:
group: lint
image: python:3.9
commands:
- pip3 install flake8
- flake8 glowtables/
pylint:
group: lint
image: cytopia/pylint
commands:
- pylint glowtables/
black:
group: lint
image: pyfound/black:22.8.0
commands:
- black --check glowtables/
test-py3.9:
group: test
image: python:3.9
commands: &test_commands
- apt-get update
- pip3 install mypy .[testing]
- make mypy
- make pytest
test-py3.10:
group: test
image: python:3.10
commands: *test_commands
test-py3.11:
group: test
image: python:3.11
commands: *test_commands

31
Makefile Normal file
View File

@ -0,0 +1,31 @@
all: test
test: lint pytest
lint: black flake8 pylint isort mypy
black-check:
black --check glowtables/
black:
black glowtables/
flake8: black
flake8 glowtables/
pylint:
pylint glowtables/
isort-check:
isort --check-only glowtables/
isort:
isort glowtables/
mypy:
mypy --show-error-codes glowtables
pytest:
pytest --doctest-modules
.PHONY: black black-check isort isort-check mypy pytest test

0
glowtables/__init__.py Normal file
View File

57
pyproject.toml Normal file
View File

@ -0,0 +1,57 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "globtables"
version = "0.0.1"
requires-python = ">=3.9"
dependencies = [
"flask == 2.*",
]
[project.optional-dependencies]
testing = [
"pytest",
"pytest-mock",
"requests-mock",
"types-requests",
"types-setuptools",
]
[tool.isort]
profile = "black"
[tool.mypy]
python_version = "3.9"
[[tool.mypy.overrides]]
module = [
"requests_mock",
]
ignore_missing_imports = true
[tool.pylint.format]
max-line-length = "88"
py-version = "3.9"
disable = [
# too annoying:
"fixme",
"invalid-name",
"no-else-return",
"no-else-continue",
"too-few-public-methods",
"too-many-instance-attributes",
# false positives:
"unreachable",
"assignment-from-no-return",
# mypy does it better:
"no-member",
"unsupported-membership-test",
"import-error",
# flake8 does it already:
"line-too-long",
]
[tool.pytest.ini_options]
python_files = "*_test.py"

3
setup.cfg Normal file
View File

@ -0,0 +1,3 @@
[flake8]
max-line-length = 88
extend-ignore = E203

View File

@ -0,0 +1,2 @@
def test_nothing():
pass