初次開發¶
請從 Github 上分叉(fork)專案並透過拉取請求(Pull Requests)的方式貢獻回專案。
Github¶
簽名(sign-off)與簽章(sign)你的提交或標籤¶
我們希望你的提交與標籤都有簽章,並且簽名你的提交。
提示
請參閱這篇文章關於如何使用簽章你的提交與標籤。
倉儲¶
分支¶
在 COSCUP/COSCUP-Volunteer 存儲庫頁面的右上方點擊 Fork 按鈕。
克隆¶
使用你所 Fork 的存儲庫進行 git clone
。
程式碼風格¶
這份程式碼遵從 PEP8 和類型提示 (PEP484) 的規範。
- pylint
- autopep8
- pytest
- pytest-cov
- mypy
Note
我們也有 GitHub Actions 來驗證這些程式碼的品質,PEP8 必須要遵守,
開發環境相依¶
Poetry¶
請安裝 Poetry 作為 Python 套件管理工具。並不建議透過 pip
來安裝 Poetry。
curl -sSL https://install.python-poetry.org | python3 -
當安裝好 Poetry 之後,可以使用 poetry install
在本地端安裝專案所需的套件。
libmemcached (選擇性)¶
如果你想要在本地端系統開發而不是透過 docker 與容器的方式開發,請安裝 memcached
相關套件。
brew install libmemcached
apt-get install libmemcached11
dnf install libmemcached
yum install epel-release && yum install libmemcached.x86_64
開發環境¶
安裝套件
poetry install
啟動開發環境
poetry shell
Note
由於 Poetry 設定檔 virtualenvs.in-project
設定為 true
,因此 .venv
會建立在專案的根目錄中。
設定 IDE¶
Setup the Python: Select Interpreter
Cmd+Shift+P, and input the poetry's env full path.
vim
will auto read the pyproject.toml
file, so there is nothing changed here.