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

feat: produce ABI-agnostic wheels for python #1324

Merged
merged 4 commits into from
Dec 20, 2022

Conversation

frostming
Copy link
Contributor

@frostming frostming commented Dec 20, 2022

Signed-off-by: Frost Ming mianghong@gmail.com


The approach is taken from cibuildwheel Tips and Tricks, also quote:

The CPython Limited API is a subset of the Python C Extension API that's declared to be forward-compatible, meaning you can compile wheels for one version of Python, and they'll be compatible with future versions. Wheels that use the Limited API are known as ABI3 wheels.

This will reduce the number of wheels to upload to PyPI

Signed-off-by: Frost Ming <mianghong@gmail.com>
Signed-off-by: Frost Ming <mianghong@gmail.com>
@gaocegege
Copy link
Member

Thanks for your contribution! 🎉 👍

I could not review this since I know little about pypi.

/assign @VoVAllen @kemingy

setup.py Outdated Show resolved Hide resolved
Signed-off-by: Frost Ming <mianghong@gmail.com>
@frostming frostming changed the title feat: producce abi3 wheels for cpython feat: producce ABI-agnostic wheels for python Dec 20, 2022
@frostming frostming changed the title feat: producce ABI-agnostic wheels for python feat: produce ABI-agnostic wheels for python Dec 20, 2022
setup.py Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
@VoVAllen
Copy link
Member

VoVAllen commented Dec 20, 2022

Thanks a lot! We have reached the storage limit of pypi several times, and this could greatly help reduce our storage usage.

@@ -110,5 +119,9 @@ def get_version():
ext_modules=[
EnvdExtension(name="envd", sources=["cmd/*"]),
Copy link
Member

@cutecutecat cutecutecat Dec 20, 2022

Choose a reason for hiding this comment

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

The example provides two arguments define_macros=[("Py_LIMITED_API", "0x03060000")] and py_limited_api=True, whether we need to overwrite the init of EnvdExtension to include them?

ref:
https://github.com/joerick/python-abi3-package-sample/blob/1e0320be94f86dad5d31a4395bf25e55747a6b83/setup.py#L22

https://setuptools.pypa.io/en/latest/userguide/ext_modules.html#setuptools.Extension

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 don't think so, there is no python api involved

Copy link
Member

Choose a reason for hiding this comment

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

I don't think so. The original example is for the abi3-compatible package. For envd, we don't rely on any python abi or version

Copy link
Member

Choose a reason for hiding this comment

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

Got it, seems fine

Co-authored-by: Jinjing Zhou <VoVAllen@users.noreply.github.com>
Signed-off-by: Frost Ming <mianghong@gmail.com>
Copy link
Member

@VoVAllen VoVAllen left a comment

Choose a reason for hiding this comment

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

/lgtm

@muniu-bot muniu-bot bot added the lgtm label Dec 20, 2022
@VoVAllen VoVAllen merged commit 0a48acd into tensorchord:main Dec 20, 2022
@frostming frostming deleted the feat/abi3-wheels branch December 20, 2022 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants