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 4 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
34 changes: 31 additions & 3 deletions .github/CONTRIBUTING.md
Expand Up @@ -43,18 +43,36 @@ 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 upstream git@github.com:python-attrs/attrs.git
hynek marked this conversation as resolved.
Show resolved Hide resolved
```

You can of course also rename the *origin* remote (your fork) to *fork* and add the repository as *origin*.
hynek marked this conversation as resolved.
Show resolved Hide resolved

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
chrysle marked this conversation as resolved.
Show resolved Hide resolved

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 +99,16 @@ $ 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 checkout -b my_topical_branch upstream/main
chrysle marked this conversation as resolved.
Show resolved Hide resolved
```

Make your changes, push them to your fork (the remote *origin*) and publish the PR!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be accompanied with the following snippet:

$ git push -u origin feature/my-topic-branch

-u marks the branch on the origin remote (aka fork) as corresponding to the local one so that git push w/o args would pick it up automatically.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i removed the branch name because it feels tedious and it's unclear to me what problem it's supposed to solve. happy to be corrected, but I'll try to keep it as simple as possible.

hynek marked this conversation as resolved.
Show resolved Hide resolved

To sync the *attrs* repository with your local copy, just pull from the *upstream* remote.
chrysle marked this conversation as resolved.
Show resolved Hide resolved

---

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
@@ -0,0 +1 @@
Added instructions for pull request workflow to CHANGELOG.md
chrysle marked this conversation as resolved.
Show resolved Hide resolved