初次開發¶
請從 Github 上分叉(fork)專案並透過拉取請求(Pull Requests)的方式貢獻回專案。
Github¶
簽名(sign-off)與簽章(sign)你的提交或標籤¶
We prefer your commits or tags are signed. And also sign-off your commits.
我們希望你的提交與標籤都有簽章,並且簽名你的提交。
提示
請參閱這篇文章關於如何使用簽章你的提交與標籤。
Repository¶
Fork¶
Click Fork button on the top-right at the COSCUP/COSCUP-Volunteer repo page.
Clone¶
git clone
from the repo you have forked.
Code style¶
The codebase is compliant in PEP8 and typing hint (PEP484).
- pylint
- autopep8
- pytest
- pytest-cov
- mypy
Note
We also have github actions to verify those quality. The PEP8
must have to be complied but the typing hint only be defined in ./models
, ./module
.
Dependency¶
Poetry¶
Please install Poetry for dependency management and packaging in Python. And not recommended install in pip
.
curl -sSL https://install.python-poetry.org | python3 -
After the poetry is installed, you could run poetry install
to install the packages at local.
libmemcached (optional)¶
If you want development at root system instead of docker containers, please install this dependency for memcached
.
brew install libmemcached
apt-get install libmemcached11
dnf install libmemcached
yum install epel-release && yum install libmemcached.x86_64
Development Environment¶
Install the packages.
poetry install
Shell within the virtual environment.
poetry shell
Note
The virtualenvs.in-project
of poetry configuration has been set to true
.
The folder named .venv
is in the root directory of the project.
Setting up IDE¶
Setting up your IDE for pylint
and autopep8
. Find out the poetry env full path.
poetry env list --full-path
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.