Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
platform: [ubuntu-22.04, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
10 changes: 3 additions & 7 deletions commitizen/changelog_formats/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
from __future__ import annotations

import sys
from typing import Callable, ClassVar, Protocol

if sys.version_info >= (3, 10):
from importlib import metadata
else:
import importlib_metadata as metadata
from collections.abc import Callable
from importlib import metadata
from typing import ClassVar, Protocol

from commitizen.changelog import Metadata
from commitizen.config.base_config import BaseConfig
Expand Down
7 changes: 1 addition & 6 deletions commitizen/cz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@

import importlib
import pkgutil
import sys
import warnings
from collections.abc import Iterable

if sys.version_info >= (3, 10):
from importlib import metadata
else:
import importlib_metadata as metadata
from importlib import metadata

from commitizen.cz.base import BaseCommitizen

Expand Down
4 changes: 2 additions & 2 deletions commitizen/cz/base.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import annotations

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

from jinja2 import BaseLoader, PackageLoader
from prompt_toolkit.styles import Style
Expand Down
7 changes: 1 addition & 6 deletions commitizen/providers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
from __future__ import annotations

import sys
from importlib import metadata
from typing import cast

if sys.version_info >= (3, 10):
from importlib import metadata
else:
import importlib_metadata as metadata

from commitizen.config.base_config import BaseConfig
from commitizen.exceptions import VersionProviderUnknown
from commitizen.providers.base_provider import VersionProvider
Expand Down
5 changes: 3 additions & 2 deletions commitizen/question.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Callable, Literal, TypedDict, Union
from collections.abc import Callable
from typing import Literal, TypedDict


class Choice(TypedDict, total=False):
Expand Down Expand Up @@ -29,4 +30,4 @@ class ConfirmQuestion(TypedDict):
default: bool


CzQuestion = Union[ListQuestion, InputQuestion, ConfirmQuestion]
CzQuestion = ListQuestion | InputQuestion | ConfirmQuestion
12 changes: 2 additions & 10 deletions commitizen/version_schemes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import re
import sys
import warnings
from importlib import metadata
from itertools import zip_longest
from typing import (
TYPE_CHECKING,
Expand All @@ -14,23 +15,14 @@
runtime_checkable,
)

if sys.version_info >= (3, 10):
from importlib import metadata
else:
import importlib_metadata as metadata

from packaging.version import InvalidVersion # noqa: F401 (expose the common exception)
from packaging.version import Version as _BaseVersion

from commitizen.defaults import MAJOR, MINOR, PATCH, Settings
from commitizen.exceptions import VersionSchemeUnknown

if TYPE_CHECKING:
# TypeAlias is Python 3.10+ but backported in typing-extensions
if sys.version_info >= (3, 10):
from typing import TypeAlias
else:
from typing_extensions import TypeAlias
from typing import TypeAlias

# Self is Python 3.11+ but backported in typing-extensions
if sys.version_info < (3, 11):
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ This standardization makes your commit history more readable and meaningful, whi

Before installing Commitizen, ensure you have:

- [Python](https://www.python.org/downloads/) `3.9+`
- [Python](https://www.python.org/downloads/) `3.10+`
- [Git][gitscm] `1.8.5.2+`

### Installation
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ If you're a first-time contributor, please check out issues labeled [good first
### Required Tools

1. **Python Environment**
- Python `>=3.9`
- Python `>=3.10`
- [Poetry](https://python-poetry.org/docs/#installing-with-the-official-installer) `>=2.0.0`
2. **Version Control & Security**
- Git
Expand Down
6 changes: 3 additions & 3 deletions docs/contributing_tldr.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feel free to send a PR to update this file if you find anything useful. 🙇

## Environment

- Python `>=3.9`
- Python `>=3.10`
- [Poetry](https://python-poetry.org/docs/#installing-with-the-official-installer) `>=2.0.0`

## Useful commands
Expand All @@ -21,8 +21,8 @@ poetry format
# Check if ruff and mypy are happy
poetry lint

# Check if mypy is happy in python 3.9
mypy --python-version 3.9
# Check if mypy is happy in python 3.10
mypy --python-version 3.10

# Run tests in parallel.
pytest -n auto # This may take a while.
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.9
image: python:3.10
before_script:
- "which ssh-agent || ( apt-get update -qy && apt-get install openssh-client -qqy )"
- eval `ssh-agent -s`
Expand Down
62 changes: 5 additions & 57 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ maintainers = [
]
license = { file = "LICENSE" }
readme = "docs/README.md"
requires-python = ">=3.9,<4.0"
requires-python = ">=3.10,<4.0"
dependencies = [
"questionary (>=2.0,<3.0)",
# Exclude transitive dependency due to known issue in questionary: https://github.com/tmbo/questionary/issues/454
Expand Down Expand Up @@ -38,11 +38,11 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"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 :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"License :: OSI Approved :: MIT License",
]
Expand Down Expand Up @@ -174,7 +174,7 @@ testpaths = ["tests/"]

[tool.tox]
requires = ["tox>=4.22"]
env_list = ["3.9", "3.10", "3.11", "3.12", "3.13"]
env_list = ["3.10", "3.11", "3.12", "3.13", "3.14"]

[tool.tox.env_run_base]
description = "Run tests suite against Python {base_python}"
Expand Down
6 changes: 1 addition & 5 deletions tests/test_factory.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import sys
from importlib import metadata
from textwrap import dedent

if sys.version_info >= (3, 10):
from importlib import metadata
else:
import importlib_metadata as metadata

import pytest

from commitizen import BaseCommitizen, defaults, factory
Expand Down
7 changes: 1 addition & 6 deletions tests/test_version_schemes.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
from __future__ import annotations

import sys

if sys.version_info >= (3, 10):
from importlib import metadata
else:
import importlib_metadata as metadata
from importlib import metadata

import pytest
from pytest_mock import MockerFixture
Expand Down