Skip to content

Commit 9450908

Browse files
authored
Merge pull request #54 from pan93412/poetry
refactor: migrate to Poetry
2 parents c8f84b8 + be3a7bf commit 9450908

File tree

5 files changed

+1135
-5
lines changed

5 files changed

+1135
-5
lines changed

Dockerfile-base

+9-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ RUN \
1313
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
1414
python3 get-pip.py && \
1515
rm get-pip.py && \
16-
pip install -r ./requirements.txt && \
17-
apk del .build-deps && \
18-
rm -rf /var/cache/apk/* /var/lib/apk/* /etc/apk/cache/*
16+
pip install poetry
17+
18+
# Install PIP dependencies
19+
ADD pyproject.toml poetry.lock /app/
20+
RUN poetry install
21+
22+
# Cleanup
23+
RUN apk del .build-deps && \
24+
rm -rf /var/cache/apk/* /var/lib/apk/* /etc/apk/cache/*

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,30 @@ GNU Affero General Public License version 3 (AGPL-3.0)
5050

5151
sh ./restart_app.sh
5252

53+
## Local Development
54+
55+
### 安裝依賴
56+
57+
您可能需要先安裝 `libmemcached``poetry`,才能安裝依賴。
58+
59+
brew install libmemcached # macOS
60+
pip install poetry # Install Poetry
61+
62+
poetry install # Install Dependencies
63+
64+
### 設定 VS Code
65+
66+
找到 poetry 建立的 virtual environment:
67+
68+
poetry env list --full-path
69+
70+
然後 <kbd>Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd>,輸入 `Python: Select Interpreter`
71+
選擇 `輸入直譯器路徑`,填入路徑即可。
72+
73+
## Nginx 設定
74+
75+
(待補)
76+
5377
## Issues
5478

5579
問題回報請使用 Issues、如果遇到安全問題的回報,可以使用 GPG 加密後回報。

0 commit comments

Comments
 (0)