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
6 changes: 5 additions & 1 deletion confuse/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@
from collections import OrderedDict
from typing import TYPE_CHECKING, Any, TypeVar, overload

try:
from typing import Self
except ImportError: # Python < 3.11
from typing_extensions import Self

import yaml
from typing_extensions import Self

from . import templates, util, yaml_util
from .exceptions import ConfigError, ConfigTypeError, NotFoundError
Expand Down
6 changes: 5 additions & 1 deletion confuse/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@
import os
import pathlib
import re
import sys
from collections import abc
from collections.abc import Hashable, Iterable, Mapping
from functools import singledispatchmethod
from typing import TYPE_CHECKING, Any, Generic, NoReturn, overload

from typing_extensions import TypeVar
if sys.version_info < (3, 13):
from typing_extensions import TypeVar
else:
from typing import TypeVar

from . import exceptions, util

Expand Down
6 changes: 6 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

Unreleased
-----------
- Require `typing_extensions` on older Python versions (and use `typing`
on newer versions). [#189](https://github.com/beetbox/confuse/issues/189)


v2.2.0
------

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ classifiers = [
]
dependencies = [
"pyyaml",
"typing_extensions >= 4.4; python_version < '1.13'",
]

[dependency-groups]
Expand Down