Replace pkg_resources with importlib (#462)
This commit is contained in:
parent
2b41383745
commit
aad7d2ad76
2
poetry.lock
generated
2
poetry.lock
generated
@ -1868,4 +1868,4 @@ compiler = ["black", "isort", "jinja2"]
|
||||
[metadata]
|
||||
lock-version = "2.0"
|
||||
python-versions = "^3.7"
|
||||
content-hash = "f9503e42026d0807dc3ed344b5f8e6fa3f1c7ffa9c66b086de929aefaa8cb8c6"
|
||||
content-hash = "58b357685be67e8852b589ee0df3011b37dc1a2460ece732c0fa4c922f62bddd"
|
||||
|
@ -15,6 +15,7 @@ packages = [
|
||||
python = "^3.7"
|
||||
black = { version = ">=19.3b0", optional = true }
|
||||
grpclib = "^0.4.1"
|
||||
importlib-metadata = { version = ">=1.6.0", python = "<3.8" }
|
||||
jinja2 = { version = ">=3.0.3", optional = true }
|
||||
python-dateutil = "^2.8"
|
||||
isort = {version = "^5.11.5", optional = true}
|
||||
|
@ -1,4 +1,7 @@
|
||||
from pkg_resources import get_distribution
|
||||
try:
|
||||
from importlib import metadata
|
||||
except ImportError: # for Python<3.8
|
||||
import importlib_metadata as metadata # type: ignore
|
||||
|
||||
|
||||
__version__ = get_distribution("betterproto").version
|
||||
__version__ = metadata.version("betterproto")
|
||||
|
Loading…
x
Reference in New Issue
Block a user