From 72acc00cfe6d393165d2ff10680b07e6f0a74687 Mon Sep 17 00:00:00 2001 From: chrysle Date: Sat, 25 Feb 2023 14:59:44 +0100 Subject: [PATCH 01/12] CONTRIBUTING: Added instructions for PR workflow --- .github/CONTRIBUTING.md | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index e4476fddb..ef4253622 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -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. + +Clone the fork to your computer: ```console -$ git clone git@github.com:python-attrs/attrs.git +$ git clone git@github.com:/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//attrs.git +``` + +Then add the *attrs* repository as *upstream* remote: + +```console +$ git remote add upstream git@github.com:python-attrs/attrs.git ``` +You can of course also rename the *origin* remote (your fork) to *fork* and add the repository as *origin*. + +The next step is to sync the upstream repository with your local copy: + +```console +$ git fetch upstream +``` + +This is important to obtain eventually missing tags, which are needed to install the development version later on. See #1104 + 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 @@ -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 +``` + +Make your changes, push them to your fork (the remote *origin*) and publish the PR! + +To sync the *attrs* repository with your local copy, just pull from the *upstream* remote. + --- To avoid committing code that violates our style guide, we strongly advise you to install [*pre-commit*] and its hooks: From 6a1c089457ec4b6f4416ab769654684adeea9040 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 25 Feb 2023 14:05:16 +0000 Subject: [PATCH 02/12] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/CONTRIBUTING.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index ef4253622..8f27818d3 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -43,7 +43,7 @@ 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. -First [fork](https://github.com/python-attrs/attrs/fork) the repository on GitHub. +First [fork](https://github.com/python-attrs/attrs/fork) the repository on GitHub. Clone the fork to your computer: @@ -57,13 +57,13 @@ Or if you prefer to use Git via HTTPS: $ git clone https://github.com//attrs.git ``` -Then add the *attrs* repository as *upstream* remote: +Then add the *attrs* repository as *upstream* remote: ```console $ git remote add upstream git@github.com:python-attrs/attrs.git ``` -You can of course also rename the *origin* remote (your fork) to *fork* and add the repository as *origin*. +You can of course also rename the *origin* remote (your fork) to *fork* and add the repository as *origin*. The next step is to sync the upstream repository with your local copy: @@ -71,7 +71,7 @@ The next step is to sync the upstream repository with your local copy: $ git fetch upstream ``` -This is important to obtain eventually missing tags, which are needed to install the development version later on. See #1104 +This is important to obtain eventually missing tags, which are needed to install the development version later on. See #1104 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: @@ -99,15 +99,15 @@ $ 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: +To file a pull request, create a new branch on top of the upstream repository: ```console git checkout -b my_topical_branch upstream/main ``` -Make your changes, push them to your fork (the remote *origin*) and publish the PR! +Make your changes, push them to your fork (the remote *origin*) and publish the PR! -To sync the *attrs* repository with your local copy, just pull from the *upstream* remote. +To sync the *attrs* repository with your local copy, just pull from the *upstream* remote. --- From 05763ada0bb247d9072e4acf33ea58b7ba61a099 Mon Sep 17 00:00:00 2001 From: chrysle Date: Sat, 25 Feb 2023 15:07:55 +0100 Subject: [PATCH 03/12] Added changelog entry --- changelog.d/1105.change.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/1105.change.md diff --git a/changelog.d/1105.change.md b/changelog.d/1105.change.md new file mode 100644 index 000000000..8c77d5798 --- /dev/null +++ b/changelog.d/1105.change.md @@ -0,0 +1 @@ +Added instructions for pull request workflow to CHANGELOG.md From 8d636a9566d601a596d6d7628abd5eae90573a64 Mon Sep 17 00:00:00 2001 From: chrysle Date: Sun, 26 Feb 2023 07:19:02 +0100 Subject: [PATCH 04/12] Use inline code for changelog filename Co-authored-by: Sviatoslav Sydorenko --- changelog.d/1105.change.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/1105.change.md b/changelog.d/1105.change.md index 8c77d5798..01a00dfa2 100644 --- a/changelog.d/1105.change.md +++ b/changelog.d/1105.change.md @@ -1 +1 @@ -Added instructions for pull request workflow to CHANGELOG.md +Added instructions for pull request workflow to `CHANGELOG.md`. From 1977bdac6663737cb9de5b823a6263fafd0c8e64 Mon Sep 17 00:00:00 2001 From: chrysle Date: Sun, 26 Feb 2023 07:20:34 +0100 Subject: [PATCH 05/12] Add console prompt to command Co-authored-by: Sviatoslav Sydorenko --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 8f27818d3..f476d3dc9 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -102,7 +102,7 @@ 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 +$ git checkout -b my_topical_branch upstream/main ``` Make your changes, push them to your fork (the remote *origin*) and publish the PR! From aa3f8b8908ec5a8064c3e41bb24d88ab445916d0 Mon Sep 17 00:00:00 2001 From: chrysle Date: Sun, 26 Feb 2023 09:32:42 +0100 Subject: [PATCH 06/12] Made some more improvements --- .github/CONTRIBUTING.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index f476d3dc9..ecf4e7565 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -71,7 +71,7 @@ The next step is to sync the upstream repository with your local copy: $ git fetch upstream ``` -This is important to obtain eventually missing tags, which are needed to install the development version later on. See #1104 +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: @@ -107,7 +107,11 @@ $ git checkout -b my_topical_branch upstream/main Make your changes, push them to your fork (the remote *origin*) and publish the PR! -To sync the *attrs* repository with your local copy, just pull from the *upstream* remote. +Before starting to work on your next pull request, run the following command to sync your local repository with the remotes: + +```console +$ git fetch --all +``` --- From 810b8d6c13f649f40232a064deb2f0f8c5024382 Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Mon, 3 Apr 2023 10:50:14 +0200 Subject: [PATCH 07/12] Apply suggestions from code review --- .github/CONTRIBUTING.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index ecf4e7565..372d98940 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -63,15 +63,14 @@ Then add the *attrs* repository as *upstream* remote: $ git remote add upstream git@github.com:python-attrs/attrs.git ``` -You can of course also rename the *origin* remote (your fork) to *fork* and add the repository as *origin*. - The next step is to sync the upstream repository with your local copy: ```console $ git fetch upstream ``` -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. +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: @@ -102,10 +101,17 @@ 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 ``` -Make your changes, push them to your fork (the remote *origin*) and publish the PR! +Make your changes, push them to your fork (the remote *origin*): + +```console +$ git push -u origin +``` + +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: From 43d094586e018cb13be8dee9898815da7b3702bb Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Mon, 3 Apr 2023 10:53:27 +0200 Subject: [PATCH 08/12] Update .github/CONTRIBUTING.md --- .github/CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 372d98940..145ac227e 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -117,6 +117,8 @@ Before starting to work on your next pull request, run the following command to ```console $ git fetch --all +$ git checkout main +$ git merge ``` --- From 6f8d73e2639edbb21ca2d265c57ab195f260beeb Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Mon, 3 Apr 2023 14:56:26 +0200 Subject: [PATCH 09/12] Update changelog.d/1105.change.md --- changelog.d/1105.change.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/1105.change.md b/changelog.d/1105.change.md index 01a00dfa2..ac0b460c4 100644 --- a/changelog.d/1105.change.md +++ b/changelog.d/1105.change.md @@ -1 +1 @@ -Added instructions for pull request workflow to `CHANGELOG.md`. +Added instructions for pull request workflow to `CONTRIBUTING.md`. From 75a41aa5437e7fabcf3d705cb4eb91a7dfb8659f Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Mon, 3 Apr 2023 18:25:26 +0200 Subject: [PATCH 10/12] Update .github/CONTRIBUTING.md Co-authored-by: Sviatoslav Sydorenko --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 145ac227e..d2d38e88e 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -60,7 +60,7 @@ $ git clone https://github.com//attrs.git Then add the *attrs* repository as *upstream* remote: ```console -$ git remote add upstream git@github.com:python-attrs/attrs.git +$ 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: From da1658888f4053ce718c175cd411746da17675c9 Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Mon, 3 Apr 2023 18:30:38 +0200 Subject: [PATCH 11/12] Update .github/CONTRIBUTING.md --- .github/CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index d2d38e88e..84a453c42 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -119,6 +119,8 @@ Before starting to work on your next pull request, run the following command to $ git fetch --all $ git checkout main $ git merge +$ git checkout main +$ git merge ``` --- From 8e822fd9de2caaf14abed997bc509b41b829e885 Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Mon, 3 Apr 2023 18:32:05 +0200 Subject: [PATCH 12/12] Update .github/CONTRIBUTING.md --- .github/CONTRIBUTING.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 84a453c42..d2d38e88e 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -119,8 +119,6 @@ Before starting to work on your next pull request, run the following command to $ git fetch --all $ git checkout main $ git merge -$ git checkout main -$ git merge ``` ---