-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
174 lines (158 loc) · 4.69 KB
/
pyproject.toml
File metadata and controls
174 lines (158 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
169
170
171
172
173
174
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "til"
version = "0.1.0"
description = "Today I Learned - A static site generator for TIL entries"
readme = "README.md"
license = {file = "LICENSE"}
requires-python = ">=3.9"
homepage = "https://til.taylorhodge.com"
repository = "https://github.com/jthodge/til"
keywords = ["til", "today-i-learned", "datasette", "static-site-generator"]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Documentation",
]
dependencies = [
"click>=8.0",
"GitPython",
"sqlite-utils>=3.2",
"beautifulsoup4",
"datasette>=0.59",
"datasette-atom>=0.7",
"datasette-template-sql>=1.0.2",
"datasette-graphql",
"datasette-block-robots",
"datasette-sitemap>=1.0",
"datasette-publish-fly",
"httpx",
]
[project.optional-dependencies]
dev = [
"pytest",
"pytest-cov",
"ruff", # Replaces black, isort, and flake8
"mypy",
"types-requests",
"pyyaml",
"types-PyYAML",
"tomli;python_version<'3.11'",
]
[project.scripts]
til = "til.cli:cli"
[tool.hatch.build.targets.wheel]
packages = ["src/til"]
[tool.hatch.build]
sources = ["src"]
[tool.black]
line-length = 88
target-version = ['py39']
[tool.isort]
profile = "black"
line_length = 88
[tool.mypy]
python_version = "3.9"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = false
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = false
warn_no_return = true
follow_imports = "normal"
ignore_missing_imports = true
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = [
"--cov=til",
"--cov-report=html",
"--cov-report=term-missing"
]
pythonpath = ["src"]
[tool.coverage.run]
source = ["src/til"]
omit = ["tests/*", "*/conftest.py"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
]
[tool.ruff]
# Use same configuration as black, isort, and flake8
line-length = 88
target-version = "py39"
# Enable all the rules that were previously handled by separate tools
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"D", # pydocstyle
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"S", # flake8-bandit
"T20", # flake8-print
"RET", # flake8-return
"SIM", # flake8-simplify
"ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
"ERA", # eradicate
"PGH", # pygrep-hooks
"PL", # pylint
"TRY", # tryceratops
"RUF", # ruff-specific rules
]
ignore = [
"D100", # Missing docstring in public module
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D401", # First line should be in imperative mood (too strict)
"S101", # Use of assert detected
"T201", # Print found
"TRY003", # Avoid specifying long messages outside the exception class
"TRY400", # Prefer logging.exception() over logging.error()
"B904", # Use `raise ... from err` within except
"PLR0912", # Too many branches
"PLR0915", # Too many statements
"PTH123", # Use Path.open instead of open
"PLR2004", # Magic value used in comparison
"RUF012", # Mutable class attributes should be ClassVar
"E501", # Line too long (let black handle this)
"TRY300", # Consider moving this statement to an `else` block
"TRY301", # Abstract `raise` to an inner function
"S110", # try-except-pass - we're using it appropriately for optional logging
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S101", "S105", "S106", "S108", "S603", "D", "ARG", "F401", "F841", "SIM117", "PTH109", "B007"] # Allow assert and missing docstrings in tests
[tool.ruff.lint.isort]
# Match existing isort configuration by emulating black profile
combine-as-imports = true
force-single-line = false
order-by-type = false
lines-after-imports = 2
[tool.ruff.format]
# Match existing black configuration
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"