Skip to content

Commit 1c69f8f

Browse files
committed
Merge branch 'main' into xin
2 parents 8798a7d + 08f2fcf commit 1c69f8f

17 files changed

+159
-75
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Tests
33
on:
44
pull_request:
55
push:
6-
branches: master
6+
branches: main
77

88
jobs:
99
test:
@@ -13,14 +13,14 @@ jobs:
1313

1414
strategy:
1515
matrix:
16-
python-version: ["3.9"]
16+
python-version: ["3.10"]
1717

1818
steps:
1919
- uses: actions/checkout@v2
20-
- uses: actions/cache@v1
20+
- uses: actions/cache@v2
2121
with:
2222
path: ~/.cache/pip
23-
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
23+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
2424
restore-keys: |
2525
${{ runner.os }}-pip-
2626
- uses: actions/setup-python@v2

.hgignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

.readthedocs.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# .readthedocs.yml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
version: 2
6+
7+
sphinx:
8+
builder: dirhtml
9+
configuration: conf.py
10+
11+
formats: all
12+
13+
build:
14+
os: ubuntu-20.04
15+
tools:
16+
python: "3.10"
17+
18+
python:
19+
install:
20+
- requirements: requirements.txt

c-api.rst

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,44 @@ No changes that break the Stable ABI are allowed.
101101
The Limited API should be defined in ``Include/``, excluding the
102102
``cpython`` and ``internal`` subdirectories.
103103

104-
Guidelines for changing the Limited API
105-
---------------------------------------
104+
105+
Guidelines for changing the Limited API, and removing items from it
106+
-------------------------------------------------------------------
107+
108+
While the *Stable ABI* must not be broken, the existing Limited API can be
109+
changed, and items can be removed from it, if:
110+
111+
- the Backwards Compatibility Policy (:pep:`387`) is followed, and
112+
- the Stable ABI is not broken -- that is, extensions compiled with
113+
Limited API of older versions of Python continue to work on
114+
newer versions of Python.
115+
116+
This is tricky to do and requires careful thought.
117+
Some examples:
118+
119+
- Functions, structs etc. accessed by macros in *any version* of the
120+
Limited API are part of the Stable ABI, even if they are named with
121+
an underscore. They must not be removed and their signature must not change.
122+
(Their implementation may change, though.)
123+
- Structs members cannot be rearranged if they were part of any version of
124+
the Limited API.
125+
- If the Limited API allows users to allocate a struct directly,
126+
its size must not change.
127+
- Exported symbols (functions and data) must continue to be available
128+
as exported symbols. Specifically, a function can only be converted
129+
to a ``static inline`` function (or macro) if Python also continues to
130+
provide the actual function.
131+
For an example, see the ``Py_NewRef`` `macro`_ and `redefinition`_ in 3.10.
132+
133+
.. _macro: https://github.com/python/cpython/blob/v3.10.1/Include/object.h#L591-L595
134+
.. _redefinition: https://github.com/python/cpython/blob/v3.10.1/Objects/object.c#L2298-L2308
135+
136+
It is possible to remove items marked as part of the Stable ABI, but only
137+
if there was no way to use them in any past version of the Limited API.
138+
139+
140+
Guidelines for adding to the Limited API
141+
----------------------------------------
106142

107143
- Guidelines for the general :ref:`public-capi` apply.
108144

compiler.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,11 @@ manually -- ``generic``, ``identifier`` and ``int``. These types are found in
244244
for creating ``asdl_xx_seq *`` types are as follows:
245245

246246
``_Py_asdl_generic_seq_new(Py_ssize_t, PyArena *)``
247-
Allocate memory for an ``asdl_int_seq`` of the specified length
247+
Allocate memory for an ``asdl_generic_seq`` of the specified length
248248
``_Py_asdl_identifier_seq_new(Py_ssize_t, PyArena *)``
249249
Allocate memory for an ``asdl_identifier_seq`` of the specified length
250250
``_Py_asdl_int_seq_new(Py_ssize_t, PyArena *)``
251-
Allocate memory for an ``asdl_generic_seq`` of the specified length
251+
Allocate memory for an ``asdl_int_seq`` of the specified length
252252

253253
In addition to the three types mentioned above, some ASDL sequence types are
254254
automatically generated by :file:`Parser/asdl_c.py` and found in

coredev.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,20 @@ The steps to gaining commit privileges are:
7878
email you asking for:
7979

8080
- Account details as required by
81-
https://github.com/python/voters/
81+
🔒 https://github.com/python/voters/
8282
- Your preferred email address to
8383
subscribe to python-committers with
8484
- A reminder about the `Code of Conduct`_ and to report issues to the PSF
8585
Conduct WG
8686

8787
6. Once you have provided the pertinent details, your various new privileges
8888
will be turned on
89-
7. Your details will be added to https://github.com/python/voters/
89+
7. Your details will be added to 🔒 https://github.com/python/voters/
9090
8. They will update the devguide to publicly list your team membership at
9191
:ref:`developers`
9292
9. An announcement email by the steering council member handling your new
9393
membership will be sent to python-committers
94-
94+
9595
.. _Code of Conduct: https://www.python.org/psf/conduct/
9696

9797

devcycle.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ For reference, here are the Python versions that most recently reached their end
131131
+------------------+--------------+----------------+----------------+----------------------------------+
132132
| Branch | Schedule | First release | End-of-life | Release manager |
133133
+==================+==============+================+================+==================================+
134+
| 3.6 | :pep:`494` | 2016-12-23 | 2021-12-23 | Ned Deily |
135+
+------------------+--------------+----------------+----------------+----------------------------------+
134136
| 3.5 | :pep:`478` | 2015-09-13 | 2020-09-30 | Larry Hastings |
135137
+------------------+--------------+----------------+----------------+----------------------------------+
136138
| 3.4 | :pep:`429` | 2014-03-16 | 2019-03-18 | Larry Hastings |
@@ -283,8 +285,6 @@ Current Owners
283285
+----------------------+--------------------------------+-----------------+
284286
| Donald Stufft | Infrastructure Staff | dstufft |
285287
+----------------------+--------------------------------+-----------------+
286-
| Ewa Jodlowska | PSF Executive Director | ejodlowska |
287-
+----------------------+--------------------------------+-----------------+
288288
| Ee Durbin | PSF Director of Infrastructure | ewdurbin |
289289
+----------------------+--------------------------------+-----------------+
290290
| Van Lindberg | PSF General Counsel | VanL |
@@ -329,7 +329,7 @@ Current Administrators
329329
+-------------------+----------------------------------------------------------+-----------------+
330330
| Ned Deily | Python 3.6 and 3.7 Release Manager | ned-deily |
331331
+-------------------+----------------------------------------------------------+-----------------+
332-
| Lary Hastings | Retired Release Manager (for Python 3.4 and 3.5) | larryhastings |
332+
| Larry Hastings | Retired Release Manager (for Python 3.4 and 3.5) | larryhastings |
333333
+-------------------+----------------------------------------------------------+-----------------+
334334
| Berker Peksag | Maintainer of bpo-linkify and cpython-emailer-webhook | berkerpeksag |
335335
+-------------------+----------------------------------------------------------+-----------------+

docquality.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ and validates that your new markup is correct.
3232

3333
You can view the documentation built from :ref:`in-development <indevbranch>`
3434
and :ref:`maintenance <maintbranch>` branches at https://docs.python.org/dev/.
35-
The in-development and most recent 3.x (as well as 2.x) maintenance
36-
branches are rebuilt once per day.
35+
The in-development and recent maintenance branches are rebuilt once per day.
3736

3837
If you would like to be more involved with documentation, consider subscribing
3938
to the `[email protected] <https://mail.python.org/mailman/listinfo/docs>`_

experts.rst

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ The existence of this list is not meant to indicate that these people
3737
by non-committers to find responsible parties, and by committers who do
3838
not feel qualified to make a decision in a particular context.
3939

40-
See also :PEP:`291` and :PEP:`360` for information about certain modules
41-
with special rules.
42-
4340

4441
Stdlib
4542
------
@@ -50,7 +47,7 @@ __future__
5047
__main__ gvanrossum, ncoghlan
5148
_dummy_thread brett.cannon
5249
_thread
53-
_testbuffer
50+
_testbuffer
5451
abc
5552
aifc r.david.murray
5653
argparse rhettinger*
@@ -141,7 +138,7 @@ itertools rhettinger*
141138
json bob.ippolito (inactive), ezio.melotti, rhettinger
142139
keyword
143140
lib2to3 benjamin.peterson
144-
libmpdec
141+
libmpdec
145142
linecache
146143
locale lemburg
147144
logging vinay.sajip
@@ -187,7 +184,7 @@ pydoc
187184
queue rhettinger*
188185
quopri
189186
random rhettinger, mark.dickinson
190-
re effbot (inactive), ezio.melotti, serhiy.storchaka
187+
re ezio.melotti, serhiy.storchaka
191188
readline twouters
192189
reprlib
193190
resource twouters
@@ -254,13 +251,13 @@ wave
254251
weakref fdrake
255252
webbrowser
256253
winreg stutzbach
257-
winsound effbot (inactive)
254+
winsound
258255
wsgiref pje
259256
xdrlib
260257
xml.dom
261258
xml.dom.minidom
262259
xml.dom.pulldom
263-
xml.etree effbot (inactive), eli.bendersky*, scoder
260+
xml.etree eli.bendersky*, scoder
264261
xml.parsers.expat
265262
xml.sax
266263
xml.sax.handler
@@ -310,12 +307,12 @@ Interest Area Maintainers
310307
================== ==========================================================
311308
algorithms rhettinger*
312309
argument clinic larry
313-
ast/compiler benjamin.peterson, brett.cannon, yselivanov, pablogsal, Mark.Shannon, BTaskaya
310+
ast/compiler benjamin.peterson, brett.cannon, yselivanov, pablogsal, Mark.Shannon, BTaskaya, brandtbucher
314311
autoconf/makefiles twouters*
315312
bsd
316313
bug tracker ezio.melotti
317314
buildbots zach.ware, pablogsal
318-
bytecode benjamin.peterson, yselivanov, Mark.Shannon
315+
bytecode benjamin.peterson, yselivanov, Mark.Shannon, brandtbucher
319316
context managers ncoghlan
320317
core workflow mariatta
321318
coverity scan christian.heimes, brett.cannon, twouters
@@ -335,13 +332,13 @@ io benjamin.peterson, stutzbach
335332
locale lemburg
336333
mathematics mark.dickinson, lemburg, stutzbach, rhettinger
337334
memory management tim.peters, lemburg, twouters
338-
memoryview
335+
memoryview
339336
networking giampaolo.rodola,
340337
object model benjamin.peterson, twouters
341338
packaging tarek, lemburg, alexis, eric.araujo, dstufft, paul.moore
342339
pattern matching brandtbucher*
343340
peg parser gvanrossum, pablogsal, lys.nikolaou
344-
performance brett.cannon, vstinner, serhiy.storchaka, yselivanov, rhettinger, Mark.Shannon
341+
performance brett.cannon, vstinner, serhiy.storchaka, yselivanov, rhettinger, Mark.Shannon, brandtbucher
345342
pip ncoghlan, dstufft, paul.moore, Marcus.Smith, pradyunsg
346343
py3 transition benjamin.peterson
347344
release management tarek, lemburg, benjamin.peterson, barry,

gitbootcamp.rst

Lines changed: 47 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,32 @@ Commit the files:
240240
241241
git commit -m "<message>"
242242
243+
.. _diff-changes:
244+
245+
Comparing Changes
246+
-----------------
247+
248+
View all non-commited changes::
249+
250+
git diff
251+
252+
Compare to the ``main`` branch::
253+
254+
git diff main
255+
256+
Exclude generated files from diff using an ``attr``
257+
`pathspec <https://git-scm.com/docs/gitglossary#def_pathspec>`_ (note the
258+
single quotes)::
259+
260+
git diff main ':(attr:!generated)'
261+
262+
Exclude generated files from diff by default::
263+
264+
git config diff.generated.binary true
265+
266+
The ``generated`` `attribute <https://git-scm.com/docs/gitattributes>`_ is
267+
defined in :file:`.gitattributes`, found in the repository root.
268+
243269
.. _push-changes:
244270

245271
Pushing Changes
@@ -318,30 +344,30 @@ When it happens, you need to resolve conflict. See these articles about resolvi
318344
- `About merge conflicts <https://help.github.com/en/articles/about-merge-conflicts>`_
319345
- `Resolving a merge conflict using the command line <https://help.github.com/en/articles/resolving-a-merge-conflict-using-the-command-line>`_
320346

321-
.. _git_from_mercurial:
347+
.. _git_from_patch:
322348

323-
Applying a Patch from Mercurial to Git
324-
--------------------------------------
349+
Applying a Patch to Git
350+
-----------------------
325351

326352
Scenario:
327353

328-
- A Mercurial patch exists but there is no pull request for it.
354+
- A patch exists but there is no pull request for it.
329355

330356
Solution:
331357

332358
1. Download the patch locally.
333359

334360
2. Apply the patch::
335361

336-
git apply /path/to/issueNNNN-git.patch
362+
git apply /path/to/patch.diff
337363

338364
If there are errors, update to a revision from when the patch was
339365
created and then try the ``git apply`` again:
340366

341367
.. code-block:: bash
342368

343369
git checkout $(git rev-list -n 1 --before="yyyy-mm-dd hh:mm:ss" main)
344-
git apply /path/to/issueNNNN-git.patch
370+
git apply /path/to/patch.diff
345371

346372
If the patch still won't apply, then a patch tool will not be able to
347373
apply the patch and it will need to be re-implemented manually.
@@ -356,6 +382,9 @@ Solution:
356382
git rebase main
357383
git mergetool
358384

385+
For very old changes, ``git merge --no-ff`` may be easier than a rebase,
386+
with regards to resolving conflicts.
387+
359388
6. Push the changes and open a pull request.
360389

361390
.. _git_pr:
@@ -368,7 +397,18 @@ Scenario:
368397
- A contributor made a pull request to CPython.
369398
- Before merging it, you want to be able to test their changes locally.
370399

371-
On Unix and MacOS, set up the following git alias::
400+
If you've got `GitHub CLI <https://cli.github.com>`_ or
401+
`hub <https://hub.github.com>`_ installed, you can simply do::
402+
403+
$ gh pr checkout <pr_number> # GitHub CLI
404+
$ hub pr checkout <pr_number> # hub
405+
406+
Both of these tools will configure a remote URL for the branch, so you can
407+
``git push`` if the pull request author checked "Allow edits from maintainers"
408+
when creating the pull request.
409+
410+
If you don't have GitHub CLI or hub installed, you can set up a git alias. On
411+
Unix and macOS::
372412

373413
$ git config --global alias.pr '!sh -c "git fetch upstream pull/${1}/head:pr_${1} && git checkout pr_${1}" -'
374414

@@ -383,15 +423,6 @@ local copy of a pull request as follows::
383423

384424
git pr <pr_number>
385425

386-
.. note::
387-
388-
`hub <https://github.com/github/hub>`_ command line utility makes this
389-
workflow very easy. You can check out the branch by
390-
``hub pr checkout <pr_number> [<branch_name>]``.
391-
This command configures remote URL for the branch too.
392-
So you can ``git push`` if the pull request author checked
393-
"Allow edits from maintainers" when creating the pull request.
394-
395426
.. _accepting-and-merging-a-pr:
396427

397428
Accepting and Merging a Pull Request

0 commit comments

Comments
 (0)