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

Accept string in PEP 517 config_settings #2528

Open
FFY00 opened this issue Jan 9, 2021 · 2 comments
Open

Accept string in PEP 517 config_settings #2528

FFY00 opened this issue Jan 9, 2021 · 2 comments
Labels
enhancement Needs Investigation Issues which are likely in scope but need investigation to figure out the cause proposal

Comments

@FFY00
Copy link
Member

FFY00 commented Jan 9, 2021

As discussed in pypa/build#202, it would be great if setuptools could accept strings, instead of only lists, in the PEP 517 config_settings hooks variable.

It would make the following dictionary valid.

{
    '--global-setting': '--something',
}

Currently, setuptools seems to only accept a list.

{
    '--global-setting': ['--something'],
}

Which is difficult to expose in a CLI interface.

@FFY00
Copy link
Member Author

FFY00 commented Mar 18, 2021

As we've received another bug report that would benefit from this fixed, I would like to ping. It should be fairly straight forward, when I pass a string instead of list, setuptools would just treat it the same as it would a list with a single element.

The code should be as simple as

if isinstance(option, str):
    option = [option]

I can open a PR if you agree with this.

@KOLANICH
Copy link
Contributor

Shouldn't it be in

def _fix_config(self, config_settings):
?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Needs Investigation Issues which are likely in scope but need investigation to figure out the cause proposal
Projects
None yet
Development

No branches or pull requests

3 participants