Skip to content
Merged
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", "3.14"]
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
Expand Up @@ -2,8 +2,8 @@

import re
from abc import ABCMeta, abstractmethod
from collections.abc import Iterable, Mapping
from typing import Any, Callable, NamedTuple, Protocol
from collections.abc import Callable, Iterable, Mapping
from typing import Any, NamedTuple, 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
Loading