Debian Codegraph @

pyproject.toml

raw
1 [project]
2 name = "commitizen"
3 version = "4.18.1"
4 description = "Python commitizen client tool"
5 authors = [{ name = "Santiago Fraire", email = "[email protected]" }]
6 maintainers = [
7 { name = "Wei Lee", email = "[email protected]" },
8 { name = "Axel H.", email = "[email protected]" },
9 { name = "Tim Hsiung", email = "[email protected]" },
10 ]
11 license = "MIT"
12 license-files = ["LICENSE"]
13 readme = "docs/README.md"
14 requires-python = ">=3.10,<4.0"
15 dependencies = [
16 "questionary (>=2.0,<3.0)",
17 # Exclude transitive dependency due to known issue in questionary: https://github.com/tmbo/questionary/issues/454
18 "prompt_toolkit!=3.0.52",
19 "decli (>=0.6.0,<1.0)",
20 "colorama (>=0.4.1,<1.0)",
21 "termcolor (>=1.1.0,<4.0.0)",
22 "packaging>=26",
23 "tomlkit (>=0.8.0,<1.0.0)",
24 "jinja2>=2.10.3",
25 "pyyaml>=3.08",
26 "argcomplete >=1.12.1,<3.8",
27 "typing-extensions (>=4.0.1,<5.0.0) ; python_version < '3.11'",
28 "charset-normalizer (>=2.1.0,<4)",
29 "deprecated (>=1.2.13, <2)",
30 # Use the Python 3.11 and 3.12 compatible API: https://github.com/python/importlib_metadata#compatibility
31 "importlib-metadata >=8.0.0,<8.7.0 ; python_version < '3.10'",
32 ]
33 keywords = ["commitizen", "conventional", "commits", "git"]
34 # See also: https://pypi.org/classifiers/
35 classifiers = [
36 "Development Status :: 5 - Production/Stable",
37 "Environment :: Console",
38 "Intended Audience :: Developers",
39 "Natural Language :: English",
40 "Operating System :: OS Independent",
41 "Programming Language :: Python",
42 "Programming Language :: Python :: 3",
43 "Programming Language :: Python :: 3.10",
44 "Programming Language :: Python :: 3.11",
45 "Programming Language :: Python :: 3.12",
46 "Programming Language :: Python :: 3.13",
47 "Programming Language :: Python :: 3.14",
48 "Programming Language :: Python :: Implementation :: CPython",
49 ]
50
51 [project.urls]
52 Homepage = "https://github.com/commitizen-tools/commitizen"
53 Documentation = "https://commitizen-tools.github.io/commitizen/"
54 Repository = "https://github.com/commitizen-tools/commitizen"
55 Issues = "https://github.com/commitizen-tools/commitizen/issues"
56 Changelog = "https://github.com/commitizen-tools/commitizen/blob/master/CHANGELOG.md"
57
58 [project.scripts]
59 cz = "commitizen.cli:main"
60 git-cz = "commitizen.cli:main"
61
62 [project.entry-points."commitizen.plugin"]
63 cz_conventional_commits = "commitizen.cz.conventional_commits:ConventionalCommitsCz"
64 cz_jira = "commitizen.cz.jira:JiraSmartCz"
65 cz_customize = "commitizen.cz.customize:CustomizeCommitsCz"
66
67 [project.entry-points."commitizen.changelog_format"]
68 markdown = "commitizen.changelog_formats.markdown:Markdown"
69 asciidoc = "commitizen.changelog_formats.asciidoc:AsciiDoc"
70 textile = "commitizen.changelog_formats.textile:Textile"
71 restructuredtext = "commitizen.changelog_formats.restructuredtext:RestructuredText"
72
73 [project.entry-points."commitizen.provider"]
74 cargo = "commitizen.providers:CargoProvider"
75 commitizen = "commitizen.providers:CommitizenProvider"
76 composer = "commitizen.providers:ComposerProvider"
77 npm = "commitizen.providers:NpmProvider"
78 pep621 = "commitizen.providers:Pep621Provider"
79 poetry = "commitizen.providers:PoetryProvider"
80 scm = "commitizen.providers:ScmProvider"
81 uv = "commitizen.providers:UvProvider"
82
83 [project.entry-points."commitizen.scheme"]
84 pep440 = "commitizen.version_schemes:Pep440"
85 semver = "commitizen.version_schemes:SemVer"
86 semver2 = "commitizen.version_schemes:SemVer2"
87
88 [dependency-groups]
89 dev = [
90 { include-group = "base" },
91 { include-group = "test" },
92 { include-group = "linters" },
93 { include-group = "documentation" },
94 { include-group = "script" },
95 "ipython>=8.0",
96 "tox>4",
97 "tox-uv",
98 ]
99
100 base = ["mkdocs-llmstxt>=0.5.0", "poethepoet>=0.34.0"]
101
102 test = [
103 "pytest>=9",
104 "pytest-cov>=4",
105 "pytest-mock>=3.10",
106 "pytest-regressions>=2.4.0",
107 "pytest-freezer>=0.4.6",
108 "pytest-xdist>=3.1.0",
109 "pytest-gitconfig>=0.9.0",
110 "pre-commit>=4.5.1",
111 ]
112
113 linters = [
114 "ruff>=0.11.5",
115 "mypy>=1.16.0",
116 "types-deprecated>=1.2.9.2",
117 "types-python-dateutil>=2.8.19.13",
118 "types-PyYAML>=5.4.3",
119 "types-termcolor>=0.1.1",
120 "types-colorama>=0.4.15.20240311",
121 "prek>=0.2.28",
122 ]
123
124 documentation = [
125 "mkdocs>=1.4.2,<2",
126 "mkdocs-git-revision-date-localized-plugin>=1.5.0",
127 "mkdocs-material>=9.1.6",
128 ]
129
130 script = [
131 # for scripts/gen_cli_help_screenshots.py
132 "rich>=13.7.1",
133 ]
134
135 [build-system]
136 requires = ["uv_build >= 0.9.17, < 0.13"]
137 build-backend = "uv_build"
138
139
140 [tool.commitizen]
141 tag_format = "v$version"
142 version_files = [
143 "commitizen/__version__.py",
144 ".pre-commit-config.yaml:rev:.+Commitizen",
145 ]
146 version_provider = "uv"
147 version_scheme = "pep440"
148 annotated_tag = true
149 update_changelog_on_bump = true
150 changelog_incremental = true
151
152 [tool.uv.build-backend]
153 module-name = "commitizen"
154 module-root = ""
155 include = ["commitizen/py.typed"]
156
157 [tool.coverage]
158 [tool.coverage.report]
159 show_missing = true
160 exclude_lines = [
161 # Have to re-enable the standard pragma
162 'pragma: no cover',
163
164 # Don't complain about missing debug-only code:
165 'def __repr__',
166 'if self\.debug',
167
168 # Don't complain if tests don't hit defensive assertion code:
169 'raise AssertionError',
170 'raise NotImplementedError',
171
172 # Don't complain if non-runnable code isn't run:
173 'if 0:',
174 'if __name__ == .__main__.:',
175 'if TYPE_CHECKING:',
176 ]
177 omit = [
178 'env/*',
179 'venv/*',
180 '.venv/*',
181 '*/virtualenv/*',
182 '*/virtualenvs/*',
183 '*/tests/*',
184 ]
185
186
187 [tool.pytest]
188 addopts = ["--strict-markers"]
189 testpaths = ["tests/"]
190 filterwarnings = [
191 # get_smart_tag_range is deprecated and will be removed in v5
192 "ignore:Call to deprecated function \\(or staticmethod\\) get_smart_tag_range:DeprecationWarning",
193 ]
194
195 [tool.tox]
196 requires = ["tox>=4.22"]
197 env_list = ["3.10", "3.11", "3.12", "3.13", "3.14"]
198
199 [tool.tox.env_run_base]
200 description = "Run tests suite against Python {base_python}"
201 dependency_groups = ["test"]
202 commands = [["pytest", { replace = "posargs", extend = true }]]
203
204 [tool.ruff]
205 required-version = ">=0.11.5"
206 line-length = 88
207
208 [tool.ruff.lint]
209 select = [
210 # flake8-annotations
211 "ANN001",
212 "ANN2",
213 # pycodestyle
214 "E",
215 # Pyflakes
216 "F",
217 # pyupgrade
218 "UP",
219 # isort
220 "I",
221 # pygrep-hooks
222 "PGH003",
223 "PGH004",
224 # unsorted-dunder-all
225 "RUF022",
226 # unused-noqa
227 "RUF100",
228 # flake8-pytest-style
229 "PT",
230 # Checks for uses of the assert keyword.
231 "S101",
232 # flake8-type-checking (TC)
233 "TC001",
234 "TC002",
235 "TC003",
236 "TC004",
237 "TC005",
238 "TC006",
239 ]
240 ignore = ["E501", "D1", "D415"]
241 extend-safe-fixes = [
242 "TC", # Move imports inside/outside TYPE_CHECKING blocks
243 "UP", # Update syntaxes for current Python version recommendations
244 "PT006", # Use tuple in pytest.mark.parametrize
245 ]
246
247 [tool.ruff.lint.per-file-ignores]
248 "tests/*" = ["ANN", "S101"]
249
250 [tool.ruff.lint.isort]
251 known-first-party = ["commitizen", "tests"]
252
253 [tool.ruff.lint.pydocstyle]
254 convention = "google"
255
256 [tool.mypy]
257 files = ["commitizen", "tests", "scripts"]
258 disallow_untyped_decorators = true
259 disallow_subclassing_any = true
260 warn_return_any = true
261 warn_redundant_casts = true
262 warn_unused_ignores = true
263 warn_unused_configs = true
264
265 [[tool.mypy.overrides]]
266 module = "py.*" # Legacy pytest dependencies
267 ignore_missing_imports = true
268
269 [tool.codespell]
270 # Ref: https://github.com/codespell-project/codespell#using-a-config-file
271 skip = '.git*,*.svg,*.lock'
272 check-hidden = true
273 ignore-words-list = 'asend'
274
275 [tool.poe]
276 executor.type = "uv"
277
278 [tool.poe.tasks]
279 format.help = "Format the code"
280 format.sequence = [{ cmd = "ruff check --fix" }, { cmd = "ruff format" }]
281
282 lint.help = "Lint the code"
283 lint.sequence = [{ cmd = "ruff check" }, { cmd = "mypy" }]
284
285 check-commit.help = "Check the commit messages"
286 check-commit.cmd = "cz --no-raise 3 check --rev-range origin/master.."
287
288 test.help = "Run the test suite"
289 test.cmd = "pytest -n auto --dist=loadfile"
290
291 "test:all".help = "Run the test suite on all supported Python versions"
292 "test:all".cmd = "tox --parallel"
293
294 "test:regen".help = "Regenerate the test fixtures"
295 "test:regen".parallel = [
296 { ref = "test -k 'not py_' --regen-all" },
297 { ref = "test:all -- -k py_ --regen-all" },
298 ]
299
300 cover.help = "Run the test suite with coverage"
301 cover.ref = "test --cov-report term-missing --cov-report=xml:coverage.xml --cov=commitizen --junitxml=junit.xml -o junit_family=legacy"
302
303 all.help = "Run all tasks"
304 all.sequence = ["format", "lint", "check-commit", "cover"]
305
306 "doc:screenshots".help = "Render documentation screenshots"
307 "doc:screenshots".parallel = [
308 { script = "scripts.gen_cli_help_screenshots:gen_cli_help_screenshots" },
309 { script = "scripts.gen_cli_interactive_gifs:gen_cli_interactive_gifs" },
310 ]
311
312 "doc:build".help = "Build the documentation"
313 "doc:build".cmd = "mkdocs build"
314
315 doc.help = "Live documentation server"
316 doc.cmd = "mkdocs serve --livereload" # mkdocs hot reload failure workaround. Ref: https://github.com/mkdocs/mkdocs/issues/4032#issuecomment-3591002290
317
318 ci.help = "Run all tasks in CI"
319 ci.sequence = ["check-commit", { cmd = "prek run --all-files" }, "cover"]
320 ci.env = { SKIP = "no-commit-to-branch" }
321
322 setup-pre-commit.help = "Install pre-commit hooks"
323 setup-pre-commit.cmd = "prek install"