pypa / setuptools

Official project repository for the Setuptools build system
https://pypi.org/project/setuptools/
MIT License
2.51k stars 1.19k forks source link

[FR] requiring 32-bit or 64-bit Python in setuptools.setup #3746

Open jamesbraza opened 1 year ago

jamesbraza commented 1 year ago

What's the problem this feature will solve?

Sometimes in life, one finds oneself doing major software archaeology with code from a decade ago. 🥲

OpenOPC-Python3x works with pywin32, which I have discovered only works with 32-bit Python. I confirmed this to be true with rigorous testing, and recorded it here https://github.com/ya-mouse/openopc/issues/22.

Now, in my package where I import OpenOPC and pywin32, I would like to use setuptools to enforce a 32-bit dependency.

Describe the solution you'd like

setuptools.setup has the python_requires kwarg to require a certain version range of Python.

I think it would be good to add processor_type or something similar to enforce Python being 32-bit, 64-bit, etc.

Alternative Solutions

No response

Additional context

No response

Code of Conduct

abravalheri commented 1 year ago

Hi @jamesbraza, sorry for replying to this issue just now and thank you for starting the discussion.

I think that in this case it would be necessary to coordinate which new kinds of metadata (regarding the number of bits) it would be necessary to expose and how the installer (e.g. pip would handle that). In the end of the day that would be an standardisation effort.

So I think the best place to discuss that would be the Python Packaging discourse.

jamesbraza commented 1 year ago

All good. Fwiw, this request is now more useful, as many libs are dropping support for 32-bit, and it's breaking installs:

I will make a Discourse thread shortly

jamesbraza commented 1 year ago

Okay I made this: https://discuss.python.org/t/idea-enforcing-32-bit-vs-64-bit-support-in-setuptools

Feel free to close this out in favor of that discussion