Skip to content

Commit

Permalink
Merge branch 'main' into karatsuba-pylong
Browse files Browse the repository at this point in the history
  • Loading branch information
skirpichev authored Oct 20, 2024
2 parents b82dfec + e924bb6 commit 2d55c5a
Show file tree
Hide file tree
Showing 64 changed files with 2,347 additions and 739 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/reusable-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
- name: 'Set up Python'
uses: actions/setup-python@v5
with:
python-version: '3.12' # known to work with Sphinx 6.2.1
python-version: '3.13' # known to work with Sphinx 7.2.6
cache: 'pip'
cache-dependency-path: 'Doc/requirements-oldest-sphinx.txt'
- name: 'Install build dependencies'
Expand Down
2 changes: 1 addition & 1 deletion Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
highlight_language = 'python3'

# Minimum version of sphinx required
needs_sphinx = '6.2.1'
needs_sphinx = '7.2.6'

# Create table of contents entries for domain objects (e.g. functions, classes,
# attributes, etc.). Default is True.
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5579,7 +5579,7 @@ Miscellaneous System Information
If :option:`-X cpu_count <-X>` is given or :envvar:`PYTHON_CPU_COUNT` is set,
:func:`process_cpu_count` returns the overridden value *n*.

See also the :func:`sched_getaffinity` functions.
See also the :func:`sched_getaffinity` function.

.. versionadded:: 3.13

Expand Down
30 changes: 15 additions & 15 deletions Doc/requirements-oldest-sphinx.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@ blurb
python-docs-theme>=2022.1

# Generated from:
# pip install "Sphinx~=6.2.1"
# pip install "Sphinx~=7.2.6"
# pip freeze
#
# Sphinx 6.2.1 comes from ``needs_sphinx = '6.2.1'`` in ``Doc/conf.py``.
# Sphinx 7.2.6 comes from ``needs_sphinx = '7.2.6'`` in ``Doc/conf.py``.

alabaster==0.7.16
Babel==2.15.0
certifi==2024.7.4
charset-normalizer==3.3.2
docutils==0.19
idna==3.7
Babel==2.16.0
certifi==2024.8.30
charset-normalizer==3.4.0
docutils==0.20.1
idna==3.10
imagesize==1.4.1
Jinja2==3.1.4
MarkupSafe==2.1.5
MarkupSafe==3.0.1
packaging==24.1
Pygments==2.18.0
requests==2.32.3
snowballstemmer==2.2.0
Sphinx==6.2.1
sphinxcontrib-applehelp==1.0.8
sphinxcontrib-devhelp==1.0.6
sphinxcontrib-htmlhelp==2.0.5
Sphinx==7.2.6
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.7
sphinxcontrib-serializinghtml==1.1.10
urllib3==2.2.2
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
urllib3==2.2.3
5 changes: 5 additions & 0 deletions Doc/whatsnew/3.14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ argparse
interpreter was instructed to find the ``__main__`` module code.
(Contributed by Serhiy Storchaka and Alyssa Coghlan in :gh:`66436`.)

* Introduced the optional *suggest_on_error* parameter to
:class:`argparse.ArgumentParser`, enabling suggestions for argument choices
and subparser names if mistyped by the user.
(Contributed by Savannah Ostrowski in :gh:`124456`)

ast
---

Expand Down
1 change: 1 addition & 0 deletions Include/Python.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
#include "pylifecycle.h"
#include "ceval.h"
#include "sysmodule.h"
#include "audit.h"
#include "osmodule.h"
#include "intrcheck.h"
#include "import.h"
Expand Down
30 changes: 30 additions & 0 deletions Include/audit.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#ifndef Py_AUDIT_H
#define Py_AUDIT_H
#ifdef __cplusplus
extern "C" {
#endif


#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000
PyAPI_FUNC(int) PySys_Audit(
const char *event,
const char *argFormat,
...);

PyAPI_FUNC(int) PySys_AuditTuple(
const char *event,
PyObject *args);
#endif


#ifndef Py_LIMITED_API
# define Py_CPYTHON_AUDIT_H
# include "cpython/audit.h"
# undef Py_CPYTHON_AUDIT_H
#endif


#ifdef __cplusplus
}
#endif
#endif /* !Py_AUDIT_H */
8 changes: 8 additions & 0 deletions Include/cpython/audit.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef Py_CPYTHON_AUDIT_H
# error "this header file must not be included directly"
#endif


typedef int(*Py_AuditHookFunction)(const char *, PyObject *, void *);

PyAPI_FUNC(int) PySys_AddAuditHook(Py_AuditHookFunction, void*);
18 changes: 18 additions & 0 deletions Include/cpython/ceval.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,21 @@ _PyEval_RequestCodeExtraIndex(freefunc f) {

PyAPI_FUNC(int) _PyEval_SliceIndex(PyObject *, Py_ssize_t *);
PyAPI_FUNC(int) _PyEval_SliceIndexNotNone(PyObject *, Py_ssize_t *);


// Trampoline API

typedef struct {
FILE* perf_map;
PyThread_type_lock map_lock;
} PerfMapState;

PyAPI_FUNC(int) PyUnstable_PerfMapState_Init(void);
PyAPI_FUNC(int) PyUnstable_WritePerfMapEntry(
const void *code_addr,
unsigned int code_size,
const char *entry_name);
PyAPI_FUNC(void) PyUnstable_PerfMapState_Fini(void);
PyAPI_FUNC(int) PyUnstable_CopyPerfMapFile(const char* parent_filename);
PyAPI_FUNC(int) PyUnstable_PerfTrampoline_CompileCode(PyCodeObject *);
PyAPI_FUNC(int) PyUnstable_PerfTrampoline_SetPersistAfterFork(int enable);
22 changes: 0 additions & 22 deletions Include/cpython/sysmodule.h

This file was deleted.

35 changes: 35 additions & 0 deletions Include/internal/pycore_audit.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#ifndef Py_INTERNAL_AUDIT_H
#define Py_INTERNAL_AUDIT_H
#ifdef __cplusplus
extern "C" {
#endif

#ifndef Py_BUILD_CORE
# error "this header requires Py_BUILD_CORE define"
#endif


/* Runtime audit hook state */

typedef struct _Py_AuditHookEntry {
struct _Py_AuditHookEntry *next;
Py_AuditHookFunction hookCFunction;
void *userData;
} _Py_AuditHookEntry;


extern int _PySys_Audit(
PyThreadState *tstate,
const char *event,
const char *argFormat,
...);

// _PySys_ClearAuditHooks() must not be exported: use extern rather than
// PyAPI_FUNC(). We want minimal exposure of this function.
extern void _PySys_ClearAuditHooks(PyThreadState *tstate);


#ifdef __cplusplus
}
#endif
#endif /* !Py_INTERNAL_AUDIT_H */
Loading

0 comments on commit 2d55c5a

Please sign in to comment.