-
Notifications
You must be signed in to change notification settings - Fork 6
/
pyproject.toml
323 lines (265 loc) · 10.9 KB
/
pyproject.toml
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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
# Project metadata, including build by setuptools
# See https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
# TOML syntax at https://toml.io/en/
[build-system]
# Minimum requirements for the build system to execute.
requires = ['setuptools'] # PEP 508 specifications.
# Setuptools specification
build-backend = "setuptools.build_meta"
[project]
# See https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
dynamic = ['version', 'dependencies']
name = 'webchanges'
description = """\
Check web (or command output) for changes since last run and notify. Anonymously alerts you of web changes, with
Gen AI summaries (BETA).\
"""
readme = { file = 'README.rst', content-type = 'text/x-rst' }
requires-python = '>=3.10'
license = {file = 'LICENSE'}
authors = [
{name = 'Mike Borsetti', email = 'mike+webchanges@borsetti.com'},
]
maintainers = [
{name = 'Mike Borsetti', email = 'mike+webchanges@borsetti.com'},
]
keywords = ['webmonitoring', 'monitoring']
classifiers = [
'Environment :: Console',
'Topic :: Internet',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Indexing/Search',
'Topic :: System :: Monitoring',
'Topic :: Utilities',
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: Implementation :: CPython',
'Operating System :: OS Independent',
'Environment :: Console',
'Intended Audience :: End Users/Desktop',
'Intended Audience :: System Administrators',
'Intended Audience :: Developers',
'Natural Language :: English',
'Typing :: Typed',
]
[project.urls]
Documentation = 'https://webchanges.readthedocs.io/'
Repository = 'https://github.com/mborsetti/webchanges/'
Changelog = 'https://webchanges.readthedocs.io/en/stable/changelog.html'
Issues = 'https://github.com/mborsetti/webchanges/issues'
CI = 'https://github.com/mborsetti/webchanges/actions'
[project.scripts]
# entry points https://setuptools.pypa.io/en/latest/userguide/entry_point.html
webchanges = 'webchanges.cli:main'
[project.optional-dependencies]
use_browser = ['playwright', 'psutil']
# filters
# lxml is now optional with beautifulsoup4
# note: also update the list of all possible dependencies in show_detailed_versions() in command.py!
beautify = ['beautifulsoup4', 'jsbeautifier', 'cssbeautifier']
bs4 = ['beautifulsoup4']
html5lib = ['html5lib']
ical2text = ['vobject']
jq = ['jq; os_name != "nt"']
ocr = ['pytesseract', 'Pillow']
pdf2text = ['pdftotext']
pypdf = ['pypdf']
pypdf_crypto = ['pypdf', 'cryptography']
# differs
deepdiff = ['deepdiff']
deepdiff_xml = ['deepdiff', 'xmltodict']
imagediff = ['Pillow']
# reporters
matrix = ['matrix_client']
pushbullet = ['pushbullet.py']
pushover = ['chump']
xmpp = ['aioxmpp']
# other
redis = ['redis']
requests = ['requests']
safe_password = ['keyring']
zstd = ['zstandard']
all = [
'webchanges[use_browser,beautify,bs4,html5lib,ical2text,jq,ocr,pdf2text,pypdf_crypto,deepdiff_xml,imagediff,matrix,pushbullet,pushover,xmpp,redis,requests,safe_password,zstd]'
]
# -------------------------- setuptools --------------------------
# Called by build
# See https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
[tool.setuptools]
# explicit package listing is required for building in tox -e new-install
# https://setuptools.pypa.io/en/latest/userguide/package_discovery.html
packages = ['webchanges', 'webchanges._vendored']
[tool.setuptools.dynamic]
version = {attr = 'webchanges.__version__'}
dependencies = {file = 'requirements.txt'}
[tool.setuptools.package-data]
'webchanges' = ['py.typed']
# -------------------------- isort --------------------------
# isort your imports, so you don't have to.
# Runs as part of pre-commit.
# Config file documentation https://pycqa.github.io/isort/docs/configuration/options.html
[tool.isort]
profile = 'black'
# multi_line_output = 3
# use_parentheses = True
# include_trailing_comma = True
# force_grid_wrap = 0
# ensure_newline_before_comments = True
line_length = 120
# Treat project as a git repository and ignore files listed in .gitignore.
skip_gitignore = true
# Force isort to recognize a module as being part of the current python project.
known_first_party = 'webchanges'
# Force isort to recognize a module as being a local folder.
# Generally, this is reserved for relative imports (from . import module).
known_local_folder = 'webchanges'
# Force all imports to be sorted alphabetically within a section.
force_alphabetical_sort_within_sections = true
# Automatically create section groups by the top-level package they come from.
group_by_package = true
# Remove redundant aliases from imports, such as import os as os.
remove_redundant_aliases = true
# Use color in terminal output.
color_output = true
# -------------------------- black --------------------------
# Uncompromising code formatting
# Runs as part of pre-commit
# Config file documentation
# https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-via-a-file
[tool.black]
# What's in here overrides the command-line options shown by running $ black --help.
line_length = 120
target_version = ['py310']
skip_string_normalization = true
extend_exclude = '/(\.idea|\.pytest_cache|\__pycache__|\venv.*|\webchanges.egg-info)/'
color = true
# -------------------------- mypy --------------------------
# Static Typing for Python
# Runs as part of pre-commit
# Config file documentation at https://mypy.readthedocs.io/en/stable/config_file.html
[tool.mypy]
# Disables import discovery of namespace packages (see PEP 420)
namespace_packages = false
# Specifies the Python version used to parse and check the target program.
# python_version = 3.12
# Shows error codes in error messages.
show_error_codes = true
# Suppresses error messages about imports that cannot be resolved.
ignore_missing_imports = true
# Disallows calling functions without type annotations from functions with type annotations.
disallow_untyped_calls = true
# Disallows defining functions without type annotations or with incomplete type annotations.
disallow_untyped_defs = true
# Reports an error whenever a function with type annotations is decorated with a decorator without annotations.
disallow_untyped_decorators = true
# Changes the treatment of arguments with a default value of None by not implicitly making their type Optional.
no_implicit_optional = true
# Warns about casting an expression to its inferred type.
warn_redundant_casts = true
# Warns about unneeded # type: ignore comments.
# Disabled because it behaves differently in GitHub Actions than it does on Windows.
# warn_unused_ignores = true
# Shows a warning when returning a value with type Any from a function declared with a non-Any return type.
# warn_return_any = true
# Shows a warning when encountering any code inferred to be unreachable or redundant after performing type analysis.
warn_unreachable = false
# Use visually nicer output in error messages: use soft word wrap, show source code snippets, and show error location
# markers.
pretty = true
# Use an SQLite database to store the cache.
sqlite_cache = true
# Warns about per-module sections in the config file that do not match any files processed when invoking mypy.
warn_unused_configs = true
# -------------------------- rstcheck --------------------------
# Checks syntax of reStructuredText and code blocks nested within it.
# Runs as part of pre-commit.
# Config file documentation at https://rstcheck.readthedocs.io/en/latest/usage/config/
[tool.rstcheck]
report_level = 'WARNING'
# The below is needed when comments in *.rst files turn it into invalid python code
# ignore_language = 'python'
# -------------------------- bandit --------------------------
[tool.bandit]
# Find common security issues in Python code.
# Runs as part of pre-commit.
# Config file documentation at https://bandit.readthedocs.io/en/latest/config.html
targets = ['webchanges', 'tests']
skips = [
'B101', # Use of assert detected.
'B404', # Consider possible security implications associated with subprocess module.
'B602', # subprocess call with shell=True identified, security issue.
'B603' # subprocess call - check for execution of untrusted input.
]
# -------------------------- coverage --------------------------
# Runs in Github Actions (see .github/workflows/ci-cd.yaml) and in tox (see tox.ini).
# Config file documentation at https://coverage.readthedocs.io/en/latest/config.html
[tool.coverage.run]
branch = true
concurrency = ['multiprocessing']
source = ['./']
omit = [
'.*/*',
'build/*',
'dist/*',
'docs/*',
'htmlcov/*',
'pip/*',
'tests/*',
'webchanges/_vendored/*',
'webchanges.egg-info/*',
]
relative_files = true
command_line = '-m pytest -vv'
plugins = ['coverage_conditional_plugin']
[tool.coverage.coverage_conditional_plugin.rules]
# Requires pip install coverage-conditional-plugin
# Here we specify our pragma rules:
has-b4 = "is_installed('bs4')"
has-jq = "is_installed('jq')"
has-pdftotext = "is_installed('pdftotext')"
has-pytesseract = "is_installed('pytesseract')"
[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_lines = [
# Don't complain about missing debug-only code:
'def __repr__',
'if self\.debug:',
# Have to re-enable the standard pragma
'pragma: no cover',
# Don't complain if tests don't hit defensive assertion code:
'raise AssertionError',
'raise NotImplementedError',
# Don't complain if non-runnable code isn't run:
'if 0:',
'if __name__ == .__main__.:',
# Don't complain if module is not importable (handled by code):
'except ImportError:',
# Don't cover IDE code:
'if TYPE_CHECKING:'
]
# ignore_errors = true
# -------------------------- pytest --------------------------
# Testing framework
# Config file documentation at https://docs.pytest.org/en/stable/reference/reference.html#ini-options-ref
[tool.pytest.ini_options]
log_auto_indent = true
# Enable log display during test run (aka "live logging" https://docs.pytest.org/en/stable/logging.html#live-logs)
log_cli = true
minversion = '8.3.3'
testpaths = ['tests']
# the below is for pytest-asyncio (required due to Playwright)
asyncio_mode = 'auto'
asyncio_default_fixture_loop_scope = 'function'
# Adds pytest-cov functionality (see https://pytest-cov.readthedocs.io/en/latest/config.html)
# Note: --cov moved to .github/workflows/ci-cd.yaml and tox.ini due to interference with PyCharm breakpoints (see
# https://github.com/pytest-dev/pytest-cov/issues/131) and to enable running tox --parallel
# Instead of below, now runs with $ coverage run --parallel-mode
# addopts = --cov=./ --cov-report=term --cov-report=html