4
4
Development workflow
5
5
====================
6
6
7
- You already have your own forked copy of the NumPy _ repository, by
8
- following :ref: `forking `, :ref: `set-up-fork `, you have configured git _
9
- by following :ref: `configure-git `, and have linked the upstream
10
- repository as explained in :ref: `linking-to-upstream `.
11
-
12
- What is described below is a recommended workflow with Git.
7
+ You already have your own forked copy of the NumPy repository, have configured
8
+ Git, and have linked the upstream repository as explained in
9
+ :ref: `linking-to-upstream `. What is described below is a recommended workflow
10
+ with Git.
13
11
14
12
Basic workflow
15
13
##############
@@ -32,12 +30,6 @@ In short:
32
30
This way of working helps to keep work well organized and the history
33
31
as clear as possible.
34
32
35
- .. seealso ::
36
-
37
- There are many online tutorials to help you `learn git `_. For discussions
38
- of specific git workflows, see these discussions on `linux git workflow `_,
39
- and `ipython git workflow `_.
40
-
41
33
.. _making-a-new-feature-branch :
42
34
43
35
Making a new feature branch
@@ -79,8 +71,8 @@ In more detail
79
71
#. Make some changes. When you feel that you've made a complete, working set
80
72
of related changes, move on to the next steps.
81
73
82
- #. Optional: Check which files have changed with ``git status `` ( see ` git
83
- status `_). You'll see a listing like this one::
74
+ #. Optional: Check which files have changed with ``git status ``. You'll see a
75
+ listing like this one::
84
76
85
77
# On branch my-new-feature
86
78
# Changed but not updated:
@@ -96,11 +88,11 @@ In more detail
96
88
no changes added to commit (use "git add" and/or "git commit -a")
97
89
98
90
#. Optional: Compare the changes with the previous version using with ``git
99
- diff `` (` git diff `_) . This brings up a simple text browser interface that
91
+ diff ``. This brings up a simple text browser interface that
100
92
highlights the difference between your files and the previous version.
101
93
102
- #. Add any relevant modified or new files using ``git add modified_file ``
103
- (see ` git add `_). This puts the files into a staging area, which is a queue
94
+ #. Add any relevant modified or new files using ``git add modified_file ``.
95
+ This puts the files into a staging area, which is a queue
104
96
of files that will be added to your next commit. Only add files that have
105
97
related, complete changes. Leave files with unfinished changes for later
106
98
commits.
@@ -118,26 +110,23 @@ In more detail
118
110
-a ``. The extra ``-a `` flag automatically commits all modified files and
119
111
removes all deleted files. This can save you some typing of numerous ``git
120
112
add `` commands; however, it can add unwanted changes to a commit if you're
121
- not careful. For more information, see the helpful use-case description in
122
- the `tangled working copy problem `_.
113
+ not careful.
123
114
124
- #. Push the changes to your forked repo on github _ ::
115
+ #. Push the changes to your fork on GitHub ::
125
116
126
117
git push origin my-new-feature
127
118
128
- For more information, see `git push`_.
129
-
130
119
.. note ::
131
120
132
121
Assuming you have followed the instructions in these pages, git will create
133
- a default link to your github _ repo called ``origin ``. In git >= 1.7 you
122
+ a default link to your GitHb repo called ``origin ``. You
134
123
can ensure that the link to origin is permanently set by using the
135
124
``--set-upstream `` option::
136
125
137
126
git push --set-upstream origin my-new-feature
138
127
139
- From now on git _ will know that ``my-new-feature `` is related to the
140
- ``my-new-feature `` branch in your own github _ repo. Subsequent push calls
128
+ From now on, `` git `` will know that ``my-new-feature `` is related to the
129
+ ``my-new-feature `` branch in your own GitHub repo. Subsequent push calls
141
130
are then simplified to the following::
142
131
143
132
git push
@@ -212,12 +201,6 @@ these fragments in each commit message of a PR:
212
201
settings.
213
202
`See the configuration files for these checks. <https://github.com/numpy/numpy/tree/main/.github/workflows >`__
214
203
215
- * ``[skip travis] ``: skip TravisCI jobs
216
-
217
- `TravisCI <https://www.travis-ci.com/ >`__ will test your changes against
218
- Python 3.9 on the PowerPC and s390x architectures.
219
- `See the configuration file for these checks. <https://github.com/numpy/numpy/blob/main/.travis.yml >`__
220
-
221
204
* ``[skip azp] ``: skip Azure jobs
222
205
223
206
`Azure <https://azure.microsoft.com/en-us/products/devops/pipelines >`__ is
@@ -248,47 +231,42 @@ in order to build wheels through continuous integration services. To save resour
248
231
cibuildwheel wheel builders are not run by default on every single PR or commit to main.
249
232
250
233
If you would like to test that your pull request do not break the wheel builders,
251
- you may either append ``[wheel build] `` to the end of the commit message of the commit
252
- or add one of the following labels to the pull request(if you have the permissions to do so):
253
-
254
- - ``36 - Build ``: for pull requests changing build processes/configurations
255
- - ``03 - Maintenance ``: for pull requests upgrading dependencies
256
- - ``14 - Release ``: for pull requests preparing for a release
257
-
258
- The wheels built via github actions (including 64-bit linux, macOS, and
259
- windows, arm64 macOS, and 32-bit windows) will be uploaded as artifacts in zip
260
- files. You can access them from the Summary page of the "Wheel builder"
261
- Action _. The aarch64 wheels built via travis _ CI are not available as artifacts.
234
+ you can do so by appending ``[wheel build] `` to the first line of the commit
235
+ message of the newest commit in your PR. Please only do so for build-related
236
+ PRs, because running all wheel builds is slow and expensive.
237
+
238
+ The wheels built via github actions (including 64-bit Linux, x86-64 macOS, and
239
+ 32/64-bit Windows) will be uploaded as artifacts in zip files. You can access
240
+ them from the Summary page of the "Wheel builder" action. The aarch64 Linux and
241
+ arm64 macOS wheels built via Cirrus CI are not available as artifacts.
262
242
Additionally, the wheels will be uploaded to
263
243
https://anaconda.org/scientific-python-nightly-wheels/ on the following conditions:
264
244
265
245
- by a weekly cron job or
266
- - if the github action or travis build has been manually triggered, which requires appropriate permissions
246
+ - if the GitHub Actions or Cirrus build has been manually triggered, which
247
+ requires appropriate permissions
267
248
268
249
The wheels will be uploaded to https://anaconda.org/multibuild-wheels-staging/
269
250
if the build was triggered by a tag to the repo that begins with ``v ``
270
251
271
- .. _Action : https://github.com/numpy/numpy/actions
272
- .. _travis : https://app.travis-ci.com/github/numpy/numpy/builds
273
252
274
253
.. _workflow_mailing_list :
275
254
276
255
Get the mailing list's opinion
277
- =======================================================
256
+ ==============================
278
257
279
258
If you plan a new feature or API change, it's wisest to first email the
280
259
NumPy `mailing list <https://mail.python.org/mailman/listinfo/numpy-discussion >`_
281
260
asking for comment. If you haven't heard back in a week, it's
282
261
OK to ping the list again.
283
262
263
+
284
264
.. _asking-for-merging :
285
265
286
266
Asking for your changes to be merged with the main repo
287
267
=======================================================
288
268
289
- When you feel your work is finished, you can create a pull request (PR). Github
290
- has a nice help page that outlines the process for `filing pull requests `_.
291
-
269
+ When you feel your work is finished, you can create a pull request (PR).
292
270
If your changes involve modifications to the API or addition/modification of a
293
271
function, add a release note to the ``doc/release/upcoming_changes/ ``
294
272
directory, following the instructions and format in the
@@ -308,14 +286,13 @@ If your PR is large or complicated, asking for input on the numpy-discussion
308
286
mailing list may also be useful.
309
287
310
288
311
-
312
289
.. _rebasing-on-main :
313
290
314
291
Rebasing on main
315
292
================
316
293
317
- This updates your feature branch with changes from the upstream ` NumPy
318
- github `_ repo. If you do not absolutely need to do this, try to avoid doing
294
+ This updates your feature branch with changes from the upstream NumPy
295
+ GitHub repo. If you do not absolutely need to do this, try to avoid doing
319
296
it, except perhaps when you are finished. The first step will be to update
320
297
the remote repository with new commits from upstream::
321
298
@@ -376,8 +353,7 @@ If you forgot to make a backup branch::
376
353
git reset --hard my-feature-branch@{2}
377
354
378
355
If you didn't actually mess up but there are merge conflicts, you need to
379
- resolve those. This can be one of the trickier things to get right. For a
380
- good description of how to do this, see `this article on merging conflicts `_.
356
+ resolve those.
381
357
382
358
383
359
Additional things you might want to do
@@ -470,8 +446,8 @@ and the history looks now like this::
470
446
If it went wrong, recovery is again possible as explained :ref: `above
471
447
<recovering-from-mess-up>`.
472
448
473
- Deleting a branch on github _
474
- ============================
449
+ Deleting a branch on GitHub
450
+ ===========================
475
451
476
452
::
477
453
@@ -490,7 +466,7 @@ Several people sharing a single repository
490
466
491
467
If you want to work on some stuff with other people, where you are all
492
468
committing into the same repository, or even the same branch, then just
493
- share it via github _ .
469
+ share it via GitHub .
494
470
495
471
First fork NumPy into your account, as from :ref: `forking `.
496
472
@@ -549,14 +525,12 @@ To see a linear list of commits for this branch::
549
525
550
526
git log
551
527
552
- You can also look at the `network graph visualizer `_ for your github _
553
- repo.
554
528
555
529
Backporting
556
530
===========
557
531
558
- Backporting is the process of copying new feature/fixes committed in
559
- `numpy/ main `_ back to stable release branches. To do this you make a branch
532
+ Backporting is the process of copying new feature/fixes committed in NumPy's
533
+ `` main `` branch back to stable release branches. To do this you make a branch
560
534
off the branch you are backporting to, cherry pick the commits you want from
561
535
``numpy/main ``, and then submit a pull request for the branch containing the
562
536
backport.
@@ -569,7 +543,7 @@ backport.
569
543
git checkout -b backport-3324 upstream/maintenance/1.8.x
570
544
571
545
2. Now you need to apply the changes from main to this branch using
572
- `git cherry-pick `_ ::
546
+ `` git cherry-pick `` ::
573
547
574
548
# Update remote
575
549
git fetch upstream
@@ -585,7 +559,7 @@ backport.
585
559
586
560
3. You might run into some conflicts cherry picking here. These are
587
561
resolved the same way as merge/rebase conflicts. Except here you can
588
- use `git blame `_ to see the difference between main and the
562
+ use `` git blame `` to see the difference between main and the
589
563
backported branch to make sure nothing gets screwed up.
590
564
591
565
4. Push the new branch to your Github repository::
@@ -636,5 +610,3 @@ them to ``upstream`` as follows:
636
610
first that you're about to push the changes you want to the place you
637
611
want.
638
612
639
-
640
- .. include :: gitwash/git_links.inc
0 commit comments