annotate pyproject.toml @ 8478:ed4ef394d5d6

doc: initial attempt to document setup of pgp support for email. Used an AI assistant to help write this. Basic gpg commands seem to work, but I have not tested this totally. Docs basically follow the setup used for pgp testing in the test suite. It looks like roundup accepts signed emails as well as encrypted and signed emails. But it does not generate signed emails. Also it looks like there is no PGP support for alternate email addresses. Only primary addresses can do PGP emails.
author John Rouillard <rouilj@ieee.org>
date Sat, 15 Nov 2025 16:59:24 -0500
parents 8a875e0bf749
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7822
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
1 [tool.pytest.ini_options]
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
2 # Note this only works under python3. Pytest 6.0+ supports
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
3 # pyproject.toml and is not available for python 2. These settings can
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
4 # be adapted for pytest.ini if you are running under python2.
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
5
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
6 # For use with packages:
8252
8a875e0bf749 test: added pytest-testmon
John Rouillard <rouilj@ieee.org>
parents: 8235
diff changeset
7 # python -m pip install pytest-cov pytest-env pytest-randomly pytest-testmon
7822
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
8
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
9 minversion = "6.0"
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
10
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
11 # Disable randomly by default. There are still a few tests that are
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
12 # order dependent. Enable on cli for python3 only using:
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
13 # "-p randomly"
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
14 addopts = "-p no:randomly --durations=10 --strict-markers -r a -v"
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
15
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
16 # Set the redis password to nothing. Can be overridden on cli using:
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
17 # "-e pytest_redis_pw=mySecretPassword"
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
18 env = [
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
19 "D:pytest_redis_pw="
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
20 ]
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
21
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
22 # Don't search random directories to find tests.
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
23 testpaths = [
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
24 "test",
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
25 ]
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
26
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
27 [tool.ruff]
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
28 line-length = 128
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
29 output-format = "full"
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
30
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
31 exclude = [
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
32 # ignore code imported/sourced from other places
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
33 "roundup/cgi/PageTemplates/*.py",
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
34 "roundup/cgi/TAL/*.py",
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
35 "roundup/cgi/ZTUtils/*.py",
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
36 "roundup/anypy/vendored/*.py",
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
37 "dicttoxml.py"
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
38 ]
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
39
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
40 [tool.ruff.lint]
7831
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
41 preview = true
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
42 explicit-preview-rules = true
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
43
7822
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
44 select = [
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
45 "A", # flake-8-builtins shadowing a builtin
7831
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
46 "ARG", # flake8-unused-arguments
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
47 "B", # flake8-bugbear
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
48 "C4", # flake8-comprehensions
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
49 "C901", # McCabe complexity
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
50 "COM", # flake8-commas
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
51 "E", # errors
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
52 # enable preview rules:
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
53 # Error rules indentation
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
54 "E111", "E112", "E113",
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
55 # Error whitespace in brackets/around punctuation
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
56 # around params, tabs/space around operators
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
57 "E201", "E202", "E203", "E211", "E222", "E223", "E224",
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
58 "E225", "E226", "E227", "E228", "E231", "E241", "E242",
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
59 "E251", "E252", "E271", "E272", "E275",
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
60 # Error blank lines between methods, classes etc.
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
61 "E301", "E302", "E303", "E304", "E305", "E306",
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
62
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
63 "F", # pyflakes
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
64 "G", # logging format _(.... % ...) bad use _(...) % ...
7822
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
65 "I", # imports
7831
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
66 "INT", # check gettext
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
67 "Q", # quoting consistancy
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
68 "PERF", # performance lint
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
69 "PIE794", # duplicate class field definition
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
70 "PL", # pylint
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
71 "PLW", # warnings
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
72 "RET", # check for inconistent returns
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
73 "RUF", # ruff
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
74 "S", # bandit - security
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
75 "SIM", # simplify code
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
76 "T10", # flake8-debugger
9c58f5940c20 chore(lint)
John Rouillard <rouilj@ieee.org>
parents: 7822
diff changeset
77 "W", # pycode whitespace warnings
7822
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
78 ]
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
79
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
80 ignore = [
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
81 # raise from except hander with none or chaining; only python3
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
82 "B904",
8235
c41e669a655c chore(ruff): update scanning rules.
John Rouillard <rouilj@ieee.org>
parents: 8176
diff changeset
83 # trailing commas are getting a bit excessive
c41e669a655c chore(ruff): update scanning rules.
John Rouillard <rouilj@ieee.org>
parents: 8176
diff changeset
84 "COM812",
7822
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
85 # ### before comments is fine
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
86 "E266",
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
87 # ignore double vs. single quotes
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
88 "Q000", "Q001", "Q002",
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
89 # do not replace x in (a,b) with x in {a,b} (set). python 3.2
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
90 # got a speedup in this; only python 3
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
91 "PLR6201",
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
92 # 505: allow use of else/elif even if it could be removed.
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
93 # if X: return; elif Z: return; else v ->
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
94 # if X: return; if Z: return; v
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
95 # 506: same but with a raise rather than return
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
96 #"RET505",
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
97 #"RET506",
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
98 # use *list to expand; only python 3
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
99 "RUF005",
8235
c41e669a655c chore(ruff): update scanning rules.
John Rouillard <rouilj@ieee.org>
parents: 8176
diff changeset
100 # not using typing, so not marking mutable class values
c41e669a655c chore(ruff): update scanning rules.
John Rouillard <rouilj@ieee.org>
parents: 8176
diff changeset
101 "RUF012",
7822
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
102 # do not use contextlib.suppress rather than except: pass to suppress
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
103 # exception. contextlib doesn't work in python2 and is slower
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
104 "SIM105",
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
105 ]
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
106
8176
736f769b48c8 A few cleanups to toml format. alphabetize, whitespace...
John Rouillard <rouilj@ieee.org>
parents: 7831
diff changeset
107 [tool.ruff.lint.mccabe]
736f769b48c8 A few cleanups to toml format. alphabetize, whitespace...
John Rouillard <rouilj@ieee.org>
parents: 7831
diff changeset
108 max-complexity = 50
7822
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
109
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
110 [tool.ruff.lint.per-file-ignores]
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
111 "roundup/anypy/*.py" = ["RET505", "RET506"]
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
112 "roundup/dehtml.py" = ["E501"]
8235
c41e669a655c chore(ruff): update scanning rules.
John Rouillard <rouilj@ieee.org>
parents: 8176
diff changeset
113 # ruff is reporting unused parameters. Standard calling sequence
c41e669a655c chore(ruff): update scanning rules.
John Rouillard <rouilj@ieee.org>
parents: 8176
diff changeset
114 # for all methods means some won't be used. Suppress alert ARG002.
c41e669a655c chore(ruff): update scanning rules.
John Rouillard <rouilj@ieee.org>
parents: 8176
diff changeset
115 "roundup/rest.py" = ["ARG002", "E501"]
7822
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
116 "roundup/support.py" = ["E401"]
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
117 "roundup/security.py" = ["E701"]
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
118 "roundup/date.py" = ["E231", "E701"]
8176
736f769b48c8 A few cleanups to toml format. alphabetize, whitespace...
John Rouillard <rouilj@ieee.org>
parents: 7831
diff changeset
119 "roundup/backends/back_sqlite.py" = ["E203"]
7822
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
120
8176
736f769b48c8 A few cleanups to toml format. alphabetize, whitespace...
John Rouillard <rouilj@ieee.org>
parents: 7831
diff changeset
121 [tool.ruff.lint.pylint]
7822
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
122 max-args = 6
8176
736f769b48c8 A few cleanups to toml format. alphabetize, whitespace...
John Rouillard <rouilj@ieee.org>
parents: 7831
diff changeset
123 max-branches = 20
7822
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
124 max-statements = 100
1b7162938988 test: add pyproject.toml: set pytest and ruff project defaults
John Rouillard <rouilj@ieee.org>
parents:
diff changeset
125

Roundup Issue Tracker: http://roundup-tracker.org/