Skip to content

Developer Beginner

Fork the project from gihub and make pull requests to the origin repository.

Github

Sign commits or tags

We prefer your commits or tags are signed.

Tip

Please read this docs to learn about how to sign your commits and tags.

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://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | 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

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.

Create a file .pylintrc and with those contents. And replace the {PUT-POETRY-ENV-FULL-PATH-HERE} with the value of poetry env list --full-path.

[MASTER]
extension-pkg-whitelist=pydantic
disable=W0223
init-hook='import os, sys; sys.path.append(os.getcwd()); sys.path.append("{PUT-POETRY-ENV-FULL-PATH-HERE}")'
generated-members=setting,googleapiclient.discovery.*,pymongo