Skip to content

Commit

Permalink
Merge branch 'master' into feature/custom-validation
Browse files Browse the repository at this point in the history
  • Loading branch information
benediktziegler authored Dec 6, 2024
2 parents ff7eee5 + 26152c5 commit 866101a
Show file tree
Hide file tree
Showing 17 changed files with 518 additions and 557 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
python-check:
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
platform: [ubuntu-20.04, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ repos:
- tomli

- repo: https://github.com/commitizen-tools/commitizen
rev: v3.31.0 # automatically updated by Commitizen
rev: v4.0.0 # automatically updated by Commitizen
hooks:
- id: commitizen
- id: commitizen-branch
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## v4.0.0 (2024-11-26)

## v3.31.0 (2024-11-16)

### Feat
Expand Down
2 changes: 1 addition & 1 deletion commitizen/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "3.31.0"
__version__ = "4.0.0"
3 changes: 2 additions & 1 deletion commitizen/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@

import re
from collections import OrderedDict, defaultdict
from collections.abc import Iterable
from dataclasses import dataclass
from datetime import date
from typing import TYPE_CHECKING, Iterable
from typing import TYPE_CHECKING

from jinja2 import (
BaseLoader,
Expand Down
4 changes: 2 additions & 2 deletions commitizen/changelog_formats/restructuredtext.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import re
import sys
from itertools import zip_longest
from typing import IO, TYPE_CHECKING, Any, Tuple, Union
from typing import IO, TYPE_CHECKING, Any, Union

from commitizen.changelog import Metadata

Expand All @@ -18,7 +18,7 @@


# Can't use `|` operator and native type because of https://bugs.python.org/issue42233 only fixed in 3.10
TitleKind: TypeAlias = Union[str, Tuple[str, str]]
TitleKind: TypeAlias = Union[str, tuple[str, str]]


class RestructuredText(BaseFormat):
Expand Down
3 changes: 2 additions & 1 deletion commitizen/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import argparse
import logging
import sys
from collections.abc import Sequence
from copy import deepcopy
from functools import partial
from pathlib import Path
from types import TracebackType
from typing import Any, Sequence
from typing import Any

import argcomplete
from decli import cli
Expand Down
2 changes: 1 addition & 1 deletion commitizen/cz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pkgutil
import sys
import warnings
from typing import Iterable
from collections.abc import Iterable

if sys.version_info >= (3, 10):
from importlib import metadata
Expand Down
3 changes: 2 additions & 1 deletion commitizen/cz/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import re
from abc import ABCMeta, abstractmethod
from typing import Any, Callable, Iterable, NamedTuple, Protocol
from collections.abc import Iterable
from typing import Any, Callable, NamedTuple, Protocol

from jinja2 import BaseLoader, PackageLoader
from prompt_toolkit.styles import Style, merge_styles
Expand Down
3 changes: 2 additions & 1 deletion commitizen/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import pathlib
from collections import OrderedDict
from typing import Any, Iterable, MutableMapping, TypedDict
from collections.abc import Iterable, MutableMapping
from typing import Any, TypedDict

# Type
Questions = Iterable[MutableMapping[str, Any]]
Expand Down
3 changes: 1 addition & 2 deletions commitizen/version_schemes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
ClassVar,
Literal,
Protocol,
Type,
cast,
runtime_checkable,
)
Expand Down Expand Up @@ -150,7 +149,7 @@ def bump(

# With PEP 440 and SemVer semantic, Scheme is the type, Version is an instance
Version: TypeAlias = VersionProtocol
VersionScheme: TypeAlias = Type[VersionProtocol]
VersionScheme: TypeAlias = type[VersionProtocol]


class BaseVersion(_BaseVersion):
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ descriptive commits.

## Requirements

[Python](https://www.python.org/downloads/) `3.8+`
[Python](https://www.python.org/downloads/) `3.9+`

[Git][gitscm] `1.8.5.2+`

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/gitlab_ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ test:

auto-bump:
stage: auto-bump
image: python:3.8
image: python:3.9
before_script:
- "which ssh-agent || ( apt-get update -qy && apt-get install openssh-client -qqy )"
- eval `ssh-agent -s`
Expand Down
947 changes: 455 additions & 492 deletions poetry.lock

Large diffs are not rendered by default.

91 changes: 42 additions & 49 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[tool.commitizen]
version = "3.31.0"
version = "4.0.0"
tag_format = "v$version"
version_files = [
"pyproject.toml:version",
"commitizen/__version__.py",
".pre-commit-config.yaml:rev:.+Commitizen",
"pyproject.toml:version",
"commitizen/__version__.py",
".pre-commit-config.yaml:rev:.+Commitizen",
]

[tool.poetry]
name = "commitizen"
version = "3.31.0"
version = "4.0.0"
description = "Python commitizen client tool"
authors = ["Santiago Fraire <[email protected]>"]
license = "MIT"
Expand All @@ -25,20 +25,17 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"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",
]
packages = [
{include = "commitizen"},
{include = "commitizen/py.typed"},
]
packages = [{ include = "commitizen" }, { include = "commitizen/py.typed" }]

[tool.poetry.dependencies]
python = ">=3.8"
python = ">=3.9"
questionary = "^2.0"
decli = "^0.6.0"
colorama = "^0.4.1"
Expand All @@ -48,24 +45,24 @@ tomlkit = ">=0.5.3,<1.0.0"
jinja2 = ">=2.10.3"
pyyaml = ">=3.08"
argcomplete = ">=1.12.1,<3.6"
typing-extensions = { version = "^4.0.1", python = "<3.8" }
typing-extensions = { version = "^4.0.1", python = "<3.11" }
charset-normalizer = ">=2.1.0,<4"
# Use the Python 3.11 and 3.12 compatible API: https://github.com/python/importlib_metadata#compatibility
importlib_metadata = { version = ">=8.0.0,<9", python = "<3.10"}
importlib_metadata = { version = ">=8.0.0,<9", python = "<3.10" }

[tool.poetry.group.dev.dependencies]
# dev tool
ipython = "^8.0"
# test
pytest = ">=7.2,<9.0"
pytest-cov = ">=4,<6"
pytest-cov = ">=4,<7"
pytest-mock = "^3.10"
pytest-regressions = "^2.4.0"
pytest-freezer = "^0.4.6"
pytest-xdist = "^3.1.0"
# linter
ruff = ">=0.5.0,<0.8.0"
pre-commit = ">=2.18,<4.0"
ruff = ">=0.5.0,<0.9.0"
pre-commit = ">=2.18,<5.0"
mypy = "^1.4"
types-PyYAML = ">=5.4.3,<7.0.0"
types-termcolor = "^0.1.1"
Expand Down Expand Up @@ -108,33 +105,33 @@ semver = "commitizen.version_schemes:SemVer"
semver2 = "commitizen.version_schemes:SemVer2"

[tool.coverage]
[tool.coverage.report]
show_missing = true
exclude_lines = [
# Have to re-enable the standard pragma
'pragma: no cover',

# Don't complain about missing debug-only code:
'def __repr__',
'if self\.debug',

# 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__.:',
'if TYPE_CHECKING:',
]
omit = [
'env/*',
'venv/*',
'.venv/*',
'*/virtualenv/*',
'*/virtualenvs/*',
'*/tests/*',
]
[tool.coverage.report]
show_missing = true
exclude_lines = [
# Have to re-enable the standard pragma
'pragma: no cover',

# Don't complain about missing debug-only code:
'def __repr__',
'if self\.debug',

# 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__.:',
'if TYPE_CHECKING:',
]
omit = [
'env/*',
'venv/*',
'.venv/*',
'*/virtualenv/*',
'*/virtualenvs/*',
'*/tests/*',
]

[build-system]
requires = ["poetry_core>=1.0.0"]
Expand All @@ -157,11 +154,7 @@ select = [
# isort
"I",
]
ignore = [
"E501",
"D1",
"D415"
]
ignore = ["E501", "D1", "D415"]

[tool.ruff.lint.isort]
known-first-party = ["commitizen", "tests"]
Expand All @@ -179,7 +172,7 @@ warn_unused_ignores = true
warn_unused_configs = true

[[tool.mypy.overrides]]
module = "py.*" # Legacy pytest dependencies
module = "py.*" # Legacy pytest dependencies
ignore_missing_imports = true

[tool.codespell]
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import os
import re
import tempfile
from collections.abc import Iterator
from pathlib import Path
from typing import Iterator

import pytest
from pytest_mock import MockerFixture
Expand Down
2 changes: 1 addition & 1 deletion tests/providers/conftest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import annotations

import os
from collections.abc import Iterator
from pathlib import Path
from typing import Iterator

import pytest

Expand Down

0 comments on commit 866101a

Please sign in to comment.