From cabefe5b2616c8a575a9e892b79ebcc231d5ded0 Mon Sep 17 00:00:00 2001 From: Justin Bollinger Date: Fri, 6 Feb 2026 09:34:38 -0500 Subject: [PATCH] refactor: add optional dev dependencies and mypy configuration - Add optional [dev] dependency group with mypy, ruff, pytest, and type stubs - Include types-requests, types-beautifulsoup4, and types-openpyxl - Add mypy config to exclude submodule directories - Update GitHub workflow to install with optional dev dependencies - Remove --ignore-missing-imports flag from mypy for stricter type checking --- .github/workflows/tests.yml | 5 ++--- hate_crack/main.py | 2 +- pyproject.toml | 22 ++++++++++++++++++++++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d80ee89..7a46bb5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,14 +25,13 @@ jobs: - name: Install project dependencies run: | uv venv .venv - uv pip install --python .venv/bin/python pytest pytest-cov ruff mypy - uv pip install --python .venv/bin/python . + uv pip install --python .venv/bin/python ".[dev]" - name: Run ruff run: .venv/bin/ruff check hate_crack - name: Run mypy - run: .venv/bin/mypy --ignore-missing-imports hate_crack + run: .venv/bin/mypy hate_crack - name: Run tests env: diff --git a/hate_crack/main.py b/hate_crack/main.py index ce16fd3..a594ab0 100755 --- a/hate_crack/main.py +++ b/hate_crack/main.py @@ -29,7 +29,7 @@ requests: Any = None REQUESTS_AVAILABLE = False try: - import requests as requests # type: ignore[import-untyped] # noqa: F401 + import requests as requests # type: ignore[import-untyped, no-redef] # noqa: F401 REQUESTS_AVAILABLE = True except Exception: diff --git a/pyproject.toml b/pyproject.toml index 0fc8ace..8513010 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,6 +16,17 @@ dependencies = [ [project.scripts] hate_crack = "hate_crack.__main__:main" +[project.optional-dependencies] +dev = [ + "mypy>=1.8.0", + "ruff>=0.3.0", + "pytest>=7.0.0", + "pytest-cov>=4.0.0", + "types-requests>=2.31.0", + "types-beautifulsoup4>=4.12.0", + "types-openpyxl>=3.0.0", +] + [tool.setuptools.packages.find] include = ["hate_crack*"] @@ -36,6 +47,17 @@ exclude = [ "wordlists", ] +[tool.mypy] +exclude = [ + "^build/", + "^dist/", + "^PACK/", + "^wordlists/", + "^hate_crack/hashcat-utils/", + "^hate_crack/princeprocessor/", +] +ignore_missing_imports = false + [tool.pytest.ini_options] testpaths = [ "tests",