GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-41861: Clean up sqlite3 header files wrt. PEP 384 by erlend-aasland · Pull Request #22419 · python/cpython

Conversation

@erlend-aasland

@erlend-aasland erlend-aasland commented Sep 26, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Ref. https://www.python.org/dev/peps/pep-0384/#header-files-and-preprocessor-definitions
Also ref. bpo-2897 (PyMemberDef not part of the stable API)

https://bugs.python.org/issue41861

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@erlend-aasland
erlend-aasland requested a review from berkerpeksag as a code owner September 26, 2020 20:51
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Sep 26, 2020
@bedevere-bot bedevere-bot added the awaiting review label Sep 26, 2020
@corona10 corona10 added the skip news label Sep 27, 2020
@erlend-aasland erlend-aasland mentioned this pull request Oct 1, 2020
bpo-41861: Convert _sqlite3 CursorType and ConnectionType to heap types #22478
Merged
@erlend-aasland

erlend-aasland commented Oct 1, 2020

Copy link
Copy Markdown
Contributor Author

@corona10, would you mind doing a review of this?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland

erlend-aasland commented Oct 5, 2020 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

@vstinner, would you mind taking a look at this. After this cleanup, I think we can close bpo-41861.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner
vstinner reviewed Oct 5, 2020
View reviewed changes
Comment thread Modules/_sqlite/connection.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Erlend E. Aasland added 7 commits October 5, 2020 13:21
Erlend E. Aasland
Don't include pythread.h
9b02d4e
Erlend E. Aasland
Don't include structmember.h twice
d093796
Erlend E. Aasland
Remove superfluous Python.h include
626af39
Erlend E. Aasland
Include structmember.h in the .c file, where it's used
6be86c9
As per review comments.
Erlend E. Aasland
Explicitly include structmember.h in cursor.c
f184612
Erlend E. Aasland
Include structmember.h after Python.h
926e238
Erlend E. Aasland
Fix PyMemberDef in statement.c
b98761c
- Fix incomplete type (PyMemberDef => struct PyMemberDef)
- Include structmember.h bco. PyMemberDef
@erlend-aasland
erlend-aasland force-pushed the fix-bpo-41861/headers branch from c935779 to b98761c Compare October 5, 2020 11:27
@erlend-aasland erlend-aasland changed the title bpo-41861: Clean up sqlite3 header files bpo-41861: Clean up sqlite3 header files wrt. PEP 384 Oct 5, 2020
@erlend-aasland
erlend-aasland requested a review from vstinner October 5, 2020 12:43
@erlend-aasland

erlend-aasland commented Oct 5, 2020

Copy link
Copy Markdown
Contributor Author

Seems like the Travis CI is stuck…

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Oct 6, 2020

Copy link
Copy Markdown
Member

PyMemberDef not part of the stable API

structmember.h is part of the limited C API. If it should not, I suggest to first exclude it from the limited C API, before changing _sqlite3 header files.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland

erlend-aasland commented Oct 6, 2020

Copy link
Copy Markdown
Contributor Author

PyMemberDef not part of the stable API

structmember.h is part of the limited C API. If it should not, I suggest to first exclude it from the limited C API, before changing _sqlite3 header files.

If it was, it would be sufficient to include Python.h, no?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Oct 6, 2020

Copy link
Copy Markdown
Member

I'm not sure why some header files like frameobject.h are not included by Python.h. Not being included by Python.h doesn't mean excluded from the limited C API. Or maybe I misunderstood something.

cc @serhiy-storchaka

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland

erlend-aasland commented Oct 6, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

I'm not sure why some header files like frameobject.h are not included by Python.h. Not being included by Python.h doesn't mean excluded from the limited C API. Or maybe I misunderstood something.

From PEP 384: "Applications shall only include the header file Python.h (before including any system headers), or, optionally, include pyconfig.h, and then Python.h."

I was under the impression that the "stable C API" and the "limited C API" was the same thing, however, that might not be the case?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland

erlend-aasland commented Oct 6, 2020 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

PyMemberDef not part of the stable API

structmember.h is part of the limited C API. If it should not, I suggest to first exclude it from the limited C API, before changing _sqlite3 header files.

I think that the "not part of the stable API" comment was a reference to bpo-2897. According to PEP 384, PyMemberDef is indeed a part of the stable (limited?) C API, however PyMemberDef is defined in structmember.h, and PEP 384 states that you're allowed to include Python.h only. Referenced in the bpo, there's a (huge) PR (#20462) that deprecates structmember.h and moves its content to descrobject.h.

The current situation is such that PEP 384 is self-contradicting when it comes to header files and structures. However, I guess that PEP 384 compliance is not as strict for built-in modules as it is for third party modules?

So, should bpo-2897 be resolved first before continuing with this PR?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland

erlend-aasland commented Oct 9, 2020

Copy link
Copy Markdown
Contributor Author

Guessing that this PR is on hold until this is sorted out, @vstinner. Perhaps the bpo can be closed without this.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland
erlend-aasland marked this pull request as draft November 12, 2020 00:03
@erlend-aasland erlend-aasland closed this Nov 17, 2020
@erlend-aasland
erlend-aasland deleted the fix-bpo-41861/headers branch November 17, 2020 10:02
@erlend-aasland erlend-aasland mentioned this pull request Nov 17, 2020
bpo-41861: Add NEWS and normalise _sqlite3 Cache/Node type struct naming #23337
Merged
@benjaminp benjaminp mentioned this pull request Apr 10, 2022
PyMemberDef missing in limited API / Deprecate structmember.h #47146
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@berkerpeksag berkerpeksag Awaiting requested review from berkerpeksag
@vstinner vstinner Awaiting requested review from vstinner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting review skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@erlend-aasland @vstinner @corona10 @the-knights-who-say-ni @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.