Skip to content

Commit

Permalink
Allow building specfile in CentOS Stream without EPEL (#423)
Browse files Browse the repository at this point in the history
Allow building specfile in CentOS Stream without EPEL

CentOS Stream does not have EPEL packages in CBS Koji.
Package typing-extensions is not available.

Reviewed-by: Nikola Forró
  • Loading branch information
softwarefactory-project-zuul[bot] authored Nov 12, 2024
2 parents b68f01b + 04839bb commit 7e887f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
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: ...

0 comments on commit 7e887f0

Please sign in to comment.