Support requirement parsing in setuptools.build_meta#1720
Conversation
Per GH pypa#1682, with setuptools.build_meta we are not properly handling the situation where setup_requires is actually a newline-delimited string rather than a list, which is supported by setup.py interface. This adds several failing (and some passing) tests for how setup_requires is handled by setuptools.build_meta.
|
Another question here (which @benoit-pierre commented on while I was typing this up) is whether we should actually just use
The downside of this particular port is that it might get out of phase with the I'm OK with switching to the |
|
IMHO it's better to keep it simple, reuse the existing code, rather than duplicate it in favor of an hypothetical split of pkg_resources/setuptools (which I really don't see happening anytime soon). And pkg_resources will be imported anyway. |
|
@benoit-pierre OK, I'm convinced, I've updated the PR. I went with the mildly-import-conservative route of importing |
Let's not cargo cult it: |
benoit-pierre
left a comment
There was a problem hiding this comment.
LGTM, apart from the dynamic import.
Since pkg_resources is imported elsewhere anyway, we don't get much value out of porting the requirement parser locally.
48e796e to
5efdf81
Compare
|
@benoit-pierre Fair point, I've made the requested change. |
|
I also think that calling |
|
@benoit-pierre You mean just the requirement parsing part of it, or all of the If we're going down that route, just deprecating |
|
Removing all of |
Summary of changes
In the original
setup.pyinterface,setup_requireswould also accept some newline-delimited string format (including comments), butsetuptools.build_metaassumes that you have passed alistwhen convertingsetup_requiretoget_requires_for_*.In this PR, I've added this behavior to
setuptools.build_meta, but an argument could be made for restricting this tosetuptools.build_meta:__legacy__and requiring asetup_requiresto take a list in the mainbuild_meta.Closes #1682.
Pull Request Checklist