diff --git a/.github/hooks/pre-commit b/.github/hooks/pre-commit index bbfae50..b3765b8 100755 --- a/.github/hooks/pre-commit +++ b/.github/hooks/pre-commit @@ -24,7 +24,7 @@ function run_checks { } # add pre-commit commands here -run_checks "bandit" bandit src -c pyproject.toml -r +run_checks "bandit" bandit pyproject.toml -r run_checks "isort" isort src --check run_checks "mypy" mypy src run_checks "ruff check" ruff check src diff --git a/.github/workflows/fawltydeps.yaml b/.github/workflows/fawltydeps.yaml new file mode 100644 index 0000000..59bf53b --- /dev/null +++ b/.github/workflows/fawltydeps.yaml @@ -0,0 +1,17 @@ +on: [push] + +jobs: + fawltydeps: + runs-on: ubuntu-latest + name: "fawltydeps" + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: "3.11" + - name: Install dependencies + run: | + pip install -e .[dev] + - name: Run fawltydeps + run: | + fawltydeps diff --git a/README.md b/README.md index 22da9cd..58bf8a1 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,10 @@ https://spokanetech.github.io/blog/building-spokane-tech/intro/ | Workflow | Description | Status | |----------|-------------------------|------------------------------------------------------------------------------| |Bandit|security checks|![Bandit](https://github.com/SpokaneTech/SpokaneTechWeb/actions/workflows/bandit.yaml/badge.svg)| +|FawltyDeps|dependency checks|![FawltyDeps](https://github.com/SpokaneTech/SpokaneTechWeb/actions/workflows/fawltydeps.yaml/badge.svg)| |Isort|python import ordering|![Isort](https://github.com/SpokaneTech/SpokaneTechWeb/actions/workflows/isort.yaml/badge.svg)| |Mypy|static type checking|![Mypy](https://github.com/SpokaneTech/SpokaneTechWeb/actions/workflows/mypy.yaml/badge.svg)| +|PyTest|unittest execution|![Pytest](https://github.com/SpokaneTech/SpokaneTechWeb/actions/workflows/pytest.yaml/badge.svg)| |Radon|code complexity analysis|![Radon](https://github.com/SpokaneTech/SpokaneTechWeb/actions/workflows/radon.yaml/badge.svg)| |Ruff Format|code formatting|![Format](https://github.com/SpokaneTech/SpokaneTechWeb/actions/workflows/ruff_format.yaml/badge.svg)| |Ruff Lint|static code analysis|![Lint](https://github.com/SpokaneTech/SpokaneTechWeb/actions/workflows/ruff_lint.yaml/badge.svg)| diff --git a/pyproject.toml b/pyproject.toml index 0e82acc..0992fbe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,6 @@ dependencies = [ "psycopg2-binary", "redis", "requests>=2.26.0", - "pillow", "playwright", "whitenoise", ] @@ -35,6 +34,7 @@ dev = [ "coveralls", "django-debug-toolbar", "faker", + "fawltydeps", "isort", "model-bakery", "mypy", @@ -56,7 +56,7 @@ docker = [ [tool.bandit] exclude_dirs = [ "venv", - "src/django_project/local_test", + "src/local_test", "src/django_project/tests", "src/django_project/*/management/commands", "src/django_project/*/scripts/*" @@ -70,6 +70,7 @@ line-length = 120 [tool.coverage.report] show_missing = true omit = [ + "src/local_test/*", "src/django_project/manage.py", "src/django_project/core/asgi.py", "src/django_project/core/wsgi.py", @@ -91,7 +92,7 @@ profile = "black" [tool.mypy] exclude = [ "venv/*", - "src/django_project/local_test", + "src/local_test", "src/django_project/.*/migrations/.*", "src/django_project/.*/scripts/.*", ] @@ -114,8 +115,45 @@ exclude = [ "src/django_project/tests", "src/django_project/*/migrations", "src/django_project/*/scripts", - "src/django_project/*/local_test" + "src/local_test" + ] + + +[tool.fawltydeps] +code = ["src/django_project"] +deps = ["pyproject.toml"] +ignore_unused = [ + "bandit", + "black", + "coveralls", + "django-braces", + "django-celery-beat", + "django-debug-toolbar", + "django-extensions", + "django-filter", + "gunicorn", + "faker", + "fawltydeps", + "flower", + "isort", + "model-bakery", + "mypy", + "mypy-extensions", + "ruff", + "pillow", + "psycopg2-binary", + "pytest", + "pytest-cov", + "pytest-django", + "radon", + "redis", + "safety", + "types-python-dateutil", + "types-requests", + "typing_extensions", + "whitenoise" ] +output_format = "human_detailed" [tool.setuptools.packages.find] diff --git a/src/django_project/core/settings.py b/src/django_project/core/settings.py index 6aa1496..551472d 100644 --- a/src/django_project/core/settings.py +++ b/src/django_project/core/settings.py @@ -55,7 +55,6 @@ # third party apps "django_celery_beat", "django_extensions", - "django_filters", "handyhelpers", # project apps "web",