diff --git a/api/.coveragerc b/api/.coveragerc deleted file mode 100644 index a27c034bb..000000000 --- a/api/.coveragerc +++ /dev/null @@ -1,5 +0,0 @@ -[run] -include = funkwhale_api/* -omit = *migrations*, *tests*, funkwhale_api/schema.py -plugins = - django_coverage_plugin diff --git a/api/.pylintrc b/api/.pylintrc deleted file mode 100644 index 98584de45..000000000 --- a/api/.pylintrc +++ /dev/null @@ -1,11 +0,0 @@ -[MASTER] -load-plugins=pylint_common, pylint_django, pylint_celery - -[FORMAT] -max-line-length=120 - -[MESSAGES CONTROL] -disable=missing-docstring,invalid-name - -[DESIGN] -max-parents=13 diff --git a/api/poetry.lock b/api/poetry.lock index 6b397233b..bd59c60f0 100644 --- a/api/poetry.lock +++ b/api/poetry.lock @@ -2182,7 +2182,7 @@ testing = ["coverage (>=5.0.3)", "zope.event", "zope.testing"] [metadata] lock-version = "1.1" python-versions = "^3.7" -content-hash = "8d8abb451389ae4683f6256d87aca0d29334ab93c9cf41cd241807318ee8d290" +content-hash = "862d2326c53975e1c256d8ae23039b80d3bdbf3abf666df3430ebbb86f3214ea" [metadata.files] aiohttp = [ diff --git a/api/pyproject.toml b/api/pyproject.toml index 741cfc0ec..4e9b8dca4 100644 --- a/api/pyproject.toml +++ b/api/pyproject.toml @@ -72,7 +72,7 @@ pytest-sugar = "==0.9.6" pytest-asyncio = "==0.20.2" requests-mock = "==1.10.0" Faker = "==15.3.3" -coverage = "==6.5.0" +coverage = { version = "==6.5.0", extras = ["toml"] } django-coverage-plugin = "==2.0.4" factory-boy = "==3.2.1" django-debug-toolbar = "==3.7.0" @@ -86,3 +86,66 @@ debugpy = "==1.6.3" [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" + +[tool.pylint.master] +load-plugins = [ + "pylint_common", + "pylint_django", + "pylint_celery", +] + +[tool.pylint.messages_control] +disable = [ + "invalid-name", + "missing-class-docstring", + "missing-function-docstring", + "missing-module-docstring", +] + +[tool.pylint.design] +max-parents = 13 + +[tool.pylint.format] +max-line-length = 120 + +[tool.pytest.ini_options] +python_files = [ + "tests.py", + "test_*.py", + "*_tests.py", +] +testpaths = ["tests"] +addopts = "-p no:warnings" +env = [ + "SECRET_KEY=test", + "EMAIL_CONFIG=consolemail://", + "CELERY_BROKER_URL=memory://", + "CELERY_TASK_ALWAYS_EAGER=True", + "FUNKWHALE_HOSTNAME_SUFFIX=", + "FUNKWHALE_HOSTNAME_PREFIX=", + "FUNKWHALE_HOSTNAME=test.federation", + "FEDERATION_HOSTNAME=test.federation", + "FUNKWHALE_URL=https://test.federation", + "DEBUG_TOOLBAR_ENABLED=False", + "DEBUG=False", + "WEAK_PASSWORDS=True", + "CREATE_IMAGE_THUMBNAILS=False", + "FORCE_HTTPS_URLS=False", + "FUNKWHALE_SPA_HTML_ROOT=http://noop/", + "PROXY_MEDIA=true", + "MUSIC_USE_DENORMALIZATION=true", + "EXTERNAL_MEDIA_PROXY_ENABLED=true", + "DISABLE_PASSWORD_VALIDATORS=false", + "DISABLE_PASSWORD_VALIDATORS=false", + "FUNKWHALE_PLUGINS=", + "MUSIC_DIRECTORY_PATH=/music", +] + +[tool.coverage.run] +plugins = ["django_coverage_plugin"] +include = ["funkwhale_api/*"] +omit = [ + "*migrations*", + "*tests*", + "funkwhale_api/schema.py", +] diff --git a/api/setup.cfg b/api/setup.cfg deleted file mode 100644 index b36d56491..000000000 --- a/api/setup.cfg +++ /dev/null @@ -1,31 +0,0 @@ -[pep8] -max-line-length = 120 -exclude=.tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules - -[tool:pytest] -python_files = tests.py test_*.py *_tests.py -testpaths = tests -addopts = -p no:warnings -env = - SECRET_KEY=test - EMAIL_CONFIG=consolemail:// - CELERY_BROKER_URL=memory:// - CELERY_TASK_ALWAYS_EAGER=True - FUNKWHALE_HOSTNAME_SUFFIX= - FUNKWHALE_HOSTNAME_PREFIX= - FUNKWHALE_HOSTNAME=test.federation - FEDERATION_HOSTNAME=test.federation - FUNKWHALE_URL=https://test.federation - DEBUG_TOOLBAR_ENABLED=False - DEBUG=False - WEAK_PASSWORDS=True - CREATE_IMAGE_THUMBNAILS=False - FORCE_HTTPS_URLS=False - FUNKWHALE_SPA_HTML_ROOT=http://noop/ - PROXY_MEDIA=true - MUSIC_USE_DENORMALIZATION=true - EXTERNAL_MEDIA_PROXY_ENABLED=true - DISABLE_PASSWORD_VALIDATORS=false - DISABLE_PASSWORD_VALIDATORS=false - FUNKWHALE_PLUGINS= - MUSIC_DIRECTORY_PATH=/music diff --git a/changes/changelog.d/api-tools-config-pyproject.misc b/changes/changelog.d/api-tools-config-pyproject.misc new file mode 100644 index 000000000..4de38458e --- /dev/null +++ b/changes/changelog.d/api-tools-config-pyproject.misc @@ -0,0 +1 @@ +Move api tools config to pyproject.toml