-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[ethPM] Update registry uri #1571
[ethPM] Update registry uri #1571
Conversation
8f9e32b
to
a85fb39
Compare
a85fb39
to
1a8c8d5
Compare
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.
Any documentation updates that should go with this?
return None, None | ||
|
||
if "@" not in pkg_id: | ||
return pkg_id, None |
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.
This return and the one above this violate the type signagure of this function.... looks like it should be Tuple[Optional[str], Optional[str]]
|
||
if "@" not in pkg_id: | ||
return pkg_id, None | ||
pkg_name, safe_pkg_version = pkg_id.split("@") |
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.
This line would still be executed if pkg_id =
a@b@c`.
Since version
is technically allowed to be any string (i think) then I think you need to do this with pkg_id.partition('@')
which might result in a safe_pkg_version
with multiple @
symbols in it.
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.
This case is covered in validate_registry_uri
- which will raise an exception if there is more than 1 @
symbol - since at this stage all @
symbols should be properly escaped (i.e. "safe"
). There's test cases covering both ...
- invalid paths:
pkg@1@0
(version=1@0
) - valid paths:
pkg@1%400
(version=1@0
)
@pipermerriam I made one minor update: making the previous simplest uri:
Yup doc updates are in #1486 and I've already made the updates to docs.ethpm.com which should cover the bases |
What was wrong?
Updated the Registry URI utils to support URIs with
ethpm
as the scheme and package ids conforming topkg_name@version
- containing escaped charactersre: #1486
Todo:
Cute Animal Picture