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
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ def read(*names):
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Operating System :: OS Independent",
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
Expand Down
13 changes: 8 additions & 5 deletions src/stopit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@
Public resources from ``stopit``
"""

import pkg_resources

from .utils import LOG, TimeoutException
from .threadstop import ThreadingTimeout, async_raise, threading_timeoutable
from .signalstop import SignalTimeout, signal_timeoutable

# PEP 396 style version marker
try:
__version__ = pkg_resources.get_distribution(__name__).version
from importlib.metadata import version # Python >=3.8
__version__ = version(__name__)
except:
LOG.warning("Could not get the package version from pkg_resources")
__version__ = 'unknown'
try:
import pkg_resources # Deprecated in recent setuptools
__version__ = pkg_resources.get_distribution(__name__).version
except:
LOG.warning("Could not get the package version from importlib or pkg_resources")
__version__ = 'unknown'

__all__ = (
'ThreadingTimeout', 'async_raise', 'threading_timeoutable',
Expand Down