bpo-35134: Move Include/{pyarena.h,pyctype.h} to Include/cpython/ (GH-24550)
Move non-limited C API headers pyarena.h and pyctype.h
into Include/cpython/ directory.
diff --git a/Include/Python.h b/Include/Python.h
index 76ead9e..c71a71f 100644
--- a/Include/Python.h
+++ b/Include/Python.h
@@ -137,7 +137,7 @@
#include "pystate.h"
#include "context.h"
-#include "pyarena.h"
+#include "cpython/pyarena.h"
#include "modsupport.h"
#include "compile.h"
#include "pythonrun.h"
@@ -154,7 +154,7 @@
#include "eval.h"
-#include "pyctype.h"
+#include "cpython/pyctype.h"
#include "pystrtod.h"
#include "pystrcmp.h"
#include "fileutils.h"
diff --git a/Include/pyarena.h b/Include/cpython/pyarena.h
similarity index 100%
rename from Include/pyarena.h
rename to Include/cpython/pyarena.h
diff --git a/Include/pyctype.h b/Include/cpython/pyctype.h
similarity index 100%
rename from Include/pyctype.h
rename to Include/cpython/pyctype.h
diff --git a/Makefile.pre.in b/Makefile.pre.in
index d3ac2da..593da93 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -1057,9 +1057,7 @@
$(srcdir)/Include/osmodule.h \
$(srcdir)/Include/patchlevel.h \
$(srcdir)/Include/picklebufobject.h \
- $(srcdir)/Include/pyarena.h \
$(srcdir)/Include/pycapsule.h \
- $(srcdir)/Include/pyctype.h \
$(srcdir)/Include/pydebug.h \
$(srcdir)/Include/pydtrace.h \
$(srcdir)/Include/pyerrors.h \
@@ -1113,6 +1111,8 @@
$(srcdir)/Include/cpython/methodobject.h \
$(srcdir)/Include/cpython/object.h \
$(srcdir)/Include/cpython/objimpl.h \
+ $(srcdir)/Include/cpython/pyarena.h \
+ $(srcdir)/Include/cpython/pyctype.h \
$(srcdir)/Include/cpython/pyerrors.h \
$(srcdir)/Include/cpython/pylifecycle.h \
$(srcdir)/Include/cpython/pymem.h \
diff --git a/Misc/NEWS.d/next/C API/2021-02-17-18-51-26.bpo-35134.YoQdk8.rst b/Misc/NEWS.d/next/C API/2021-02-17-18-51-26.bpo-35134.YoQdk8.rst
new file mode 100644
index 0000000..c3534fce
--- /dev/null
+++ b/Misc/NEWS.d/next/C API/2021-02-17-18-51-26.bpo-35134.YoQdk8.rst
@@ -0,0 +1,3 @@
+Move pyarena.h, pyctype.h, and pytime.h into the cpython/ directory. They
+must not be included directly, as they are already included by Python.h:
+:ref:`Include Files <api-includes>`.
diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
index 711a68f..89b6218 100644
--- a/PCbuild/pythoncore.vcxproj
+++ b/PCbuild/pythoncore.vcxproj
@@ -142,6 +142,8 @@
<ClInclude Include="..\Include\cpython\methodobject.h" />
<ClInclude Include="..\Include\cpython\object.h" />
<ClInclude Include="..\Include\cpython\objimpl.h" />
+ <ClInclude Include="..\Include\cpython\pyarena.h" />
+ <ClInclude Include="..\Include\cpython\pyctype.h" />
<ClInclude Include="..\Include\cpython\pyerrors.h" />
<ClInclude Include="..\Include\cpython\pylifecycle.h" />
<ClInclude Include="..\Include\cpython\pymem.h" />
@@ -226,9 +228,7 @@
<ClInclude Include="..\Include\parser_interface.h" />
<ClInclude Include="..\Include\picklebufobject.h" />
<ClInclude Include="..\Include\py_curses.h" />
- <ClInclude Include="..\Include\pyarena.h" />
<ClInclude Include="..\Include\pycapsule.h" />
- <ClInclude Include="..\Include\pyctype.h" />
<ClInclude Include="..\Include\pydebug.h" />
<ClInclude Include="..\Include\pyerrors.h" />
<ClInclude Include="..\Include\pyexpat.h" />
diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters
index ab82642..bd8fd34 100644
--- a/PCbuild/pythoncore.vcxproj.filters
+++ b/PCbuild/pythoncore.vcxproj.filters
@@ -177,15 +177,9 @@
<ClInclude Include="..\Include\py_curses.h">
<Filter>Include</Filter>
</ClInclude>
- <ClInclude Include="..\Include\pyarena.h">
- <Filter>Include</Filter>
- </ClInclude>
<ClInclude Include="..\Include\pycapsule.h">
<Filter>Include</Filter>
</ClInclude>
- <ClInclude Include="..\Include\pyctype.h">
- <Filter>Include</Filter>
- </ClInclude>
<ClInclude Include="..\Include\pydebug.h">
<Filter>Include</Filter>
</ClInclude>
@@ -438,6 +432,12 @@
<ClInclude Include="..\Include\cpython\object.h">
<Filter>Include\cpython</Filter>
</ClInclude>
+ <ClInclude Include="..\Include\cpython\pyarena.h">
+ <Filter>Include</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Include\cpython\pyctype.h">
+ <Filter>Include</Filter>
+ </ClInclude>
<ClInclude Include="..\Include\cpython\pyerrors.h">
<Filter>Include\cpython</Filter>
</ClInclude>
diff --git a/Parser/pegen.h b/Parser/pegen.h
index 2a165c1..3765b24 100644
--- a/Parser/pegen.h
+++ b/Parser/pegen.h
@@ -5,7 +5,6 @@
#include <Python.h>
#include <token.h>
#include <Python-ast.h>
-#include <pyarena.h>
#if 0
#define PyPARSE_YIELD_IS_KEYWORD 0x0001
diff --git a/Tools/scripts/stable_abi.py b/Tools/scripts/stable_abi.py
index 117dfeb..44f426e 100755
--- a/Tools/scripts/stable_abi.py
+++ b/Tools/scripts/stable_abi.py
@@ -22,9 +22,7 @@
"genobject.h",
"longintrepr.h",
"parsetok.h",
- "pyarena.h",
"pyatomic.h",
- "pyctype.h",
"pydebug.h",
"pytime.h",
"symtable.h",