diff --git a/README.md b/README.md index d29c9f9..c7d38d2 100644 --- a/README.md +++ b/README.md @@ -277,20 +277,35 @@ Lang2SQL은 LangGraph를 사용한 다단계 접근 방식을 따릅니다: ### 수동 빌드 ```bash -python setup.py sdist bdist_wheel -twine upload dist/* +uv build +UV_PUBLISH_TOKEN=$PYPI_API_TOKEN uv publish --token $UV_PUBLISH_TOKEN ``` -### 자동 릴리스 +### 자동 배포(GitHub Actions) -`v*` 형식의 태그를 푸시하여 자동 PyPI 배포 트리거: +사전 준비: GitHub Secrets에 `PYPI_API_TOKEN` 등록 ```bash -git tag v1.0.0 -git push origin v1.0.0 +# 1) 버전 업데이트 +# - 버전 파일: version.py 의 __version__ = "X.Y.Z" +git add version.py +git commit -m "chore: bump version to X.Y.Z" + +# 2) 태그 생성/푸시 (v* 형식이 트리거) +git tag vX.Y.Z +git push origin HEAD +git push origin vX.Y.Z ``` -**참고**: GitHub Secrets에 `PYPI_API_TOKEN` 설정 필요. +설명: `v*` 태그가 푸시되면 `.github/workflows/pypi-release.yml`이 실행되어 uv로 빌드/배포합니다. + +### TestPyPI로 사전 검증(선택) + +```bash +uv build +UV_PUBLISH_TOKEN=$TEST_PYPI_API_TOKEN \ + uv publish --repository-url https://test.pypi.org/legacy/ --token $UV_PUBLISH_TOKEN +``` --- diff --git a/llm_utils/prompts_class.py b/llm_utils/prompts_class.py deleted file mode 100644 index ceeadbd..0000000 --- a/llm_utils/prompts_class.py +++ /dev/null @@ -1,29 +0,0 @@ -from langchain.chains.sql_database.prompt import SQL_PROMPTS -import os - -from langchain_core.prompts import load_prompt - - -class SQLPrompt: - def __init__(self): - # os library를 확인해서 SQL_PROMPTS key에 해당하는 prompt가 있으면, 이를 교체 - self.sql_prompts = SQL_PROMPTS - self.target_db_list = list(SQL_PROMPTS.keys()) - self.prompt_path = "../prompt" - - def update_prompt_from_path(self): - if os.path.exists(self.prompt_path): - path_list = os.listdir(self.prompt_path) - # yaml 파일만 가져옴 - file_list = [file for file in path_list if file.endswith(".yaml")] - key_path_dict = { - key.split(".")[0]: os.path.join(self.prompt_path, key) - for key in file_list - if key.split(".")[0] in self.target_db_list - } - # file_list에서 sql_prompts의 key에 해당하는 파일이 있는 것만 가져옴 - for key, path in key_path_dict.items(): - self.sql_prompts[key] = load_prompt(path, encoding="utf-8") - else: - raise FileNotFoundError(f"Prompt file not found in {self.prompt_path}") - return False