[WIP] bpo-35081: _testcapi is now compiled with Py_BUILD_CORE by vstinner · Pull Request #10274 · python/cpython (original) (raw)

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation5 Commits1 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

vstinner

https://bugs.python.org/issue35081

@vstinner

@vstinner

IHMO this PR depends on PR #10238 to properly define datetime.h when compiling with Py_BUILD_CORE.

@serhiy-storchaka

Is not intended to build it without Py_BUILD_CORE for testing the same C API that is available in external extensions?

@vstinner

Is not intended to build it without Py_BUILD_CORE for testing the same C API that is available in external extensions?

Honestly, the exact purpose of _testcapi is now unclear to me :-) This module became giant. Maybe we need a new module to the test the Py_BUILD_CORE API? _testcapi.get_coreconfig() converts PyInterpreterState.core_config to a Python function, from my point of view, this code is not part of the public Python C API.

--

Other options:

@serhiy-storchaka

I'm going to split _testcapi.c onto several parts and move them into the new Modules/_testcapi/ directory (similarly to Modules/_io/). I'm working on adding tests for C API, and this adds too much code in _testcapi.c, so it is practical to add separate files for helpers for testing different parts of C API.

If the only problem is with _Py_wstrlist_as_pylist(), the simplest temporary workaround is to duplicate its declaration in _testcapi.c.

@vstinner

Is not intended to build it without Py_BUILD_CORE for testing the same C API that is available in external extensions?

Right. I abandon this PR and wrote PR #10362 which is the proper fix: it also ensures that _testcapimodule.c is not compiled with Py_BUILD_CORE defined.