Skip to content

Commit 6c98380

Browse files
committed
Temp merge commit to test check-warnings workflow
2 parents 7a6eef9 + 4cb0818 commit 6c98380

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+627
-683
lines changed
+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Add issue header
2+
# Automatically edits an issue's descriptions with a header,
3+
# one of:
4+
#
5+
# - Bug report
6+
# - Crash report
7+
# - Feature or enhancement
8+
9+
on:
10+
issues:
11+
types:
12+
# Only ever run once
13+
- opened
14+
15+
16+
jobs:
17+
add-header:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
issues: write
21+
steps:
22+
- uses: actions/github-script@v6
23+
with:
24+
# language=JavaScript
25+
script: |
26+
// https://devguide.python.org/triage/labels/#type-labels
27+
const HEADERS = new Map([
28+
['type-bug', 'Bug report'],
29+
['type-crash', 'Crash report'],
30+
['type-feature', 'Feature or enhancement'],
31+
]);
32+
let issue_data = await github.rest.issues.get({
33+
issue_number: context.issue.number,
34+
owner: context.repo.owner,
35+
repo: context.repo.repo
36+
}).then(issue => issue.data);
37+
let header = '';
38+
for (const label_data of issue_data.labels) {
39+
const label_name = (typeof label_data === 'string') ? label_data : label_data.name;
40+
if (HEADERS.has(label_name)) {
41+
header = HEADERS.get(label_name);
42+
break;
43+
}
44+
}
45+
if (header !== '') {
46+
console.log(`Setting new header: ${header}`);
47+
await github.rest.issues.update({
48+
issue_number: context.issue.number,
49+
owner: context.repo.owner,
50+
repo: context.repo.repo,
51+
body: `# ${header}\n\n${issue_data.body.replaceAll('\r', '')}`
52+
});
53+
}

Doc/c-api/typeobj.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1697,7 +1697,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
16971697
to a pointer, are valid C99 address constants.
16981698

16991699
However, the unary '&' operator applied to a non-static variable
1700-
like :c:func:`PyBaseObject_Type` is not required to produce an address
1700+
like :c:data:`PyBaseObject_Type` is not required to produce an address
17011701
constant. Compilers may support this (gcc does), MSVC does not.
17021702
Both compilers are strictly standard conforming in this particular
17031703
behavior.

Doc/conf.py

+71-2
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,77 @@
157157
('envvar', 'USER'),
158158
('envvar', 'USERNAME'),
159159
('envvar', 'USERPROFILE'),
160+
]
161+
162+
# Temporary undocumented names.
163+
# In future this list must be empty.
164+
nitpick_ignore += [
165+
# C API: Standard Python exception classes
166+
('c:data', 'PyExc_ArithmeticError'),
167+
('c:data', 'PyExc_AssertionError'),
168+
('c:data', 'PyExc_AttributeError'),
169+
('c:data', 'PyExc_BaseException'),
170+
('c:data', 'PyExc_BlockingIOError'),
171+
('c:data', 'PyExc_BrokenPipeError'),
172+
('c:data', 'PyExc_BufferError'),
173+
('c:data', 'PyExc_ChildProcessError'),
174+
('c:data', 'PyExc_ConnectionAbortedError'),
175+
('c:data', 'PyExc_ConnectionError'),
176+
('c:data', 'PyExc_ConnectionRefusedError'),
177+
('c:data', 'PyExc_ConnectionResetError'),
178+
('c:data', 'PyExc_EOFError'),
179+
('c:data', 'PyExc_Exception'),
180+
('c:data', 'PyExc_FileExistsError'),
181+
('c:data', 'PyExc_FileNotFoundError'),
182+
('c:data', 'PyExc_FloatingPointError'),
183+
('c:data', 'PyExc_GeneratorExit'),
184+
('c:data', 'PyExc_ImportError'),
185+
('c:data', 'PyExc_IndentationError'),
186+
('c:data', 'PyExc_IndexError'),
187+
('c:data', 'PyExc_InterruptedError'),
188+
('c:data', 'PyExc_IsADirectoryError'),
189+
('c:data', 'PyExc_KeyboardInterrupt'),
190+
('c:data', 'PyExc_KeyError'),
191+
('c:data', 'PyExc_LookupError'),
192+
('c:data', 'PyExc_MemoryError'),
193+
('c:data', 'PyExc_ModuleNotFoundError'),
194+
('c:data', 'PyExc_NameError'),
195+
('c:data', 'PyExc_NotADirectoryError'),
196+
('c:data', 'PyExc_NotImplementedError'),
197+
('c:data', 'PyExc_OSError'),
198+
('c:data', 'PyExc_OverflowError'),
199+
('c:data', 'PyExc_PermissionError'),
200+
('c:data', 'PyExc_ProcessLookupError'),
201+
('c:data', 'PyExc_RecursionError'),
202+
('c:data', 'PyExc_ReferenceError'),
203+
('c:data', 'PyExc_RuntimeError'),
204+
('c:data', 'PyExc_StopAsyncIteration'),
205+
('c:data', 'PyExc_StopIteration'),
206+
('c:data', 'PyExc_SyntaxError'),
207+
('c:data', 'PyExc_SystemError'),
208+
('c:data', 'PyExc_SystemExit'),
209+
('c:data', 'PyExc_TabError'),
210+
('c:data', 'PyExc_TimeoutError'),
211+
('c:data', 'PyExc_TypeError'),
212+
('c:data', 'PyExc_UnboundLocalError'),
213+
('c:data', 'PyExc_UnicodeDecodeError'),
214+
('c:data', 'PyExc_UnicodeEncodeError'),
215+
('c:data', 'PyExc_UnicodeError'),
216+
('c:data', 'PyExc_UnicodeTranslateError'),
217+
('c:data', 'PyExc_ValueError'),
218+
('c:data', 'PyExc_ZeroDivisionError'),
219+
# C API: Standard Python warning classes
220+
('c:data', 'PyExc_BytesWarning'),
221+
('c:data', 'PyExc_DeprecationWarning'),
222+
('c:data', 'PyExc_FutureWarning'),
223+
('c:data', 'PyExc_ImportWarning'),
224+
('c:data', 'PyExc_PendingDeprecationWarning'),
225+
('c:data', 'PyExc_ResourceWarning'),
226+
('c:data', 'PyExc_RuntimeWarning'),
227+
('c:data', 'PyExc_SyntaxWarning'),
228+
('c:data', 'PyExc_UnicodeWarning'),
229+
('c:data', 'PyExc_UserWarning'),
230+
('c:data', 'PyExc_Warning'),
160231
# Do not error nit-picky mode builds when _SubParsersAction.add_parser cannot
161232
# be resolved, as the method is currently undocumented. For context, see
162233
# https://github.com/python/cpython/pull/103289.
@@ -283,8 +354,6 @@
283354
latex_documents = [
284355
('c-api/index', 'c-api.tex',
285356
'The Python/C API', _stdauthor, 'manual'),
286-
('distributing/index', 'distributing.tex',
287-
'Distributing Python Modules', _stdauthor, 'manual'),
288357
('extending/index', 'extending.tex',
289358
'Extending and Embedding Python', _stdauthor, 'manual'),
290359
('installing/index', 'installing.tex',

Doc/contents.rst

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
library/index.rst
1212
extending/index.rst
1313
c-api/index.rst
14-
distributing/index.rst
1514
installing/index.rst
1615
howto/index.rst
1716
faq/index.rst

Doc/distributing/index.rst

+10-165
Original file line numberDiff line numberDiff line change
@@ -1,174 +1,19 @@
1+
:orphan:
2+
3+
.. This page is retained solely for existing links to /distributing/index.html.
4+
Direct readers to the PPUG instead.
5+
16
.. _distributing-index:
27

38
###############################
49
Distributing Python Modules
510
###############################
611

7-
8-
9-
10-
As a popular open source development project, Python has an active
11-
supporting community of contributors and users that also make their software
12-
available for other Python developers to use under open source license terms.
13-
14-
This allows Python users to share and collaborate effectively, benefiting
15-
from the solutions others have already created to common (and sometimes
16-
even rare!) problems, as well as potentially contributing their own
17-
solutions to the common pool.
18-
19-
This guide covers the distribution part of the process. For a guide to
20-
installing other Python projects, refer to the
21-
:ref:`installation guide <installing-index>`.
22-
2312
.. note::
2413

25-
For corporate and other institutional users, be aware that many
26-
organisations have their own policies around using and contributing to
27-
open source software. Please take such policies into account when making
28-
use of the distribution and installation tools provided with Python.
29-
30-
31-
Key terms
32-
=========
33-
34-
* the `Python Package Index <https://pypi.org>`__ is a public
35-
repository of open source licensed packages made available for use by
36-
other Python users
37-
* the `Python Packaging Authority
38-
<https://www.pypa.io/>`__ are the group of
39-
developers and documentation authors responsible for the maintenance and
40-
evolution of the standard packaging tools and the associated metadata and
41-
file format standards. They maintain a variety of tools, documentation
42-
and issue trackers on `GitHub <https://github.com/pypa>`__.
43-
* ``distutils`` is the original build and distribution system first added
44-
to the Python standard library in 1998. While direct use of ``distutils``
45-
is being phased out, it still laid the foundation for the current packaging
46-
and distribution infrastructure, and it not only remains part of the
47-
standard library, but its name lives on in other ways (such as the name
48-
of the mailing list used to coordinate Python packaging standards
49-
development).
50-
* `setuptools`_ is a (largely) drop-in replacement for ``distutils`` first
51-
published in 2004. Its most notable addition over the unmodified
52-
``distutils`` tools was the ability to declare dependencies on other
53-
packages. It is currently recommended as a more regularly updated
54-
alternative to ``distutils`` that offers consistent support for more
55-
recent packaging standards across a wide range of Python versions.
56-
* `wheel`_ (in this context) is a project that adds the ``bdist_wheel``
57-
command to ``distutils``/`setuptools`_. This produces a cross platform
58-
binary packaging format (called "wheels" or "wheel files" and defined in
59-
:pep:`427`) that allows Python libraries, even those including binary
60-
extensions, to be installed on a system without needing to be built
61-
locally.
62-
63-
.. _setuptools: https://setuptools.readthedocs.io/en/latest/
64-
.. _wheel: https://wheel.readthedocs.io/
65-
66-
Open source licensing and collaboration
67-
=======================================
68-
69-
In most parts of the world, software is automatically covered by copyright.
70-
This means that other developers require explicit permission to copy, use,
71-
modify and redistribute the software.
72-
73-
Open source licensing is a way of explicitly granting such permission in a
74-
relatively consistent way, allowing developers to share and collaborate
75-
efficiently by making common solutions to various problems freely available.
76-
This leaves many developers free to spend more time focusing on the problems
77-
that are relatively unique to their specific situation.
78-
79-
The distribution tools provided with Python are designed to make it
80-
reasonably straightforward for developers to make their own contributions
81-
back to that common pool of software if they choose to do so.
82-
83-
The same distribution tools can also be used to distribute software within
84-
an organisation, regardless of whether that software is published as open
85-
source software or not.
86-
87-
88-
Installing the tools
89-
====================
90-
91-
The standard library does not include build tools that support modern
92-
Python packaging standards, as the core development team has found that it
93-
is important to have standard tools that work consistently, even on older
94-
versions of Python.
95-
96-
The currently recommended build and distribution tools can be installed
97-
by invoking the ``pip`` module at the command line::
98-
99-
python -m pip install setuptools wheel twine
100-
101-
.. note::
102-
103-
For POSIX users (including macOS and Linux users), these instructions
104-
assume the use of a :term:`virtual environment`.
105-
106-
For Windows users, these instructions assume that the option to
107-
adjust the system PATH environment variable was selected when installing
108-
Python.
109-
110-
The Python Packaging User Guide includes more details on the `currently
111-
recommended tools`_.
112-
113-
.. _currently recommended tools: https://packaging.python.org/guides/tool-recommendations/#packaging-tool-recommendations
114-
115-
.. index::
116-
single: Python Package Index (PyPI)
117-
single: PyPI; (see Python Package Index (PyPI))
118-
119-
.. _publishing-python-packages:
120-
121-
Reading the Python Packaging User Guide
122-
=======================================
123-
124-
The Python Packaging User Guide covers the various key steps and elements
125-
involved in creating and publishing a project:
126-
127-
* `Project structure`_
128-
* `Building and packaging the project`_
129-
* `Uploading the project to the Python Package Index`_
130-
* `The .pypirc file`_
131-
132-
.. _Project structure: https://packaging.python.org/tutorials/packaging-projects/#packaging-python-projects
133-
.. _Building and packaging the project: https://packaging.python.org/tutorials/packaging-projects/#creating-the-package-files
134-
.. _Uploading the project to the Python Package Index: https://packaging.python.org/tutorials/packaging-projects/#uploading-the-distribution-archives
135-
.. _The .pypirc file: https://packaging.python.org/specifications/pypirc/
136-
137-
138-
How do I...?
139-
============
140-
141-
These are quick answers or links for some common tasks.
142-
143-
... choose a name for my project?
144-
---------------------------------
145-
146-
This isn't an easy topic, but here are a few tips:
147-
148-
* check the Python Package Index to see if the name is already in use
149-
* check popular hosting sites like GitHub, Bitbucket, etc to see if there
150-
is already a project with that name
151-
* check what comes up in a web search for the name you're considering
152-
* avoid particularly common words, especially ones with multiple meanings,
153-
as they can make it difficult for users to find your software when
154-
searching for it
155-
156-
157-
... create and distribute binary extensions?
158-
--------------------------------------------
159-
160-
This is actually quite a complex topic, with a variety of alternatives
161-
available depending on exactly what you're aiming to achieve. See the
162-
Python Packaging User Guide for more information and recommendations.
163-
164-
.. seealso::
165-
166-
`Python Packaging User Guide: Binary Extensions
167-
<https://packaging.python.org/guides/packaging-binary-extensions/>`__
168-
169-
.. other topics:
14+
Information and guidance on distributing Python modules and packages
15+
has been moved to the `Python Packaging User Guide`_,
16+
and the tutorial on `packaging Python projects`_.
17017

171-
Once the Development & Deployment part of PPUG is fleshed out, some of
172-
those sections should be linked from new questions here (most notably,
173-
we should have a question about avoiding depending on PyPI that links to
174-
https://packaging.python.org/en/latest/mirrors/)
18+
.. _Python Packaging User Guide: https://packaging.python.org/
19+
.. _packaging Python projects: https://packaging.python.org/en/latest/tutorials/packaging-projects/

Doc/extending/extending.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ needed to ensure that it will not be discarded, causing :c:data:`!SpamError` to
242242
become a dangling pointer. Should it become a dangling pointer, C code which
243243
raises the exception could cause a core dump or other unintended side effects.
244244

245-
We discuss the use of ``PyMODINIT_FUNC`` as a function return type later in this
245+
We discuss the use of :c:macro:`PyMODINIT_FUNC` as a function return type later in this
246246
sample.
247247

248248
The :exc:`!spam.error` exception can be raised in your extension module using a
@@ -363,7 +363,7 @@ only non-\ ``static`` item defined in the module file::
363363
return PyModule_Create(&spammodule);
364364
}
365365

366-
Note that PyMODINIT_FUNC declares the function as ``PyObject *`` return type,
366+
Note that :c:macro:`PyMODINIT_FUNC` declares the function as ``PyObject *`` return type,
367367
declares any special linkage declarations required by the platform, and for C++
368368
declares the function as ``extern "C"``.
369369

Doc/installing/index.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ solutions to the common pool.
1919

2020
This guide covers the installation part of the process. For a guide to
2121
creating and sharing your own Python projects, refer to the
22-
:ref:`distribution guide <distributing-index>`.
22+
`Python packaging user guide`_.
23+
24+
.. _Python Packaging User Guide: https://packaging.python.org/en/latest/tutorials/packaging-projects/
2325

2426
.. note::
2527

0 commit comments

Comments
 (0)