Skip to content

Commit

Permalink
Fix urwid compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
fatihbaltaci committed Dec 7, 2024
1 parent 8122ea1 commit 14f85b7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 29 deletions.
19 changes: 1 addition & 18 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1 @@
# =============================================================================
# DEPRECATION WARNING:
#
# The file `requirements.txt` does not influence the package dependencies and
# will not be automatically created in the next version of PyScaffold (v4.x).
#
# Please have look at the docs for better alternatives
# (`Dependency Management` section).
# =============================================================================
#
# Add your pinned requirements so that they can be easily installed with:
# pip install -r requirements.txt
# Remember to also add them in setup.cfg but unpinned.
# Example:
# numpy==1.13.3
# scipy==1.0

urwid==2.0.1
urwid==2.1.2
5 changes: 3 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ package_dir =
=src
# DON'T CHANGE THE FOLLOWING LINE! IT WILL BE UPDATED BY PYSCAFFOLD!
setup_requires = pyscaffold>=3.1a0,<3.2a0
# Add here dependencies of your project (semicolon/line-separated), e.g.
install_requires = urwid
# Add here dependencies of your project (semicolon/line-separated)
install_requires =
urwid==2.1.2
# The usage of test_requires is discouraged, see `Dependency Management` docs
# tests_require = pytest; pytest-cov
# Require a specific Python version, e.g. Python 2.7 or >= 3.4
Expand Down
21 changes: 12 additions & 9 deletions src/redial/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# -*- coding: utf-8 -*-
from pkg_resources import get_distribution, DistributionNotFound

try:
# Change here if project is renamed and does not equal the package name
dist_name = __name__
__version__ = get_distribution(dist_name).version
except DistributionNotFound:
__version__ = 'unknown'
finally:
del get_distribution, DistributionNotFound
from importlib.metadata import version, PackageNotFoundError
try:
__version__ = version("redial")
except PackageNotFoundError:
__version__ = 'unknown'
except ImportError:
# Fallback for Python < 3.8
from pkg_resources import get_distribution, DistributionNotFound
try:
__version__ = get_distribution("redial").version
except DistributionNotFound:
__version__ = 'unknown'

0 comments on commit 14f85b7

Please sign in to comment.