-
Notifications
You must be signed in to change notification settings - Fork 251
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
Allow customizing generation of tags #187
Comments
This is mostly as notes for myself, but:
|
@brettcannon I started to attempt this to include in #213 but I don't have enough familiarity with either codebase. Did you have a rough plan here? I see you unassigned yourself, are you not able to implement this? Should I just dig in deeper? @pradyunsg maybe this would make more sense to you? |
I just unassigned in case someone beat me to it is all. It's on my todo list so I will definitely attempt to tackle it soon-ish (I'm trying to get through my 'packaging' stuff ATM and so this should bubble up shortly). |
It looks like |
I'll also mention that this has to land before our next release as |
Searching through the pip source code via GitHub only turns up the following call site for a place where arguments are specified: That would suggest that |
@pradyunsg @di if The problem I have with Basically my question is how much must |
@brettcannon I think that's reasonable, and that's also the conclusion I came to when starting to look at this. The only real hitch there is that |
Sounds fair. I feel that this would be a lot easier to reason about on both sides (packaging.tags and pip). |
Hmm... With current master, yes. I'm OK to add a docstring that says warn should be specified via keyword only and set the expectation that more arguments may be added, especially if this is a blocking concern IMO. Or even to take **kwargs and handle it for these optional arguments (we're not directly using the call-signature via autodoc for Sphinx, so we can use the keyword only notation there). That said, it seems like we might be going down the path of creating a separate API for pip's "flexible" way of tag generation which makes this suggestion kinda moot. 🙃 |
I think it depends on what we want And as for the comment from @di , I was thinking about this last night and came to a similar conclusion that python version would probably be necessary as well. And doing the old |
More notes... According to
I think if we expose the |
FYI I started the work to expose the |
@brettcannon if you want to push what you have I can try it out on the pip-side. |
@chrahunt sure, that would be great! My branch is at https://github.com/brettcannon/packaging/tree/expose-tags and I have exposed:
If you look at |
There are several places where there are differences so far:
Output
The extra entries make sense to me and are probably OK, but we should add the missing |
(1) is a bug, (2) is a maybe, (3) I really don't want to get into the business of trying to parse individual tags. And the output difference is very much on purpose and was heavily researched and discussed when we started this work (distutils-sig will have the archives). The key question for me is whether the API is where pip needs it to be? |
Some parts are unresolved, but this should be the full set of conditions required to answer that question:
Regarding the lack of |
|
@chrahunt I also just double-checked the code and: should emit |
Filed pypa/pip#7327 to discuss whether it's necessary at all. By "doesn't impact the API of the module" you mean we can always add the keyword argument later if required?
Yes
Not personally, no. 😁 A closer reading of the documentation only suggests that we use this for compatibility checks, but doesn't say exactly how that happens. If the best approach we know for finding compatible wheels involves including ones with a lower-versioned interpreter part, then it seems reasonable to change the behavior without a deprecation notice IMO. That would also align with our existing behavior of back-filling the applicable macOS versions. @pradyunsg or @pfmoore may also have an opinion.
I think providing |
@chrahunt By "doesn't impact the API of the module" means we can just add code that does the discovery and have it implicitly added as part of the semantics without any API change. So I have no problem doing it, I just don't want it lost as part of this PR which I'm trying to keep focused on the public API of packaging.tags. I will look at exporting As for not back-filling the interpreter, I realized yesterday that you could probably do it very simply on the pip side: def interpreter_filter(interpreters, tag):
return filter(lambda tag: tag.interpreter in interpreters, tags) That way you can keep your semantics and we don't have to add specific support for it (unless I'm misunderstanding something).
So the trick here with that tag is its placement in the order of tag preferences. Being smack-dab in the middle of the "py" tags is what makes it so darn awkward and the reason The other way to handle this is to expose So for me, I think if you're okay with keeping |
👍
👍
Ah, yes that's obvious now thank you. 😅
I am, I think your blog post makes a good case for not needing that tag. So to summarize: the only thinking pending for us is exposing |
@chrahunt I've opened #231 which includes everything I had before plus exposing And I believe we have some issues to open:
Am I missing anything? |
Nope, I think that's it! |
Coming from pypa/pip#6908
pip's current
get_supported
function for generating PEP 425 tags, has the following signature:It takes details/strings about the specific platform, implementation, ABI and interpreter versions. It also has a flag to avoid generating architecture specific tags.
packaging.tags
would need to have feature parity with this interface, to be used within pip.The text was updated successfully, but these errors were encountered: