First off, thanks for taking the time to contribute! Contributions include but are not restricted to:
- Reporting bugs
- Contributing to code
- Writing tests
- Writing documents
The following is a set of guidelines for contributing.
This guideline is for new beginners of OSS. If you are an experienced OSS developer, you can skip this section.
- First, fork this project to your own namespace using the fork button at the top right of the repository page.
- Clone the upstream repository to local:
$ git clone https://github.com/pdm-project/pdm-backend.git # Or if you prefer SSH clone: $ git clone git@github.com:pdm-project/pdm-backend.git
- Add the fork as a new remote:
where
$ git remote add fork https://github.com/yourname/pdm-backend.git $ git fetch fork
fork
is the remote name of the fork repository.
ProTips:
-
Don't modify code on the main branch, the main branch should always keep in track with origin/main.
To update main branch to date:
$ git pull origin main # In rare cases that your local main branch diverges from the remote main: $ git fetch origin && git reset --hard main
-
Create a new branch based on the up-to-date main for new patches.
-
Create a Pull Request from that patch branch.
Following the guide to install PDM on your machine, then install the development dependencies:
$ pdm install
It will create a virtualenv at $PWD/.venv
and install all dependencies into it.
$ pdm run pytest -vv tests
The test suite is still simple and requires to be supplied, please help write more test cases.
PDM uses pre-commit
for linting, you need to install pre-commit
first, then:
$ pre-commit install
$ pre-commit run --all-files
PDM uses ruff
for code style and linting, if you are not following its
suggestions, the CI will fail and your Pull Request will not be merged.