Skip to content

Commit

Permalink
Replace deprecated pkg_resources with importlib.metadata
Browse files Browse the repository at this point in the history
- Now uses importlib.metadata.version in devchat/_cli.py.
- Removed setuptools from the dependencies in pyproject.toml.
- Added importlib-metadata to the dependencies in pyproject.toml.
- Updated the poetry.lock file to reflect the changes in dependencies.
  • Loading branch information
basicthinker committed Jul 17, 2023
1 parent e9e337d commit 9deb481
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 20 deletions.
4 changes: 2 additions & 2 deletions devchat/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
import sys
from typing import List, Optional, Tuple
import pkg_resources
import importlib.metadata
import rich_click as click
from devchat.store import Store
from devchat.openai import OpenAIChatConfig, OpenAIChat
Expand All @@ -19,7 +19,7 @@


@click.group()
@click.version_option(pkg_resources.get_distribution("devchat").version, '--version',
@click.version_option(importlib.metadata.version("devchat"), '--version',
message='DevChat %(version)s')
def main():
"""DevChat CLI: A command-line interface for DevChat."""
Expand Down
52 changes: 35 additions & 17 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ rich_click = "^1.6.1"
tiktoken = "^0.4.0"
tinydb = "^4.7.1"
urllib3 = "<2.0"
setuptools = "^68.0.0"
importlib-metadata = "^6.8.0"

[tool.poetry.scripts]
devchat = "devchat._cli:main"
Expand Down

0 comments on commit 9deb481

Please sign in to comment.