Skip to content

Commit f04fa4e

Browse files
chryslepre-commit-ci[bot]webknjazhynek
authored
CONTRIBUTING: Added instructions for PR workflow (#1105)
* CONTRIBUTING: Added instructions for PR workflow * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Added changelog entry * Use inline code for changelog filename Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua> * Add console prompt to command Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua> * Made some more improvements * Apply suggestions from code review * Update .github/CONTRIBUTING.md * Update changelog.d/1105.change.md * Update .github/CONTRIBUTING.md Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua> * Update .github/CONTRIBUTING.md * Update .github/CONTRIBUTING.md --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua> Co-authored-by: Hynek Schlawack <hs@ox.cx>
1 parent 65ee286 commit f04fa4e

File tree

2 files changed

+44
-3
lines changed

2 files changed

+44
-3
lines changed

.github/CONTRIBUTING.md

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,35 @@ You can (and should) run our test suite using [*tox*].
4343
However, you’ll probably want a more traditional environment as well.
4444
We highly recommend to develop using the latest Python release because we try to take advantage of modern features whenever possible.
4545

46-
Clone the *attrs* repository to your computer:
46+
First [fork](https://github.com/python-attrs/attrs/fork) the repository on GitHub.
47+
48+
Clone the fork to your computer:
4749

4850
```console
49-
$ git clone git@github.com:python-attrs/attrs.git
51+
$ git clone git@github.com:<your-username>/attrs.git
5052
```
5153

5254
Or if you prefer to use Git via HTTPS:
5355

5456
```console
55-
$ git clone https://github.com/python-attrs/attrs.git
57+
$ git clone https://github.com/<your-username>/attrs.git
58+
```
59+
60+
Then add the *attrs* repository as *upstream* remote:
61+
62+
```console
63+
$ git remote add -t main -m main --tags upstream https://github.com/python-attrs/attrs.git
64+
```
65+
66+
The next step is to sync the upstream repository with your local copy:
67+
68+
```console
69+
$ git fetch upstream
5670
```
5771

72+
This is important to obtain eventually missing tags, which are needed to install the development version later on.
73+
See [#1104](https://github.com/python-attrs/attrs/issues/1104) for more information.
74+
5875
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:
5976

6077
```console
@@ -81,6 +98,29 @@ $ make html
8198

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

101+
To file a pull request, create a new branch on top of the upstream repository:
102+
103+
```console
104+
$ git fetch --all
105+
$ git checkout -b my_topical_branch upstream/main
106+
```
107+
108+
Make your changes, push them to your fork (the remote *origin*):
109+
110+
```console
111+
$ git push -u origin
112+
```
113+
114+
and publish the PR in GitHub's web interface!
115+
116+
Before starting to work on your next pull request, run the following command to sync your local repository with the remotes:
117+
118+
```console
119+
$ git fetch --all
120+
$ git checkout main
121+
$ git merge
122+
```
123+
84124
---
85125

86126
To avoid committing code that violates our style guide, we strongly advise you to install [*pre-commit*] and its hooks:

changelog.d/1105.change.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added instructions for pull request workflow to `CONTRIBUTING.md`.

0 commit comments

Comments
 (0)