-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
168 lines (152 loc) · 4.69 KB
/
pyproject.toml
File metadata and controls
168 lines (152 loc) · 4.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
[project]
name = "github-activity-db"
version = "0.1.0"
description = "Searchable data store for GitHub PR data with custom tagging"
readme = "README.md"
license = { file = "LICENSE" }
authors = [{ name = "agentmoose", email = "phoenixtechnerd@gmail.com" }]
requires-python = ">=3.12"
dependencies = [
"sqlalchemy>=2.0",
"aiosqlite>=0.20",
"pydantic>=2.0",
"pydantic-settings>=2.0",
"githubkit>=0.12",
"python-dotenv>=1.0",
"alembic>=1.14",
"loguru>=0.7",
"typer>=0.15",
"rich>=13.0",
"greenlet>=3.3.0",
]
[project.scripts]
ghactivity = "github_activity_db.cli.app:app"
[project.optional-dependencies]
dev = [
"pytest>=8.0",
"pytest-asyncio>=0.24",
"pytest-cov>=5.0",
"mypy>=1.13",
"ruff>=0.8",
"pre-commit>=4.0",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/github_activity_db"]
# ------------------------------------------------------------------------------
# Ruff - Linting & Formatting
# ------------------------------------------------------------------------------
[tool.ruff]
target-version = "py312"
line-length = 100
src = ["src", "tests"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"ASYNC", # flake8-async
"S", # flake8-bandit (security)
"PTH", # flake8-use-pathlib
"RUF", # ruff-specific rules
# Type checking best practices (non-strict mode)
"TC006", # Quote type annotations in cast() calls
"FA", # flake8-future-annotations
]
ignore = [
"S101", # allow assert in tests
"RUF022", # allow categorized __all__ (not alphabetically sorted)
"ASYNC109", # allow timeout parameter naming in async functions
"ASYNC110", # allow sleep in while loop for queue drain patterns
"FA100", # allow files without `from __future__ import annotations`
]
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["S101", "S105", "S106"] # allow assert and test tokens/passwords
[tool.ruff.lint.isort]
known-first-party = ["github_activity_db"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
# ------------------------------------------------------------------------------
# Mypy - Type Checking
# ------------------------------------------------------------------------------
[tool.mypy]
python_version = "3.12"
strict = true
warn_return_any = true
warn_unused_ignores = 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_configs = true
show_error_codes = true
# Require error codes on type: ignore comments for maintainability
enable_error_code = ["ignore-without-code"]
plugins = ["pydantic.mypy"]
exclude = ["alembic/", "build/", "dist/"]
[[tool.mypy.overrides]]
module = ["githubkit.*", "aiosqlite.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
# Relaxed strictness for tests - enables mypy checking while allowing
# flexibility for test-specific patterns (mocks, fixtures, etc.)
module = "tests.*"
disallow_untyped_defs = false
disallow_incomplete_defs = false
disallow_untyped_calls = false
# Relax generic type parameter requirements (allows `dict` without `dict[str, Any]`)
disallow_any_generics = false
# Keep important checks enabled
check_untyped_defs = true
warn_return_any = false # Tests often return mock values
warn_unused_ignores = true
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
# ------------------------------------------------------------------------------
# Pytest - Testing
# ------------------------------------------------------------------------------
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
addopts = [
"-ra",
"-q",
"--strict-markers",
"--strict-config",
]
filterwarnings = [
"error",
"ignore::DeprecationWarning",
]
# ------------------------------------------------------------------------------
# Coverage - Test Coverage
# ------------------------------------------------------------------------------
[tool.coverage.run]
source = ["src/github_activity_db"]
branch = true
parallel = true
omit = ["*/tests/*", "*/__pycache__/*"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
show_missing = true