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
This commit is contained in:
Justin Bollinger
2026-02-06 09:34:38 -05:00
parent 16f92a0f71
commit cabefe5b26
3 changed files with 25 additions and 4 deletions
+2 -3
View File
@@ -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:
+1 -1
View File
@@ -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:
+22
View File
@@ -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",