Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
233 lines (211 loc) · 5.9 KB
/
Copy pathpyproject.toml
File metadata and controls
233 lines (211 loc) · 5.9 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["digest_generator"]
# Ship the starter feeds config inside the package so `digest-generator init`
# can read it from an installed wheel (the source lives at the repo root).
[tool.hatch.build.targets.wheel.force-include]
"feeds.example.yaml" = "digest_generator/feeds.example.yaml"
[project]
name = "digest-generator"
version = "0.3.0"
description = "Generates weekly digests from RSS feeds using local LLMs and topic classification."
readme = "README.md"
requires-python = ">=3.13"
license = "Apache-2.0"
license-files = ["LICENSE.md", "NOTICE.md"]
authors = [{ name = "Francisco Laplace" }]
keywords = [
"rss",
"digest",
"newsletter",
"summarization",
"llm",
"ollama",
"nlp",
"transformers",
]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.13",
"Topic :: Internet",
"Topic :: Text Processing :: Markup :: Markdown",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Typing :: Typed",
]
dependencies = [
"beautifulsoup4>=4.14.3",
"cloudscraper>=1.2.71",
"feedparser>=6.0.12",
"loguru>=0.7.3",
"markdown-it-py>=4.0.0",
"ollama>=0.6.1",
"pydantic-settings>=2.14.2",
"python-dotenv>=1.2.2",
"pyyaml>=6.0.0",
"torch>=2.10.0",
"transformers>=5.1.0",
"typer>=0.15.0",
]
[project.urls]
Homepage = "https://github.com/laplacef/digest-generator"
Repository = "https://github.com/laplacef/digest-generator"
Issues = "https://github.com/laplacef/digest-generator/issues"
Changelog = "https://github.com/laplacef/digest-generator/blob/main/CHANGELOG.md"
Author = "https://laplacef.me"
[project.scripts]
digest-generator = "digest_generator.cli:app"
[project.optional-dependencies]
dev = [
"pre-commit>=4.0.1",
"ruff>=0.8.6",
"mypy>=1.14.1",
"bandit[toml]>=1.8.0",
"pytest>=9.0.3",
"pytest-asyncio>=0.24.0",
"pytest-cov>=6.0.0",
]
# ============================================================================
# Tool Configurations
# ============================================================================
# PyTorch - CUDA 13.0 Support
[[tool.uv.index]]
name = "pytorch-cu130"
url = "https://download.pytorch.org/whl/cu130"
explicit = true
[tool.uv.sources]
torch = [
{ index = "pytorch-cu130", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
]
# Ruff - Linting and Formatting
[tool.ruff]
target-version = "py313"
line-length = 100
# Enable recommended rules
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"T10", # flake8-debugger
"EM", # flake8-errmsg
"ICN", # flake8-import-conventions
"PIE", # flake8-pie
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"SIM", # flake8-simplify
"ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
"PL", # pylint
"RUF", # Ruff-specific rules
]
# Ignore specific rules
ignore = [
"E501", # Line too long (handled by formatter)
"PLR0913", # Too many arguments
"PLR0917", # Too many positional arguments (Typer commands and stacked @patch tests)
"PLR2004", # Magic value comparison
]
# Allow fix for all enabled rules
fixable = ["ALL"]
unfixable = []
# Exclude common directories
exclude = [
".git",
".venv",
"venv",
"__pycache__",
"build",
"dist",
".eggs",
]
# Ruff - Per-file ignores
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # Unused imports in __init__.py
"digest_generator/api.py" = ["PLC0415"] # Lazy imports to avoid loading torch/transformers at import time
"digest_generator/cli.py" = ["PLC0415"] # Lazy imports for fast --help
"digest_generator/core/digest/orchestrator.py" = ["PLC0415"] # Lazy imports to keep stage modules out of the API import chain
"tests/**/*.py" = ["ARG001", "ARG002"] # Unused mock/callback arguments (@patch decorators, side_effect stubs)
"tests/core/digest/test_normalize.py" = ["RUF001"] # test data contains the literal U+00D7 the normalizer rewrites
# Ruff - Formatting
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "auto"
# MyPy - Type Checking
[tool.mypy]
python_version = "3.13"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = false
disallow_incomplete_defs = false
check_untyped_defs = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
strict_optional = true
# Ignore missing imports for third-party libraries
[[tool.mypy.overrides]]
module = [
"feedparser.*",
"cloudscraper.*",
"transformers.*",
"torch.*",
"typer.*",
"yaml",
"yaml.*",
]
ignore_missing_imports = true
# Bandit - Security Scanning
[tool.bandit]
exclude_dirs = [
".venv",
"venv",
"tests",
".git",
]
skips = [
"B101", # assert_used - we use assertions in tests
]
# Pytest - Testing Configuration
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
asyncio_mode = "strict"
addopts = [
"--verbose",
"--cov=digest_generator",
"--cov-report=term-missing",
"--cov-report=html",
]
# Coverage - Code Coverage
[tool.coverage.run]
source = ["digest_generator"]
omit = [
"*/tests/*",
"*/__pycache__/*",
".venv/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]