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

Fix setuptools to support __version__ #52

Merged
merged 2 commits into from Oct 19, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions eth_typing/__init__.py
@@ -1,9 +1,13 @@
try:
from importlib.metadata import version as __version
from importlib.metadata import (
version as __version,
)
except ImportError:
# TODO: remove once Python 3.7 is no longer supported
def __version(package_name: str) -> str: # type: ignore
from pkg_resources import get_distribution
from pkg_resources import (
get_distribution,
)

return get_distribution(package_name).version

Expand Down
1 change: 1 addition & 0 deletions newsfragments/52.internal.rst
@@ -0,0 +1 @@
Add ``types-setuptools`` to support pkg_resources and __version__
2 changes: 2 additions & 0 deletions setup.py
Expand Up @@ -9,6 +9,7 @@
"test": [
"pytest>=7.0.0",
"pytest-xdist>=2.4.0",
"types-setuptools",
],
"lint": [
"flake8==6.0.0", # flake8 claims semver but adds new warnings at minor releases, leave it pinned.
Expand All @@ -17,6 +18,7 @@
"mypy==0.971", # mypy does not follow semver, leave it pinned.
"pydocstyle>=6.0.0",
"black>=23",
"types-setuptools",
],
"docs": [
"sphinx>=5.0.0",
Expand Down