Skip to content

Commit fcfc42f

Browse files
Merge pull request #111 from CausalInferenceLab/feature/110-unify-dependency-management
requirements.txt를 setup.py에서 읽어서 사용
2 parents e6e457f + bac5c45 commit fcfc42f

File tree

1 file changed

+33
-24
lines changed

1 file changed

+33
-24
lines changed

setup.py

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,49 @@
1-
# setup.py
1+
"""
2+
setup.py - lang2sql 패키지의 설치 및 배포 구성을 정의하는 파일입니다.
3+
4+
이 파일은 setuptools를 사용하여 패키지 메타데이터, 의존성, CLI 엔트리 포인트 등을 지정하며,
5+
pip 또는 Python 배포 도구들이 이 정보를 바탕으로 설치를 수행합니다.
6+
"""
7+
28
from setuptools import find_packages, setup
39

10+
11+
def load_requirements(path="requirements.txt"):
12+
"""
13+
주어진 경로의 requirements.txt 파일을 읽어 의존성 목록을 반환합니다.
14+
15+
각 줄을 읽고, 빈 줄이나 주석(#)은 무시합니다.
16+
17+
Args:
18+
path (str): 읽을 requirements 파일 경로 (기본값: 'requirements.txt')
19+
20+
Returns:
21+
list[str]: 설치할 패키지 목록
22+
"""
23+
24+
with open(path, "r", encoding="utf-8") as f:
25+
return [line.strip() for line in f if line.strip() and not line.startswith("#")]
26+
27+
28+
requirements = load_requirements()
29+
430
with open("docs/README.md", "r", encoding="utf-8") as fh:
531
long_description = fh.read()
632

733
setup(
8-
name="lang2sql", # 패키지 이름
9-
version="0.1.9", # 버전
34+
name="lang2sql",
35+
version="0.1.9",
1036
author="ehddnr301",
1137
author_email="dy95032@gmail.com",
1238
url="https://github.com/CausalInferenceLab/Lang2SQL",
1339
description="Lang2SQL - Query Generator for Data Warehouse",
1440
long_description=long_description,
1541
long_description_content_type="text/markdown",
16-
packages=find_packages(), # my_package를 자동으로 찾음
17-
install_requires=[
18-
"langgraph==0.2.62",
19-
"datahub==0.999.1",
20-
"langchain==0.3.14",
21-
"langchain-community==0.3.14",
22-
"openai==1.59.8",
23-
"langchain-openai==0.3.0",
24-
"streamlit==1.41.1",
25-
"python-dotenv==1.0.1",
26-
"faiss-cpu==1.10.0",
27-
"langchain-aws>=0.2.21,<0.3.0",
28-
"langchain-google-genai>=2.1.3,<3.0.0",
29-
"langchain-ollama>=0.3.2,<0.4.0",
30-
"langchain-huggingface>=0.1.2,<0.2.0",
31-
"transformers==4.51.2",
32-
"pytest>=8.3.5",
33-
],
42+
packages=find_packages(),
43+
install_requires=requirements,
3444
entry_points={
3545
"console_scripts": [
36-
# "my-project" 명령어로 my_package.main 모듈의 run 함수를 실행
37-
"lang2sql = cli.__init__:cli"
38-
]
46+
"lang2sql = cli.__init__:cli",
47+
],
3948
},
4049
)

0 commit comments

Comments
 (0)