Skip to content
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 and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python 3.10 support: use Py_SET_SIZE() #52

Merged
merged 3 commits into from
Dec 7, 2020
Merged

Add Python 3.10 support: use Py_SET_SIZE() #52

merged 3 commits into from
Dec 7, 2020

Conversation

vstinner
Copy link
Contributor

@vstinner vstinner commented Dec 4, 2020

Run upgrade_pythoncapi.py on immutables: replace Py_SIZE(node)=size
with Py_SET_SIZE(node, size).

Add pythoncapi_compat.h header file to support Python 3.8 and older.

Fix #46

Run upgrade_pythoncapi.py on immutables: replace Py_SIZE(node)=size
with Py_SET_SIZE(node, size).

Add pythoncapi_compat.h header file to support Python 3.8 and older.

Fix #46
@vstinner
Copy link
Contributor Author

vstinner commented Dec 4, 2020

Run upgrade_pythoncapi.py on immutables

See https://github.com/pythoncapi/pythoncapi_compat

@@ -1,4 +1,5 @@
#include <stddef.h> /* For offsetof */
#include "pythoncapi_compat.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means we need to drop support for Python 3.5, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated https://github.com/pythoncapi/pythoncapi_compat to support Python 2.7, 3.4 and 3.5 as well.

I updated pythoncapi_compat.h to the latest version in my PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python 3.5 was already supported by I was too lazy to port the tests to Python 3.5. Since I'm trying to use pythoncapi_compat.h on Mercurial which still supports Python 2.7, I ported it to Python 2.7, 3.4 and 3.5. And 2.7 and 3.5 are now tested on the project CI.

@1st1 1st1 merged commit 45105ec into MagicStack:master Dec 7, 2020
@1st1
Copy link
Member

1st1 commented Dec 7, 2020

Thanks Victor!

@vstinner vstinner deleted the python310 branch December 7, 2020 10:43
@vstinner
Copy link
Contributor Author

vstinner commented Dec 7, 2020

Thanks Victor!

You're welcome, thanks for the review. immutables is now the first official user of pythoncapi_compat.h :-D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build broken on Python 3.10
2 participants