Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CONTRIBUTING: Added instructions for PR workflow #1105

Merged
merged 16 commits into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
46 changes: 43 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,35 @@ You can (and should) run our test suite using [*tox*].
However, you’ll probably want a more traditional environment as well.
We highly recommend to develop using the latest Python release because we try to take advantage of modern features whenever possible.

Clone the *attrs* repository to your computer:
First [fork](https://github.com/python-attrs/attrs/fork) the repository on GitHub.
hynek marked this conversation as resolved.
Show resolved Hide resolved

Clone the fork to your computer:

```console
$ git clone git@github.com:python-attrs/attrs.git
$ git clone git@github.com:<your-username>/attrs.git
```

Or if you prefer to use Git via HTTPS:

```console
$ git clone https://github.com/python-attrs/attrs.git
$ git clone https://github.com/<your-username>/attrs.git
```

Then add the *attrs* repository as *upstream* remote:

```console
$ git remote add -t main -m main --tags upstream https://github.com/python-attrs/attrs.git
```

The next step is to sync the upstream repository with your local copy:

```console
$ git fetch upstream
chrysle marked this conversation as resolved.
Show resolved Hide resolved
```

This is important to obtain eventually missing tags, which are needed to install the development version later on.
See [#1104](https://github.com/python-attrs/attrs/issues/1104) for more information.

Change into the newly created directory and after activating a virtual environment install an editable version of *attrs* along with its tests and docs requirements:

```console
Expand All @@ -81,6 +98,29 @@ $ make html

The built documentation can then be found in `docs/_build/html/`.

To file a pull request, create a new branch on top of the upstream repository:

```console
$ git fetch --all
$ git checkout -b my_topical_branch upstream/main
hynek marked this conversation as resolved.
Show resolved Hide resolved
```

Make your changes, push them to your fork (the remote *origin*):

```console
$ git push -u origin
hynek marked this conversation as resolved.
Show resolved Hide resolved
```

and publish the PR in GitHub's web interface!

Before starting to work on your next pull request, run the following command to sync your local repository with the remotes:
hynek marked this conversation as resolved.
Show resolved Hide resolved

```console
$ git fetch --all
hynek marked this conversation as resolved.
Show resolved Hide resolved
$ git checkout main
$ git merge
```

---

To avoid committing code that violates our style guide, we strongly advise you to install [*pre-commit*] and its hooks:
Expand Down
1 change: 1 addition & 0 deletions changelog.d/1105.change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added instructions for pull request workflow to `CONTRIBUTING.md`.