Skip to content
Merged
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: 2 additions & 0 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ jobs:
with:
cache: true
- run: pdm install
- run: pdm run typecheck:all
- run: pdm run format --check
- run: pdm run test:unit
288 changes: 272 additions & 16 deletions pdm.lock

Large diffs are not rendered by default.

138 changes: 131 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,146 @@ test = "pytest -n auto"
"test:e2e" = "pytest -n auto tests/e2e"
"test:integration" = "pytest -n auto tests/integration"
"test:unit" = "pytest -n auto tests/unit"
sort = "isort ."
format = "black ."
lint = "ruff check ."
checks = {composite = ["sort . -c", "format . --check"]}
fix = {composite = ["sort", "format", "lint"]}
"test:cov:view" = "python -m http.server --directory htmlcov"
format = "ruff format src tests"
lint = "ruff check src tests"
"lint:fix" = "ruff check --fix src tests"
typecheck = "mypy"
"typecheck:all" = "mypy src tests"
chat = "streamlit run src/askui/chat/__main__.py"

[dependency-groups]
test = [
"pytest>=8.3.4",
"isort>=6.0.0",
"black>=25.1.0",
"ruff>=0.9.5",
"pytest-mock>=3.14.0",
"pytest-xdist>=3.6.1",
"pytest-cov>=4.1.0",
"mypy>=1.9.0",
"types-requests>=2.31.0.20240311",
"types-python-dateutil>=2.8.19.20240106",
"types-Pillow>=10.2.0.20240311",
"types-protobuf>=4.24.0.20240311",
"grpc-stubs>=1.53.0.3",
"types-pyperclip>=1.8.2.20240311",
]
chat = [
"streamlit>=1.42.0",
]

[tool.pytest.ini_options]
addopts = "--cov=src/askui --cov-report=html"
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]

[tool.mypy]
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_optional = true
plugins = ["pydantic.mypy"]
exclude = [
"src/askui/chat/.*",
"src/askui/models/ui_tars_ep/ui_tars_api.py",
"src/askui/tools/anthropic/computer.py",
"src/askui/tools/askui/askui_ui_controller_grpc/.*",
"src/askui/tools/askui/askui_workspaces/.*",
]
mypy_path = "src"
explicit_package_bases = true
namespace_packages = true

[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
]

# Same as Black.
line-length = 88

# Assume Python 3.10
target-version = "py310"

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"

[tool.ruff.lint]
# Enable all rules
select = ["ALL"]
ignore = [
"ANN", # Type annotations - handled by mypy
"COM812", # Unused import
"D", # Documentation - we'll handle this separately
"ERA", # Commented out code
"FBT", # Boolean trap
"ICN", # Import conventions
"ISC", # Implicit string concatenation
"N", # Naming
"PGH", # PyGithub
"PL", # Pylint
"PT", # Pytest
"Q", # Quotes
"RUF", # Ruff-specific rules
"S", # Bandit
"SIM", # Simplify
"T", # Pycodestyle
"TID", # isort
"UP", # Pyupgrade
"W", # Pycodestyle
"YTT", # flake8-2020
]

# Allow autofix for all enabled rules
fixable = ["ALL"]
unfixable = []

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S101", "PLR2004"]
"src/askui/chat/*" = ["F401", "F403"]

[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
inline-quotes = "double"
multiline-quotes = "double"

[tool.ruff.lint.isort]
known-first-party = ["askui"]
known-third-party = ["pytest", "mypy"]
Loading