First off, thanks for taking the time to contribute! 😇
Contributions include but are not restricted to:
- Reporting bugs
- Contributing to code
- Writing tests
- Writing documentation
-
First, fork this project to your own namespace using the fork button at the top right of the repository page.
-
Clone your fork repository to local:
git clone https://github.com/YOURNAME/drf-spectacular-websocket.git
-
Add the fork as a new remote:
git remote add fork https://github.com/YOURNAME/drf-spectacular-websocket.git git fetch fork
We recommend working in a virtual environment. Feel free to create a virtual environment with either the venv module or the virtualenv tool. For example:
-
Create virtual environment
python -m venv venv . venv/bin/activate # linux venv/Scripts/activate # windows
-
Install development dependencies
pip install ."[dev]" # linux pip install .[dev] # windows
-
Install pre-commit
pre-commit install
-
(Optional) Run
pre-commit run --all-files
to run linters and formatters.This step is optional and will be executed automatically by git before you make a commit, but you may want to run it manually in order to apply fixes.
Now, all dependencies are installed into the Python environment you chose, which will be used for development after this point 🎉.
Don't modify code on the main branch, the main branch should always keep track of origin/main 💡.
-
(Optional) 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 branch for new patches.
Code should be Pythonic and zen
-
All functions, methods, classes, and attributes should be documented with a docstring. We use the Google docstring style.
If you come across a function or method that doesn't conform to this standard, please update it as you go
-
Writing and running tests
- Tests are contained within the
tests
directory, and follow the same directory structure as thedrf_spectacular_websocket
module. If you are adding a test case, it should be located within the correct submodule oftests
. E.g., tests fordrf_spectacular_websocket/schemas/schema.py
reside intests/schemas/test_schema.py
.
- Tests are contained within the
-
Make your changes
-
Make sure that nothing is broken after making changes and all tests are checked.
pytest
The test suite is still simple and needs expansion! Please help write more test cases.
-
Commit your changes to git 📝. We follow conventional commits which are enforced using a pre-commit hook.
-
Push the changes to your fork
-
Open a pull request 📥. (using the
pull request
button at the top right of the repository page). Give the pull request a descriptive title indicating what it changes. The style of the PR title should also follow conventional commits. -
Go to the Release Action and make sure that the workflow was successful ✅.
-
Wait until the pull request is accepted by the repository owner ⏳.