Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(python): Add Python 3 compatibility macros for PyInt functions #182

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

Merged
merged 2 commits into from
May 10, 2025

Conversation

vowstar added 2 commits May 8, 2025 18:24
- Change package name to use hyphens instead of spaces
- Add version 1.1.0 to setup configuration

See also: gentoo/gentoo#41956
Bug: https://bugs.gentoo.org/954840
Signed-off-by: Huang Rui <[email protected]>
- Add PY_MAJOR_VERSION check to define PyInt_* macros for Python 3
- Replace deprecated PyInt functions with PyLong equivalents in Python 3

See also: gentoo/gentoo#41956
Bug: https://bugs.gentoo.org/955499
Signed-off-by: Huang Rui <[email protected]>
gentoo-bot pushed a commit to gentoo/gentoo that referenced this pull request May 8, 2025
@LB--
Copy link
Member

LB-- commented May 8, 2025

Thanks, but Python bindings in this library are unmaintained and undocumented and outdated, and might be removed in the future. Are you actually using the Python bindings or is this just to silence some warnings from your processes?

@vowstar
Copy link
Contributor Author

vowstar commented May 9, 2025

Thanks for clarifying! Okay, so after double-checking, it turns out only two packages in Gentoo: net-vpn/openconnect and net-im/bitlbee, actually depend on dev-libs/json-parser. But here’s the kicker: neither of them uses the Python bindings at all. That means those bindings are pretty much dead weight in Gentoo’s context.

The main issue now is that the bindings are broken due to Cython dropping the old pyInt_* APIs (like in this commit), causing build failures, and they also clash with Python’s modern packaging rules. Since nobody’s using them anyway, removing the bindings would not only fix these immediate problems but also clean up the package long-term. No downsides spotted, we’re just cutting unused code to make life easier for maintainers.

@arkamar
Copy link

arkamar commented May 9, 2025

I don't recall what was the exact intention when I wired the python bindings to the Gentoo package back then, but I guess it was just simple to do, so why not. As @vowstar stated, no package uses it in Gentoo, therefore we can drop it from the package.

@LB-- LB-- self-assigned this May 10, 2025
@LB-- LB-- added this to the v1.1.1 milestone May 10, 2025
@LB--
Copy link
Member

LB-- commented May 10, 2025

I'll go ahead and merge this PR in case it helps anyone, and so that it's in the commit history in case Python bindings are wanted back again in the future. Thanks for confirming the usage status :)

@LB-- LB-- merged commit 8ac4477 into json-parser:master May 10, 2025
13 of 23 checks passed
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.

3 participants