From 42a6ccc9a7231fb2b8cfe5c4a59d35318e86f33a Mon Sep 17 00:00:00 2001 From: jiacai2050 Date: Sun, 16 Jun 2024 15:22:09 +0800 Subject: [PATCH] fix: rename model to shellgpt --- Makefile | 6 +++--- README.md | 2 +- pyproject.toml | 10 +++++----- {shgpt => shellgpt}/__init__.py | 0 {shgpt => shellgpt}/__main__.py | 0 {shgpt => shellgpt}/api/ollama.py | 0 {shgpt => shellgpt}/app.py | 4 ++-- {shgpt => shellgpt}/history.py | 0 {shgpt => shellgpt}/tui/app.py | 0 {shgpt => shellgpt}/tui/app.tcss | 0 {shgpt => shellgpt}/utils/common.py | 2 +- {shgpt => shellgpt}/utils/conf.py | 0 {shgpt => shellgpt}/utils/http.py | 0 shgpt/version.py | 1 - tests/test_common.py | 4 ++-- tests/test_llm.py | 4 ++-- 16 files changed, 16 insertions(+), 17 deletions(-) rename {shgpt => shellgpt}/__init__.py (100%) rename {shgpt => shellgpt}/__main__.py (100%) rename {shgpt => shellgpt}/api/ollama.py (100%) rename {shgpt => shellgpt}/app.py (99%) rename {shgpt => shellgpt}/history.py (100%) rename {shgpt => shellgpt}/tui/app.py (100%) rename {shgpt => shellgpt}/tui/app.tcss (100%) rename {shgpt => shellgpt}/utils/common.py (96%) rename {shgpt => shellgpt}/utils/conf.py (100%) rename {shgpt => shellgpt}/utils/http.py (100%) delete mode 100644 shgpt/version.py diff --git a/Makefile b/Makefile index 4058802..3344b65 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,14 @@ tui: - @ python -m shgpt -t + @ python -m shellgpt -t repl: - @ python -m shgpt -l + @ python -m shellgpt -l build: clean hatch build clean: - rm -rf build dist shgpt.egg-info + rm -rf build dist shellgpt.egg-info fix: ruff check --fix diff --git a/README.md b/README.md index f91a9e6..9b0fca9 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ export SHELLGPT_API_KEY= export SHELLGPT_MODEL='@cf/meta/llama-3-8b-instruct' ``` -See [conf.py](https://github.com/jiacai2050/shellgpt/blob/main/shgpt/utils/conf.py) for more configs. +See [conf.py](https://github.com/jiacai2050/shellgpt/blob/main/shellgpt/utils/conf.py) for more configs. ## TUI diff --git a/pyproject.toml b/pyproject.toml index 0c1a300..27e11a8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,15 +39,15 @@ Repository = "https://github.com/jiacai2050/shellgpt" Issues = "https://github.com/jiacai2050/shellgpt/issues" [project.scripts] -sg = "shgpt:main" -shellgpt = "shgpt:main" +sg = "shellgpt:main" +shellgpt = "shellgpt:main" [tool.hatch.version] -path = "shgpt/version.py" +path = "shellgpt/__init__.py" [tool.hatch.build.targets.sdist] include = [ - "shgpt", + "shellgpt", "tests", "pyproject.toml", "README.md", @@ -56,7 +56,7 @@ include = [ [tool.hatch.build.targets.wheel] include = [ - "shgpt", + "shellgpt", ] # https://github.com/astral-sh/ruff?tab=readme-ov-file#configuration diff --git a/shgpt/__init__.py b/shellgpt/__init__.py similarity index 100% rename from shgpt/__init__.py rename to shellgpt/__init__.py diff --git a/shgpt/__main__.py b/shellgpt/__main__.py similarity index 100% rename from shgpt/__main__.py rename to shellgpt/__main__.py diff --git a/shgpt/api/ollama.py b/shellgpt/api/ollama.py similarity index 100% rename from shgpt/api/ollama.py rename to shellgpt/api/ollama.py diff --git a/shgpt/app.py b/shellgpt/app.py similarity index 99% rename from shgpt/app.py rename to shellgpt/app.py index a3c6797..86bff6e 100644 --- a/shgpt/app.py +++ b/shellgpt/app.py @@ -2,7 +2,6 @@ import sys from os import makedirs from .api.ollama import Ollama -from .version import __version__ from .utils.conf import ( API_KEY, MAX_CHAT_MESSAGES, @@ -27,6 +26,7 @@ from .tui.app import ShellGPTApp from .history import History +__version__ = '0.5.0' def init_app(): print(f'Create {CONF_PATH}...') @@ -143,7 +143,7 @@ def load_system_content_when_necessary(sc): def main(): parser = argparse.ArgumentParser( - prog='shgpt', + prog='sg', description='Chat with LLM in your terminal, be it shell generator, story teller, linux-terminal, etc.', ) diff --git a/shgpt/history.py b/shellgpt/history.py similarity index 100% rename from shgpt/history.py rename to shellgpt/history.py diff --git a/shgpt/tui/app.py b/shellgpt/tui/app.py similarity index 100% rename from shgpt/tui/app.py rename to shellgpt/tui/app.py diff --git a/shgpt/tui/app.tcss b/shellgpt/tui/app.tcss similarity index 100% rename from shgpt/tui/app.tcss rename to shellgpt/tui/app.tcss diff --git a/shgpt/utils/common.py b/shellgpt/utils/common.py similarity index 96% rename from shgpt/utils/common.py rename to shellgpt/utils/common.py index 9396001..4ad0aa5 100644 --- a/shgpt/utils/common.py +++ b/shellgpt/utils/common.py @@ -8,7 +8,7 @@ import sys import pyperclip -from shgpt.utils.conf import DEFAULT_IMAGE_DIR, IS_TTY +from shellgpt.utils.conf import DEFAULT_IMAGE_DIR, IS_TTY IS_VERBOSE = False diff --git a/shgpt/utils/conf.py b/shellgpt/utils/conf.py similarity index 100% rename from shgpt/utils/conf.py rename to shellgpt/utils/conf.py diff --git a/shgpt/utils/http.py b/shellgpt/utils/http.py similarity index 100% rename from shgpt/utils/http.py rename to shellgpt/utils/http.py diff --git a/shgpt/version.py b/shgpt/version.py deleted file mode 100644 index 2b8877c..0000000 --- a/shgpt/version.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = '0.5.0' diff --git a/tests/test_common.py b/tests/test_common.py index 58d27e4..ec182e6 100644 --- a/tests/test_common.py +++ b/tests/test_common.py @@ -1,5 +1,5 @@ -from shgpt.utils.common import extract_code, prepare_prompt -from shgpt.utils.conf import DEFAULT_IMAGE_DIR +from shellgpt.utils.common import extract_code, prepare_prompt +from shellgpt.utils.conf import DEFAULT_IMAGE_DIR from os import path import unittest diff --git a/tests/test_llm.py b/tests/test_llm.py index 86054c4..daee569 100644 --- a/tests/test_llm.py +++ b/tests/test_llm.py @@ -1,7 +1,7 @@ -from shgpt.api.ollama import Ollama +from shellgpt.api.ollama import Ollama import unittest -from shgpt.utils.conf import SYSTEM_CONTENT +from shellgpt.utils.conf import SYSTEM_CONTENT class TestLLM(unittest.TestCase):