-
Notifications
You must be signed in to change notification settings - Fork 19
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
relative links_fix #134
relative links_fix #134
Conversation
3513ff1
to
18f1b90
Compare
@gmathiou4 thanks for the PR, it would be nice if you could add some tests to verify your changes. |
aed1540
to
f5a3fc6
Compare
Still i have 2 failing tests unrelated to my changes
How would you suggest to proceed with those? |
52d1969
to
e987814
Compare
@gmathiou4 for Please run |
@gmathiou4 I ran the tests on your branch locally, I was not able to re-create this error |
This comment was marked as outdated.
This comment was marked as outdated.
37e01f6
to
e027c0d
Compare
@TG1999 The tests are fixed now, please proceed with the review |
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.
Please add a test for the package which have relative URLs to check the whole functionality
src/python_inspector/utils_pypi.py
Outdated
if "data-requires-python" in anchor_tag.attrs: | ||
python_requires = anchor_tag.attrs["data-requires-python"] | ||
# Check if the link is a relative URL | ||
if not url.startswith(("http://", "https://")): | ||
base_url = "/".join(package_url.split("/")[:-1]) # Extract base URL |
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.
Please extract this part of code in a separate function and add some doctest or unit tests for same.
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.
Hello @TG1999 , i have already added 2 new files for the test
tests/data/fetch_links_test.html
tests/data/relative-links-expected.json
and modified
tests/test_utils.py
Those tests aren't suitable?
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.
@TG1999 Could you please provide a feedback, is the change ready for merge?
2d1fe9e
to
db27f06
Compare
src/python_inspector/utils_pypi.py
Outdated
links.append(Link(url=url, python_requires=python_requires)) | ||
# TODO: keep sha256 | ||
return links | ||
|
||
|
||
def resolve_relative_url(package_url, url): | ||
""" | ||
Resolve a relative URL based on the package URL. |
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.
Please add some doctests
@gmathiou4 thanks! just a minor nitpick for your consideration #134 (comment) |
eb3c585
to
6f35786
Compare
Signed-off-by: mathioud <[email protected]>
Signed-off-by: mathioud <[email protected]>
Signed-off-by: mathioud <[email protected]>
Signed-off-by: mathioud <[email protected]>
Signed-off-by: mathioud <[email protected]>
Signed-off-by: mathioud <[email protected]>
Signed-off-by: mathioud <[email protected]>
Signed-off-by: mathioud <[email protected]>
Signed-off-by: mathioud <[email protected]>
Signed-off-by: mathioud <[email protected]>
Signed-off-by: mathioud <[email protected]>
Signed-off-by: mathioud <[email protected]>
Signed-off-by: mathioud <[email protected]>
Signed-off-by: mathioud <[email protected]>
Signed-off-by: mathioud <[email protected]>
d5e7c18
to
b74a7c3
Compare
Hello, |
@gmathiou4 please squash your commits |
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.
LGTM!
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.
@TG1999 Ready to merge when you are ready
@gmathiou4 Thank you ++ ❤️
@pombredanne CI is failing due to this sphinx-doc/sphinx#11381 |
Thanks @gmathiou4 merging ❤️ |
@TG1999, Thanks for merging! |
@TG1999 & @pombredanne Could you please release a new tag with the latest changes? |
@gmathiou4 released v0.9.8 here https://pypi.org/project/python-inspector/0.9.8/ |
This a fix for issue
#129
Signed-off-by: Georgios Mathioudakis [email protected]