update guide

This commit is contained in:
David Lord 2023-04-13 09:55:44 -07:00
parent 0f73470123
commit ffc0cba994
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8

View file

@ -89,6 +89,7 @@ PyCharm on your local computer.
First time setup in your local environment First time setup in your local environment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Make sure you have a `GitHub account`_.
- Download and install the `latest version of git`_. - Download and install the `latest version of git`_.
- Configure git with your `username`_ and `email`_. - Configure git with your `username`_ and `email`_.
@ -97,25 +98,16 @@ First time setup in your local environment
$ git config --global user.name 'your name' $ git config --global user.name 'your name'
$ git config --global user.email 'your email' $ git config --global user.email 'your email'
- Make sure you have a `GitHub account`_.
- Fork Flask to your GitHub account by clicking the `Fork`_ button. - Fork Flask to your GitHub account by clicking the `Fork`_ button.
- `Clone`_ the main repository locally. - `Clone`_ your fork locally, replacing ``your-username`` in the command below with
your actual username.
.. code-block:: text .. code-block:: text
$ git clone https://github.com/pallets/flask $ git clone https://github.com/your-username/flask
$ cd flask $ cd flask
- Add your fork as a remote to push your work to. Replace - Create a virtualenv. Use the latest version of Python.
``{username}`` with your username. This names the remote "fork", the
default Pallets remote is "origin".
.. code-block:: text
$ git remote add fork https://github.com/{username}/flask
- Create a virtualenv.
- Linux/macOS - Linux/macOS
@ -131,29 +123,23 @@ First time setup in your local environment
> py -3 -m venv .venv > py -3 -m venv .venv
> env\Scripts\activate > env\Scripts\activate
- Upgrade pip and setuptools. - Install the development dependencies, then install Flask in editable mode.
.. code-block:: text
$ python -m pip install --upgrade pip setuptools
- Install the development dependencies, then install Flask in editable
mode.
.. code-block:: text .. code-block:: text
$ python -m pip install -U pip setuptools wheel
$ pip install -r requirements/dev.txt && pip install -e . $ pip install -r requirements/dev.txt && pip install -e .
- Install the pre-commit hooks. - Install the pre-commit hooks.
.. code-block:: text .. code-block:: text
$ pre-commit install $ pre-commit install --install-hooks
.. _GitHub account: https://github.com/join
.. _latest version of git: https://git-scm.com/downloads .. _latest version of git: https://git-scm.com/downloads
.. _username: https://docs.github.com/en/github/using-git/setting-your-username-in-git .. _username: https://docs.github.com/en/github/using-git/setting-your-username-in-git
.. _email: https://docs.github.com/en/github/setting-up-and-managing-your-github-user-account/setting-your-commit-email-address .. _email: https://docs.github.com/en/github/setting-up-and-managing-your-github-user-account/setting-your-commit-email-address
.. _GitHub account: https://github.com/join
.. _Fork: https://github.com/pallets/flask/fork .. _Fork: https://github.com/pallets/flask/fork
.. _Clone: https://docs.github.com/en/github/getting-started-with-github/fork-a-repo#step-2-create-a-local-clone-of-your-fork .. _Clone: https://docs.github.com/en/github/getting-started-with-github/fork-a-repo#step-2-create-a-local-clone-of-your-fork
@ -162,54 +148,30 @@ First time setup in your local environment
Start coding Start coding
~~~~~~~~~~~~ ~~~~~~~~~~~~
- Create a branch to identify the issue you would like to work on. If - Create a branch to identify the issue you would like to work on. If you're
you're submitting a bug or documentation fix, branch off of the submitting a bug or documentation fix, branch off of the latest ".x" branch.
latest ".x" branch.
.. code-block:: text .. code-block:: text
$ git fetch origin $ git fetch origin
$ git checkout -b your-branch-name origin/2.0.x $ git checkout -b your-branch-name origin/2.0.x
If you're submitting a feature addition or change, branch off of the If you're submitting a feature addition or change, branch off of the "main" branch.
"main" branch.
.. code-block:: text .. code-block:: text
$ git fetch origin $ git fetch origin
$ git checkout -b your-branch-name origin/main $ git checkout -b your-branch-name origin/main
- Using your favorite editor, make your changes, - Using your favorite editor, make your changes, `committing as you go`_.
`committing as you go`_.
- If you are in a codespace, you will be prompted to - If you are in a codespace, you will be prompted to `create a fork`_ the first
`create a fork`_ the first time you make a commit with the time you make a commit. Enter ``Y`` to continue.
following message:
.. code-block:: text - Include tests that cover any code changes you make. Make sure the test fails without
your patch. Run the tests as described below.
You don't have write access to the pallets/flask repository, so you cannot push changes to it. - Push your commits to your fork on GitHub and `create a pull request`_. Link to the
To obtain write access we will point this codespace at your fork of pallets/flask, creating that fork if it doesn't exist. issue being addressed with ``fixes #123`` in the pull request description.
Would you like to proceed?
Enter ``Y`` at the command prompt to create a new fork or push
to your existing fork. This will name your remote fork ``origin``
and rename pallets/flask to ``upstream``.
- 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 and
`create a pull request`_. Link to the issue being addressed with
``fixes #123`` in the pull request.
- Local development
.. code-block:: text
$ git push --set-upstream fork your-branch-name
- GitHub Codespaces
.. code-block:: text .. code-block:: text