|
2 | 2 |
|
3 | 3 | | | |
|
4 | 4 | |--|--|
|
5 |
| -|[](https://github.com/astral-sh/ruff)|[](https://github.com/deargen/python-project-template-2024/actions)| |
6 |
| -| [](https://github.com/astral-sh/ruff) | [](https://github.com/deargen/python-project-template-2024/actions) | |
7 |
| -| [](https://github.com/pytest-dev/pytest) [](https://docs.python.org/3/library/doctest.html) | [](https://github.com/deargen/python-project-template-2024/actions) | |
8 |
| -| [](https://github.com/squidfunk/mkdocs-material) | [](https://github.com/deargen/python-project-template-2024/actions) | |
| 5 | +|[](https://github.com/astral-sh/ruff) |[](https://github.com/deargen/python-project-template-2024/actions)| |
| 6 | +| [](https://github.com/astral-sh/ruff) | [](https://github.com/deargen/python-project-template-2024/actions) | |
| 7 | +| [](https://github.com/pytest-dev/pytest) [](https://docs.python.org/3/library/doctest.html) | [](https://github.com/deargen/python-project-template-2024/actions) | |
| 8 | +| [](https://github.com/astral-sh/uv) | [](https://github.com/deargen/python-project-template-2024/actions) | |
| 9 | +|[](https://squidfunk.github.io/mkdocs-material/)|[](https://github.com/deargen/python-project-template-2024/actions)| |
| 10 | + |
9 | 11 |
|
10 | 12 | 새 파이썬 프로젝트 시작할 때 사용하실 템플릿입니다.
|
11 | 13 |
|
12 | 14 | **주요 기능**
|
13 | 15 |
|
14 |
| -1. Github Actions로 ruff formatter (black+isort), ruff linter, pytest (unit test) 통과 여부 확인 |
| 16 | +1. Github Actions로 ruff formatter, ruff linter, pytest (unit test) 통과 여부 확인 |
15 | 17 | - Actions에서 포매팅 적용 가능
|
16 |
| -2. pytest 커맨드로 유닛 테스트 사용 가능 |
17 |
| -3. MkDocs 이용해 자동 document 생성 |
18 |
| - - GitLab Pages 이용 (GitHub Pages는 Private repo일 경우 유료인 문제가 있음) |
| 18 | +2. GitHub Actions로 uv pip-compile 적용 여부 확인 (`deps/requirements.in`의 dynamic version을 `deps/lock` 안에 lock file로 변환) |
| 19 | + - Actions에서 lock file compile 가능 |
| 20 | +3. MkDocs 이용해 자동 document 생성 |
| 21 | + - Public repo는 GitHub Pages 이용 |
| 22 | + - Private repo는 GitLab Pages 이용 |
19 | 23 | 4. 프로젝트 versioning하고 changelog 자동 생성.
|
20 | 24 | - Actions에서 새 버전 release 가능
|
21 | 25 | - <https://github.com/deargen/workflows> 참고
|
22 | 26 |
|
23 | 27 | ## 돌려 보기
|
24 | 28 |
|
25 | 29 | 1. (Optional) `pip3 install --user uv` 해서 pip 대신 `uv pip` 사용하면 더 빠름.
|
26 |
| -2. `uv pip install -r deps/lock/x86_64-unknown-linux-gnu/requirements.txt`, `uv pip install -e .`, `bash scripts/install_binaries.sh` 으로 dependencies 및 mlproject 패키지 설치 |
| 30 | +2. `uv pip install -r deps/lock/x86_64-manylinux_2_28/requirements.txt`, `uv pip install -e .`, `bash scripts/install_binaries.sh` 으로 dependencies 및 mlproject 패키지 설치 |
27 | 31 | 3. template.env 파일을 .env로 복사한 후 token 등 내용 수정.
|
28 | 32 | 4. `python -m mlproject.health` 실행해서 환경 설정이 잘 되었는지 확인.
|
29 | 33 | 5. `python tools/examples/color_logging_main.py` 실행해보기. 로깅 내용은 `data/logs` 폴더 안에 기록됨.
|
30 |
| -6. `uv pip install -r deps/lock/x86_64-unknown-linux-gnu/requirements_dev.txt` 으로 pytest 등 개발자용 패키지도 설치가능 |
| 34 | +6. `uv pip install -r deps/lock/x86_64-manylinux_2_28/requirements_dev.txt` 으로 pytest 등 개발자용 패키지도 설치가능 |
31 | 35 | 7. `pytest` 커맨드로 테스트 실행해보기.
|
32 | 36 | - doctest는 Actions에서 자동으로 실행됨.
|
33 | 37 | 8. `import mlproject; print(mlproject.__version__)` 해보면 `0.1.0+4.g75bbed7.dirty` 이런식으로 나옴.
|
|
57 | 61 | 📂 scripts/ # 프로젝트와 직접 관련 X, but 프로젝트 관리를 위해 필요
|
58 | 62 |
|
59 | 63 | 📂 deps/
|
60 |
| -│ # 직접 수정 X. scripts/compile_requirements.sh 실행시 생성됨. |
| 64 | +│ # 직접 수정 X. .github/workflows/apply-pip-compile.yml 실행시 생성됨. |
61 | 65 | │ 🛡️ .requirements.in.sha256
|
62 | 66 | │ 🛡️ .requirements_dev.in.sha256
|
63 | 67 | │ 🛡️ .requirements_docs.in.sha256
|
|
0 commit comments