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

PEP 517 build options #9486

Closed
bharel opened this issue Jan 22, 2021 · 5 comments
Closed

PEP 517 build options #9486

bharel opened this issue Jan 22, 2021 · 5 comments

Comments

@bharel
Copy link

bharel commented Jan 22, 2021

What's the problem this feature will solve?

I'm trying to restrict a python wheel to the CPython implementation, using setup.cfg and PEP 517/518:

pip wheel --build-option python-tag=cp3 .

Unfortunately, as of now, it's not possible.
I can't specify an implementation inside a setup.cfg, nor in pyproject.toml.
I also can't pass parameters to pip wheel as, to my understanding, PEP 517 does not guarantee setuptools to be the backend.

Describe the solution you'd like

It's either a change in pip to support passing build options to an unknown backend, or a change in setuptools to support them in setup.cfg.

As a real world use-case, I have packages relevant only to CPython (latest one deals with the garbage collector).

Alternative Solutions

The only solution as of now is to abandon PEP 517, and use the deprecated setup.py.

@pfmoore
Copy link
Member

pfmoore commented Jan 22, 2021

setup.py isn't deprecated, it's how you configure setuptools. If you set the relevant options in setup.py, and build with pip as normal, pip will work fine.

PEP 517 allows for different backends, but any one project will define the specific backend that they use. So you can happily use setuptools mechanisms, and don't need to worry that someone will randomly try to build your project with a different backend...

@bharel
Copy link
Author

bharel commented Jan 22, 2021

I might have misunderstood, but reading the setuptools documentation, one may believe setup.py is being phased off.

@pfmoore
Copy link
Member

pfmoore commented Jan 22, 2021

Running setup.py directly (rather than via the PEP 517 backend using pip) may be something they want to phase out, but they aren't going to just drop functionality so there should be a way to get the behaviour you want even then. But that's something you should discuss with them, it's not a pip issue.

@bharel
Copy link
Author

bharel commented Jan 23, 2021

Alright, thank you very much and sorry for posting in the wrong forum :-)
I still do think build options should pass to the backend, much like --config-setting in pypa's build.

@bharel bharel closed this as completed Jan 23, 2021
@sbidoul
Copy link
Member

sbidoul commented Jan 23, 2021

Adding PEP 517 config settings support in pip is tracked in #5771.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants