-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
151 lines (136 loc) · 4.22 KB
/
pyproject.toml
File metadata and controls
151 lines (136 loc) · 4.22 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
[project]
name = "article-extractor"
version = "0.5.6"
description = "Pure-Python article extraction library and HTTP service - Drop-in replacement for readability-js-server"
readme = "README.md"
license = { text = "MIT" }
requires-python = ">=3.12"
authors = [{ name = "Pankaj Kumar Singh", email = "pankaj28843@gmail.com" }]
keywords = ["html", "article", "extraction", "readability", "markdown"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Text Processing :: Markup :: HTML",
]
dependencies = [
"justhtml>=0.40.0",
"pydantic>=2.12.5",
"pydantic-settings>=2.12.0",
"defusedxml>=0.7.1",
]
[project.optional-dependencies]
playwright = ["playwright>=1.57.0"]
httpx = ["httpx>=0.28.1"]
server = [
"fastapi>=0.128.0",
"uvicorn[standard]>=0.40.0",
"httpx>=0.28.1",
"fake-useragent>=2.2.0",
]
ua = ["fake-useragent>=2.2.0"]
docs = ["mkdocs>=1.6.1"]
all = [
"playwright>=1.57.0",
"httpx>=0.28.1",
"fastapi>=0.128.0",
"uvicorn[standard]>=0.40.0",
"fake-useragent>=2.2.0",
]
[dependency-groups]
dev = [
"pytest>=9.0.2",
"pytest-asyncio>=1.3.0",
"pytest-cov>=7.0",
"ruff>=0.14.13",
"mkdocs>=1.6.1",
"httpx>=0.28.1",
"fastapi>=0.128.0",
"uvicorn[standard]>=0.40.0",
"fake-useragent>=2.2.0",
"playwright>=1.57.0",
]
[tool.uv]
default-groups = ["dev"]
[project.urls]
Homepage = "https://github.com/pankaj28843/article-extractor"
Repository = "https://github.com/pankaj28843/article-extractor"
[project.scripts]
article-extractor = "article_extractor.cli:main"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/article_extractor"]
[tool.ruff]
line-length = 88
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
"ARG", # flake8-unused-arguments
"SIM", # flake8-simplify
"PTH", # flake8-use-pathlib
"ASYNC", # flake8-async
# Security rules
"S", # flake8-bandit (security)
"T20", # flake8-print (no print statements in production)
"PL", # pylint
"RUF", # Ruff-specific rules
]
ignore = [
"E501", # line length (handled by formatter)
"S101", # allow assert in tests (handled via per-file-ignores)
"PLR0913", # too many arguments (common in config classes)
"PLR2004", # magic value comparison (common in scoring)
"PLC0415", # allow lazy imports (used for optional dependencies)
"PLW0603", # allow global statement (used for optional dependency caching)
"RUF012", # mutable class attributes (intentional for defaults)
"RUF022", # __all__ sorting (intentional grouping by category)
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"S101", # Allow assert in tests
"S105", # Allow hardcoded passwords in tests
"S106", # Allow hardcoded password argument in tests
"ARG001", # Allow unused arguments
"ARG002", # Allow unused arguments
"T20", # Allow print statements in tests
"PLR2004", # Allow magic values in tests
"SIM117", # Nested with statements are clear in test mocking
]
"src/article_extractor/cli.py" = [
"T20", # Allow print statements in CLI
"S104", # Allow binding to all interfaces (CLI arg default)
"SIM117", # Nested with statements are clear in test mocking
]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
addopts = ["--import-mode=importlib", "--strict-markers", "--strict-config"]
markers = [
"unit: Unit tests (fast, no I/O)",
"integration: Integration tests (may use network)",
]
[tool.coverage.run]
source = ["src/article_extractor"]
branch = true
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"raise NotImplementedError",
]