-
Notifications
You must be signed in to change notification settings - Fork 115
Contributing Guide
非法操作 edited this page Sep 16, 2022
·
2 revisions
Thank you for contributing to Flask-shop.
Please ask questions with our github discussion. That could be any questions.
If you find a bug, or you think flaskshop should provide a new feature/enhacement, feel free to create an issue on our issue tracker.
Include the following information in your post:
- Describe what you expected to happen.
- Describe what actually happened. Include the full traceback if there was an exception.
If there is not an open issue for what you want to submit, prefer opening one for discussion before working on a PR. You can work on any issue that doesn't have an open PR linked to it or a maintainer assigned to it. These show up in the sidebar. No need to ask if you can work on an issue that interests you.
- Download and install the latest version of Git.
- Configure git with your username and email.
$ git config --global user.name 'your name'
$ git config --global user.email 'your email'
- Make sure you have a GitHub account.
- Click the "[Fork][_fork]" button to fork flask-shop on GitHub.
- Clone your fork repository locally (replace
{username}
with your username):
$ git clone https://github.com/{username}/flask-shop
$ cd flask-shop
$ git remote add upstream https://github.com/hjlarry/flask-shop
- Create a virtual environment and install requirements:
$ python3 -m venv .venv
# For Windows, .venv\Scripts\activate
$ source .venv/bin/activate
$ python -m pip install --upgrade pip setuptools
$ pip install -r requirements.txt
$ pre-commit install
- Create a new branch to address the issue you want to work on (be sure to update the example branch name):
$ git fetch upstream
$ git checkout -b your-branch-name upstream/main
- Using your favorite editor, make your changes, committing as you go.
- Include tests that cover any code changes you make. Make sure the test fails without your patch. Run the tests as described below.
- Push your commits to your fork on GitHub:
$ git push --set-upstream origin your-branch-name
-
Create a pull request. Link to the issue being addressed with
fixes #123
in the pull request.
Run the basic test suite with pytest:
$ pytest