Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow building specfile in CentOS Stream without EPEL #423

Merged
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 setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ install_requires =
importlib-metadata;python_version<"3.8"
dataclasses;python_version<"3.7"
rpm
typing-extensions
typing-extensions;python_version<"3.8"
python_requires = >=3.6
include_package_data = True

Expand Down
16 changes: 9 additions & 7 deletions specfile/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@

import abc

from typing_extensions import Protocol


# define our own SupportsIndex type for older version of typing_extensions (EL 8)
class SupportsIndex(Protocol, metaclass=abc.ABCMeta):
@abc.abstractmethod
def __index__(self) -> int: ...
try:
from typing import SupportsIndex
except ImportError:
# define our own SupportsIndex type for older version of typing (Python 3.7 and older)
from typing_extensions import Protocol

class SupportsIndex(Protocol, metaclass=abc.ABCMeta): # type: ignore [no-redef]
@abc.abstractmethod
def __index__(self) -> int: ...
Loading