Debian Codegraph @

pyproject.toml

raw
1 [project]
2 name = "commitizen"
3 version = "4.19.0"
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
151 [tool.uv.build-backend]
152 module-name = "commitizen"
153 module-root = ""
154 include = ["commitizen/py.typed"]
155
156 [tool.coverage]
157 [tool.coverage.report]
158 show_missing = true
159 exclude_lines = [
160 # Have to re-enable the standard pragma
161 'pragma: no cover',
162
163 # Don't complain about missing debug-only code:
164 'def __repr__',
165 'if self\.debug',
166
167 # Don't complain if tests don't hit defensive assertion code:
168 'raise AssertionError',
169 'raise NotImplementedError',
170
171 # Don't complain if non-runnable code isn't run:
172 'if 0:',
173 'if __name__ == .__main__.:',
174 'if TYPE_CHECKING:',
175 ]
176 omit = [
177 'env/*',
178 'venv/*',
179 '.venv/*',
180 '*/virtualenv/*',
181 '*/virtualenvs/*',
182 '*/tests/*',
183 ]
184
185
186 [tool.pytest]
187 addopts = ["--strict-markers"]
188 testpaths = ["tests/"]
189 filterwarnings = [
190 # get_smart_tag_range is deprecated and will be removed in v5
191 "ignore:Call to deprecated function \\(or staticmethod\\) get_smart_tag_range:DeprecationWarning",
192 ]
193
194 [tool.tox]
195 requires = ["tox>=4.22"]
196 env_list = ["3.10", "3.11", "3.12", "3.13", "3.14"]
197
198 [tool.tox.env_run_base]
199 description = "Run tests suite against Python {base_python}"
200 dependency_groups = ["test"]
201 commands = [["pytest", { replace = "posargs", extend = true }]]
202
203 [tool.ruff]
204 required-version = ">=0.11.5"
205 line-length = 88
206
207 [tool.ruff.lint]
208 select = [
209 # flake8-annotations
210 "ANN001",
211 "ANN2",
212 # pycodestyle
213 "E",
214 # Pyflakes
215 "F",
216 # pyupgrade
217 "UP",
218 # isort
219 "I",
220 # pygrep-hooks
221 "PGH003",
222 "PGH004",
223 # unsorted-dunder-all
224 "RUF022",
225 # unused-noqa
226 "RUF100",
227 # flake8-pytest-style
228 "PT",
229 # Checks for uses of the assert keyword.
230 "S101",
231 # flake8-type-checking (TC)
232 "TC001",
233 "TC002",
234 "TC003",
235 "TC004",
236 "TC005",
237 "TC006",
238 ]
239 ignore = ["E501", "D1", "D415"]
240 extend-safe-fixes = [
241 "TC", # Move imports inside/outside TYPE_CHECKING blocks
242 "UP", # Update syntaxes for current Python version recommendations
243 "PT006", # Use tuple in pytest.mark.parametrize
244 ]
245
246 [tool.ruff.lint.per-file-ignores]
247 "tests/*" = ["ANN", "S101"]
248
249 [tool.ruff.lint.isort]
250 known-first-party = ["commitizen", "tests"]
251
252 [tool.ruff.lint.pydocstyle]
253 convention = "google"
254
255 [tool.mypy]
256 files = ["commitizen", "tests", "scripts"]
257 disallow_untyped_decorators = true
258 disallow_subclassing_any = true
259 warn_return_any = true
260 warn_redundant_casts = true
261 warn_unused_ignores = true
262 warn_unused_configs = true
263
264 [[tool.mypy.overrides]]
265 module = "py.*" # Legacy pytest dependencies
266 ignore_missing_imports = true
267
268 [tool.codespell]
269 # Ref: https://github.com/codespell-project/codespell#using-a-config-file
270 skip = '.git*,*.svg,*.lock'
271 check-hidden = true
272 ignore-words-list = 'asend'
273
274 [tool.poe]
275 executor.type = "uv"
276
277 [tool.poe.tasks]
278 format.help = "Format the code"
279 format.sequence = [{ cmd = "ruff check --fix" }, { cmd = "ruff format" }]
280
281 lint.help = "Lint the code"
282 lint.sequence = [{ cmd = "ruff check" }, { cmd = "mypy" }]
283
284 check-commit.help = "Check the commit messages"
285 check-commit.cmd = "cz --no-raise 3 check --rev-range origin/master.."
286
287 test.help = "Run the test suite"
288 test.cmd = "pytest -n auto --dist=loadfile"
289
290 "test:all".help = "Run the test suite on all supported Python versions"
291 "test:all".cmd = "tox --parallel"
292
293 "test:regen".help = "Regenerate the test fixtures"
294 "test:regen".parallel = [
295 { ref = "test -k 'not py_' --regen-all" },
296 { ref = "test:all -- -k py_ --regen-all" },
297 ]
298
299 cover.help = "Run the test suite with coverage"
300 cover.ref = "test --cov-report term-missing --cov-report=xml:coverage.xml --cov=commitizen --junitxml=junit.xml -o junit_family=legacy"
301
302 all.help = "Run all tasks"
303 all.sequence = ["format", "lint", "check-commit", "cover"]
304
305 "doc:screenshots".help = "Render documentation screenshots"
306 "doc:screenshots".parallel = [
307 { script = "scripts.gen_cli_help_screenshots:gen_cli_help_screenshots" },
308 { script = "scripts.gen_cli_interactive_gifs:gen_cli_interactive_gifs" },
309 ]
310
311 "doc:build".help = "Build the documentation"
312 "doc:build".cmd = "mkdocs build"
313
314 doc.help = "Live documentation server"
315 doc.cmd = "mkdocs serve --livereload" # mkdocs hot reload failure workaround. Ref: https://github.com/mkdocs/mkdocs/issues/4032#issuecomment-3591002290
316
317 ci.help = "Run all tasks in CI"
318 ci.sequence = ["check-commit", { cmd = "prek run --all-files" }, "cover"]
319 ci.env = { SKIP = "no-commit-to-branch" }
320
321 setup-pre-commit.help = "Install pre-commit hooks"
322 setup-pre-commit.cmd = "prek install"