-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add data-requires-python attribute to file links (PEP 503) #56
Conversation
Just to be clear, you should post this change on distutils-sig to give folks a chance to comment on it there, and probably we should add a note at the bottom of the PEP to say it was adjusted on X date to add |
**SHOULD** ignore the download when installing to a Python version that | ||
doesn't satisfy the requirement. For example:: | ||
|
||
<a href="..." data-requires-python=">=3">...</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably worth adding/using a <=
example, as that needs encoding as <
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<
needs to be encoded, but >
doesn't? I'm having some trouble finding info on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<
needs encoding in every flavour of HTML/SGML/XML/etc.
>
needs to be encoded for some of them (sorry I dont recall the specifics offhand), but not all of them, so generally people and tools encode it all the time, to be safe and future proof in case the DOCTYPE of the document is changed in the future, or a browser implicitly detects it as a different DOCTYPE than the writer intended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - I've updated the example and added a note indicating that they should both be encoded. Better safe than sorry.
if a project have the |
I'm just curious. If this is exposing the |
Works for me. Data- is a html5 thing |
AIUI |
The basic idea seems sound to me, but I'll second @jayvdb's suggestion to clarify the requirements around escaping greater-and-less-than signs (it may not be a problem since they're inside a quoted string regardless, but the PEP should say either MUST or MUST NOT one way or the other, so that consumers know whether or not they need to undo any HTML quoting) Also +1 to @dstufft observation that the update should be noted towards the end of the PEP. It would also be desirable to mention the update in https://packaging.python.org/specifications/#simple-repository-api (although that can just link to the note in the PEP itself) |
I've added a 'changes' section near the end of the PEP with a note of this. I'm happy to add something about escaping, but I'm unsure what escaping is required. This SO answer seems to agree with what @jayvdb suggested, that |
If you can't find consistent information then it's probably best to be safe and just escape the whole string. |
I have now added a note that |
Does anyone want any more changes to this? |
Forgive me because I can't recall- Was this mentioned on distutils-sig at all? I seem to believe it was but I don't have it up in front of me at the moment. |
Yep: https://mail.python.org/pipermail/distutils-sig/2016-July/029255.html Two people said 'LGTM' there, and it probably drove a few comments here. |
Okay! Just wanted to make sure everyone had a chance to comment. I didn't think there'd be much push back on this :) |
If was, here, with at the time of this writing 2 responses:
|
I filed an issue with Warehouse to make sure it gets implemented there, I'm not going to implement it in legacy but if someone else does I'm happy to review it and merge it (also not going to implement it in Warehouse today, but if someone feels like doing that, happy to review and merge that as well). |
When will pip switch to warehouse by default ? (or did it have already) |
When Warehouse is ready, we don't have a date :/ |
Or I'll see if I figure out a fix for Legacy PyPI. |
Cross referencing: pypa/pip#3877 adds support for this in pip. |
This was suggested by @dstufft in pypa/pip#3847