Merge topic branch 'clean-up-and-update-tool-configuration' into master
Marco Ricci

Marco Ricci commited on 2024-09-01 11:17:19
Zeige 1 geänderte Dateien mit 65 Einfügungen und 19 Löschungen.


* t/clean-up-and-update-tool-configuration:
  Upgrade ruff to 0.6, and redo configuration and rule selection
  Undo single-child hatch environment inheritance
  Specify project dependencies more clearly and explicitly
  Sort sections in pyproject.toml
... ...
@@@ -30,39 -35,49 +35,57 @@@ dependencies = 
35 35
  version = "0.1.3"
36 36
  
37 37
  [project.optional-dependencies]
38
- dev = ["black", "coverage", "hatch>=1.10", "mkdocs", "mkdocs-material",
39
-        "mkdocstrings[python]", "pytest>=8.1", "towncrier>=23.11"]
38
+ dev = [
39
+   # Development uses the hatch build system, to isolate all tools in their
40
+   # own virtual environment.
41
+   "hatch ~= 1.10",
42
+ ]
40 43
 +export = [
41 44
 +  # The vault configuration exporter relies on cryptography.  Version 38 was
42 45
 +  # the first to include the `algorithms.AES256` interface, instead of only
43 46
 +  # the `algorithms.AES` interface.
44 47
 +  "cryptography >= 38.0.0",
45 48
 +]
46 49
  
50
+ [project.scripts]
51
+ derivepassphrase = "derivepassphrase.cli:derivepassphrase"
52
++derivepassphrase_export = "derivepassphrase.exporter:derivepassphrase_export"
53
+ 
47 54
  [project.urls]
48 55
  Documentation = "https://the13thletter.info/derivepassphrase/"
49 56
  Issues = "https://github.com/the-13th-letter/derivepassphrase/issues"
50 57
  Source = "https://github.com/the-13th-letter/derivepassphrase"
51 58
  
52
- [project.scripts]
53
- derivepassphrase = "derivepassphrase.cli:derivepassphrase"
54
- derivepassphrase_export = "derivepassphrase.exporter:derivepassphrase_export"
59
+ [tool.coverage.html]
60
+ directory = "html/coverage"
55 61
  
56
- [tool.mypy]
57
- files = ['src/**/*.py', 'tests/**/*.py']
58
- mypy_path = '$MYPY_CONFIG_FILE_DIR/src'
59
- explicit_package_bases = true
60
- implicit_reexport = false
61
- sqlite_cache = true
62
+ [tool.coverage.paths]
63
+ src = ["src"]
64
+ tests = ["tests"]
62 65
  
63
- [tool.pytest.ini_options]
64
- addopts = '--doctest-modules'
65
- pythonpath = ['src']
66
- testpaths = ['src', 'tests']
67
- xfail_strict = true
66
+ [tool.coverage.report]
67
+ skip_covered = false
68
+ skip_empty = true
69
+ precision = 3
70
+ partial_branches = [
71
+     'pragma: no branch',
72
+ ]
73
+ exclude_also = [
74
+   "if __name__ == .__main__.:",
75
+   'if (?:typing\.)?TYPE_CHECKING:',
76
+   "raise AssertionError",
77
+   "raise NotImplementedError",
78
+   'assert False',
79
++  '(?:typing\.)?assert_never\(',
80
+ ]
68 81
  
69
- [tool.hatch.version]
70
- path = "src/derivepassphrase/__init__.py"
82
+ [tool.coverage.run]
83
+ source_pkgs = ["derivepassphrase", "tests"]
84
+ branch = true
85
+ parallel = true
86
+ omit = [
87
+   "__main__.py",
88
+ ]
71 89
  
72 90
  [tool.hatch.build.targets.sdist]
73 91
  exclude = [
... ...
@@@ -111,14 -111,30 +119,42 @@@ extra-dependencies = 
111 119
  ]
112 120
  detached = false
113 121
  
122
+ [tool.hatch.envs.hatch-static-analysis]
123
+ config-path = "/dev/null"
124
+ dependencies = [
125
+   "ruff ~= 0.6.0",
126
+ ]
127
+ 
128
+ [tool.hatch.envs.hatch-test]
129
+ default-args = ['src', 'tests']
130
+ 
131
+ [[tool.hatch.envs.hatch-test.matrix]]
132
+ python = ["3.10", "3.11", "3.12", "pypy3.10"]
133
+ 
134
++[[tool.hatch.envs.hatch-test.matrix]]
135
++python = ["3.10", "3.11", "3.12", "pypy3.10"]
136
++feature = ["export"]
137
++
138
++[tool.hatch.envs.hatch-test.overrides]
139
++matrix.feature.features = [
140
++    { value = "export", if = ["export"] },
141
++]
142
++
143
+ [tool.hatch.envs.release]
144
+ extra-dependencies = [
145
+   "towncrier >= 23.11"
146
+ ]
147
+ 
148
+ [tool.hatch.envs.release.scripts]
149
+ 
114 150
  [tool.hatch.envs.types]
115 151
  extra-dependencies = [
116
-   "mypy>=1.0.0",
152
+   "mypy ~= 1.0",
117 153
    "pytest ~= 8.1",
118 154
  ]
119 155
 +features = [
120 156
 +    "export",
121 157
 +]
122 158
  
123 159
  [tool.hatch.envs.types.scripts]
124 160
  check = "mypy --install-types --non-interactive {args:src/derivepassphrase tests}"
125 161