feat: Replace deprecated dependency
All checks were successful
Docker CI/CD / Docker Build and Push to Docker Hub (push) Successful in 8m56s
All checks were successful
Docker CI/CD / Docker Build and Push to Docker Hub (push) Successful in 8m56s
Transitioned from the deprecated `pkg_resources` to `importlib.metadata` for package version retrieval, improving performance and future compatibility.
This commit is contained in:
parent
7745593b91
commit
5a9332d635
2 changed files with 6 additions and 2 deletions
|
@ -2,6 +2,10 @@
|
|||
|
||||
### 0.3.9 (unreleased)
|
||||
|
||||
* Add Docker support for running the bot in a container
|
||||
* Add TrackingMore dependency to pyproject.toml
|
||||
* Replace deprecated `pkg_resources` with `importlib.metadata`
|
||||
|
||||
### 0.3.7 / 0.3.8 (2024-04-15)
|
||||
|
||||
* Changes to URLs in pyproject.toml
|
||||
|
|
|
@ -5,14 +5,14 @@ from configparser import ConfigParser
|
|||
|
||||
import signal
|
||||
import asyncio
|
||||
import pkg_resources
|
||||
import importlib.metadata
|
||||
|
||||
def sigterm_handler(_signo, _stack_frame):
|
||||
exit()
|
||||
|
||||
def get_version():
|
||||
try:
|
||||
package_version = pkg_resources.get_distribution("matrix_gptbot").version
|
||||
package_version = importlib.metadata.version("matrix_gptbot")
|
||||
except pkg_resources.DistributionNotFound:
|
||||
return None
|
||||
return package_version
|
||||
|
|
Loading…
Reference in a new issue