requirements.txt를 setup.py에서 읽어서 사용 #111
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#️⃣ Issue Number
📝 요약(Summary)
작업 내용
현재는 파이썬 라이브러리를 requirements.txt, setup.py 두 곳에서 관리함.
requirements.txt만 관리하고, setup.py는 requirements.txt를 읽어서 사용하도록 수정
장점
의존성 정의의 중복 방지
setup.py와 requirements.txt에 각각 같은 패키지를 따로 관리하면, 버전 충돌, 누락 또는 중복, 설치 실패 등의 문제가 발생할 수 있음.
하나의 소스 오브 트루스(Source of Truth) 유지
패키지를 설치할 때는 requirements.txt를, 배포할 때는 setup.py를 참조하게 되면 관리 포인트가 2배가 됨.
한 곳만 수정하고 나머지는 깜빡하면 버그로 이어질 수 있음.
CI/CD 자동화에 유리
자동 테스트, 릴리스, Docker 이미지 빌드 등에서 일관된 의존성 관리가 필요함
pip install .과 pip install -r requirements.txt가 동일한 환경을 보장해야 예측 가능한 배포가 가능해짐.
💬 To Reviewers (선택)
PR Checklist
pip install .
reference) How to Code Review