Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"**/dist/**": true,
"**/pyrit/auxiliary_attacks/gcg/attack/**": true,
"**/doc/**": true,
"**/.mypy_cache/**": true,
"**/.ty_cache/**": true,
"**/frontend/node_modules/**": true,
"**/frontend/dist/**": true,
"**/dbdata/**": true
Expand Down
4 changes: 2 additions & 2 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
- pip-cache:/home/vscode/.cache/pip:cached
- uv-cache:/home/vscode/.cache/uv:cached
- precommit-cache:/home/vscode/.cache/pre-commit:cached
- mypy-cache:/workspace/.mypy_cache:cached
- ty-cache:/workspace/.ty_cache:cached
- pylance-cache:/home/vscode/.cache/pylance:cached
- node-modules:/workspace/frontend/node_modules:cached
- ~/.pyrit:/home/vscode/.pyrit:cached
Expand All @@ -28,6 +28,6 @@ volumes:
pip-cache:
uv-cache:
precommit-cache:
mypy-cache:
ty-cache:
pylance-cache:
node-modules:
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ build/
**/*.py[cod]
**/*$py.class
**/.pytest_cache/
**/.mypy_cache/
**/.ty_cache/

# Environment files with secrets
.env
Expand Down
11 changes: 0 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,6 @@ repos:
additional_dependencies: ['requests']
exclude: (release_process.md|git.md|^doc/deployment/|tests|pyrit/prompt_converter/morse_converter.py|.github|pyrit/prompt_converter/emoji_converter.py|pyrit/score/markdown_injection.py|^pyrit/datasets/|^pyrit/auxiliary_attacks/gcg/)

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.15.0
hooks:
- id: mypy
name: mypy (strict)
files: &strict_modules ^pyrit/
args: [--install-types, --non-interactive, --ignore-missing-imports, --sqlite-cache, --cache-dir=.mypy_cache, --strict]
entry: mypy
language: system
types: [ python ]

- repo: local
hooks:
- id: validate-jupyter-book
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: all pre-commit mypy test test-cov-html test-cov-xml
.PHONY: all pre-commit ty test test-cov-html test-cov-xml

CMD:=uv run -m
PYMODULE:=pyrit
Expand All @@ -13,8 +13,8 @@ pre-commit:
$(CMD) isort --multi-line 3 --recursive $(PYMODULE) $(TESTS)
pre-commit run --all-files

mypy:
$(CMD) mypy $(PYMODULE) $(UNIT_TESTS)
ty:
$(CMD) ty check $(PYMODULE) $(UNIT_TESTS)

docs-build:
uv run jb build -W -v ./doc
Expand Down
2 changes: 1 addition & 1 deletion doc/contributing/1a_install_uv.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ uv run ruff check --fix .
### Running Type Checker

```bash
uv run mypy pyrit/
uv run ty check pyrit/
```

### Pre-commit Hooks
Expand Down
17 changes: 9 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ dev = [
"jupyter>=1.1.1",
"jupyter-book==1.0.4",
"jupytext>=1.17.1",
"mypy>=1.16.0",
"ty>=0.0.12",
"mock-alchemy>=0.2.6",
"pre-commit>=4.2.0",
"pytest>=8.3.5",
Expand Down Expand Up @@ -165,13 +165,14 @@ pythonpath = ["."]
asyncio_default_fixture_loop_scope = "function"
asyncio_mode = "auto"

[tool.mypy]
plugins = []
ignore_missing_imports = true
strict = false
follow_imports = "silent"
strict_optional = false
disable_error_code = ["empty-body"]
[tool.ty]
[tool.ty.rules]
unresolved-import = "ignore"
possibly-missing-attribute = "ignore"
unused-ignore-comment = "ignore"
[tool.ty.analysis]
respect-type-ignore-comments = true
[tool.ty.src]
exclude = ["doc/code/"]

[build-system]
Expand Down
138 changes: 27 additions & 111 deletions uv.lock

Large diffs are not rendered by default.