Merge pull request #1339 from jooola/feat/ci_start_linting

Start linting 🎉 !
This commit is contained in:
Kyle Robbertze 2021-09-13 12:01:31 +00:00 committed by GitHub
commit 56f5a84146
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 209 additions and 75 deletions

View file

@ -0,0 +1,10 @@
all: lint
include ../../tools/python.mk
PIP_INSTALL := --editable .[dev]
PYLINT_ARG := airtime-celery
MYPY_ARG := airtime-celery
lint: .pylint .mypy
clean: .clean

View file

@ -18,10 +18,18 @@ setup(
},
license="MIT",
packages=["airtime-celery"],
python_requires=">=3.6",
install_requires=[
"celery==4.4.7",
"kombu==4.6.10",
"configobj",
],
extras_require={
"prod": [],
"dev": [
"mypy",
"pylint",
],
},
zip_safe=False,
)

View file

@ -1,19 +1,16 @@
.PHONY: lint test
all: lint test
SHELL := bash
CPU_CORES := $(shell nproc)
include ../../tools/python.mk
MODULE_APP := airtime_analyzer
MODULE_TESTS := tests
PIP_INSTALL := --editable .[dev]
PYLINT_ARG := airtime_analyzer tests
MYPY_ARG := airtime_analyzer tests
PYTEST_ARG := --cov=airtime_analyzer tests
lint:
pylint ${MODULE_APP}
pylint ${MODULE_TESTS}
lint: .pylint .mypy
fixtures:
bash tests/fixtures/generate.sh
test: fixtures
pytest -n ${CPU_CORES} --color=yes -v --cov=${MODULE_APP} ${MODULE_TESTS}
all: lint test
test: fixtures .pytest
clean: .clean

View file

@ -1,5 +0,0 @@
distro
pylint
pytest
pytest-cov
pytest-xdist

View file

@ -23,6 +23,7 @@ setup(
"libretime-analyzer=airtime_analyzer.cli:main",
]
},
python_requires=">=3.6",
install_requires=[
"mutagen>=1.31.0",
"pika>=1.0.0",
@ -33,5 +34,16 @@ setup(
# If this version is changed, it needs changing in the install script too
"pycairo==1.19.1",
],
extras_require={
"prod": [],
"dev": [
"distro",
"mypy",
"pylint",
"pytest",
"pytest-cov",
"pytest-xdist",
],
},
zip_safe=False,
)

View file

@ -1,16 +1,12 @@
.PHONY: lint test
SHELL := bash
CPU_CORES := $(shell nproc)
MODULE_APP := api_clients
MODULE_TESTS := tests
lint:
pylint ${MODULE_APP}
pylint ${MODULE_TESTS}
test:
pytest -n ${CPU_CORES} --color=yes -v --cov=${MODULE_APP} ${MODULE_TESTS}
all: lint test
include ../../tools/python.mk
PIP_INSTALL := --editable .[dev]
PYLINT_ARG := api_clients tests
MYPY_ARG := api_clients tests
PYTEST_ARG := --cov=api_clients tests
lint: .pylint .mypy
test: .pytest
clean: .clean

View file

@ -1,4 +0,0 @@
pylint
pytest
pytest-cov
pytest-xdist

View file

@ -18,10 +18,21 @@ setup(
},
license="AGPLv3",
packages=["api_clients"],
python_requires=">=3.6",
install_requires=[
"configobj",
"python-dateutil>=2.7.0",
"requests",
],
extras_require={
"prod": [],
"dev": [
"mypy",
"pylint",
"pytest",
"pytest-cov",
"pytest-xdist",
],
},
zip_safe=False,
)

10
python_apps/pypo/Makefile Normal file
View file

@ -0,0 +1,10 @@
all: lint
include ../../tools/python.mk
PIP_INSTALL := --editable .[dev]
PYLINT_ARG := liquidsoap pypo
MYPY_ARG := liquidsoap pypo
lint: .pylint .mypy
clean: .clean

View file

@ -27,6 +27,7 @@ setup(
"bin/airtime-liquidsoap",
"bin/pyponotify",
],
python_requires=">=3.6",
install_requires=[
"amqplib",
"configobj",
@ -37,5 +38,12 @@ setup(
"pytz",
"requests",
],
extras_require={
"prod": [],
"dev": [
"mypy",
"pylint",
],
},
zip_safe=False,
)