diff options
author | Victor Stinner <vstinner@python.org> | 2023-08-31 21:42:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-31 21:42:34 (GMT) |
commit | ad73674283978a8bf8f1983bfd69150e60e6225f (patch) | |
tree | fa2e42b2a4cdfb24e5459194930db6b490e1eba8 /Modules/_sqlite | |
parent | 2bd960b57944107fbfbd8ff005b4223e1ea6555f (diff) | |
download | cpython-ad73674283978a8bf8f1983bfd69150e60e6225f.zip cpython-ad73674283978a8bf8f1983bfd69150e60e6225f.tar.gz cpython-ad73674283978a8bf8f1983bfd69150e60e6225f.tar.bz2 |
gh-107603: Argument Clinic: Only include pycore_gc.h if needed (#108726)
Argument Clinic now only includes pycore_gc.h if PyGC_Head is needed,
and only includes pycore_runtime.h if _Py_ID() is needed.
* Add 'condition' optional argument to Clinic.add_include().
* deprecate_keyword_use() includes pycore_runtime.h when using
the _PyID() function.
* Fix rendering of includes: comments start at the column 35.
* Mark PC/clinic/_wmimodule.cpp.h and
"Objects/stringlib/clinic/*.h.h" header files as generated in
.gitattributes.
Effects:
* 42 header files generated by AC no longer include the internal C
API, instead of 4 header files before. For example,
Modules/clinic/_abc.c.h no longer includes the internal C API.
* Fix _testclinic_depr.c.h: it now always includes pycore_runtime.h
to get _Py_ID().
Diffstat (limited to 'Modules/_sqlite')
-rw-r--r-- | Modules/_sqlite/clinic/_sqlite3.connect.c.h | 7 | ||||
-rw-r--r-- | Modules/_sqlite/clinic/blob.c.h | 8 | ||||
-rw-r--r-- | Modules/_sqlite/clinic/connection.c.h | 7 | ||||
-rw-r--r-- | Modules/_sqlite/clinic/cursor.c.h | 7 | ||||
-rw-r--r-- | Modules/_sqlite/clinic/module.c.h | 7 | ||||
-rw-r--r-- | Modules/_sqlite/clinic/row.c.h | 8 |
6 files changed, 14 insertions, 30 deletions
diff --git a/Modules/_sqlite/clinic/_sqlite3.connect.c.h b/Modules/_sqlite/clinic/_sqlite3.connect.c.h index 998c8de..eceb5a7 100644 --- a/Modules/_sqlite/clinic/_sqlite3.connect.c.h +++ b/Modules/_sqlite/clinic/_sqlite3.connect.c.h @@ -3,11 +3,10 @@ preserve [clinic start generated code]*/ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() +# include "pycore_gc.h" // PyGC_Head +# include "pycore_runtime.h" // _Py_ID() #endif - PyDoc_STRVAR(pysqlite_connect__doc__, "connect($module, /, database, timeout=5.0, detect_types=0,\n" " isolation_level=\'\', check_same_thread=True,\n" @@ -28,4 +27,4 @@ PyDoc_STRVAR(pysqlite_connect__doc__, #define PYSQLITE_CONNECT_METHODDEF \ {"connect", _PyCFunction_CAST(pysqlite_connect), METH_FASTCALL|METH_KEYWORDS, pysqlite_connect__doc__}, -/*[clinic end generated code: output=8d49736db880f09a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=03bd99542e3aec9d input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/blob.c.h b/Modules/_sqlite/clinic/blob.c.h index 7dda4d7..e7c6026 100644 --- a/Modules/_sqlite/clinic/blob.c.h +++ b/Modules/_sqlite/clinic/blob.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - PyDoc_STRVAR(blob_close__doc__, "close($self, /)\n" "--\n" @@ -219,4 +213,4 @@ blob_exit(pysqlite_Blob *self, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=1783b816ccc3bb75 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=8bfd79ab12ac5385 input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/connection.c.h b/Modules/_sqlite/clinic/connection.c.h index f9510f4..fcc6577 100644 --- a/Modules/_sqlite/clinic/connection.c.h +++ b/Modules/_sqlite/clinic/connection.c.h @@ -3,11 +3,10 @@ preserve [clinic start generated code]*/ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() +# include "pycore_gc.h" // PyGC_Head +# include "pycore_runtime.h" // _Py_ID() #endif - static int pysqlite_connection_init_impl(pysqlite_Connection *self, PyObject *database, double timeout, int detect_types, @@ -1822,4 +1821,4 @@ exit: #ifndef DESERIALIZE_METHODDEF #define DESERIALIZE_METHODDEF #endif /* !defined(DESERIALIZE_METHODDEF) */ -/*[clinic end generated code: output=f06b254bc5c2bcaf input=a9049054013a1b77]*/ +/*[clinic end generated code: output=166bf41ad5ca1655 input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/cursor.c.h b/Modules/_sqlite/clinic/cursor.c.h index 1a21a1c..3cb637b 100644 --- a/Modules/_sqlite/clinic/cursor.c.h +++ b/Modules/_sqlite/clinic/cursor.c.h @@ -3,11 +3,10 @@ preserve [clinic start generated code]*/ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() +# include "pycore_gc.h" // PyGC_Head +# include "pycore_runtime.h" // _Py_ID() #endif - static int pysqlite_cursor_init_impl(pysqlite_Cursor *self, pysqlite_Connection *connection); @@ -313,4 +312,4 @@ pysqlite_cursor_close(pysqlite_Cursor *self, PyObject *Py_UNUSED(ignored)) { return pysqlite_cursor_close_impl(self); } -/*[clinic end generated code: output=b56b3ddb3b6df8c6 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0c52a9cf54d00543 input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/module.c.h b/Modules/_sqlite/clinic/module.c.h index 82e628a..49ba7a3 100644 --- a/Modules/_sqlite/clinic/module.c.h +++ b/Modules/_sqlite/clinic/module.c.h @@ -3,11 +3,10 @@ preserve [clinic start generated code]*/ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() +# include "pycore_gc.h" // PyGC_Head +# include "pycore_runtime.h" // _Py_ID() #endif - PyDoc_STRVAR(pysqlite_complete_statement__doc__, "complete_statement($module, /, statement)\n" "--\n" @@ -208,4 +207,4 @@ skip_optional: exit: return return_value; } -/*[clinic end generated code: output=c1d450089867b4bf input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a14893a7c2eead5e input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/clinic/row.c.h b/Modules/_sqlite/clinic/row.c.h index 89a48fd..cdf850d 100644 --- a/Modules/_sqlite/clinic/row.c.h +++ b/Modules/_sqlite/clinic/row.c.h @@ -2,12 +2,6 @@ preserve [clinic start generated code]*/ -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -# include "pycore_gc.h" // PyGC_Head -# include "pycore_runtime.h" // _Py_ID() -#endif - - static PyObject * pysqlite_row_new_impl(PyTypeObject *type, pysqlite_Cursor *cursor, PyObject *data); @@ -60,4 +54,4 @@ pysqlite_row_keys(pysqlite_Row *self, PyObject *Py_UNUSED(ignored)) { return pysqlite_row_keys_impl(self); } -/*[clinic end generated code: output=157b31ac3f6af1ba input=a9049054013a1b77]*/ +/*[clinic end generated code: output=972487d535d2e7d5 input=a9049054013a1b77]*/ |