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
Changed condition for package name to be considered a url to endswith(".whl") #872
Conversation
Some minor updates to loading_packages / micropip docs. Docs are still confusing but I think that's not worth working on too much until we resolve pyodide#870
a915a02
to
667f115
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.
Thanks @hoodmane ! A few comments below
Also please add an entry to the docs/changelog.md file with a link to this PR. |
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
It would be good to add a test on selenium that actually loads a package from a wheel at a relative url. I wasn't sure how to do this though: I would probably want to take a trivial "hello world" wheel, but I have to get the wheel onto the url somehow. Even for documentation purposes it would be nice to have a test file that loads the same package using each method. |
Oh I see I can just use a tiny modification of the snowball stemmer test. |
Please ping me when those tests are added. |
8f47628
to
fc44917
Compare
@rth Okay I added a couple of tests. One just tests I guess I should take this as encouragement to try more monkeypatching to test more than |
dfa13f4
to
9c13723
Compare
9c13723
to
94c6520
Compare
Okay I added another selenium-free test that monkey patches out |
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.
I think the failure for test_install_custom_relative_url
is to be expected because the relative path is not correct. It is ./snowballstemmer..
when using the web_server_tst_data
fixture (that serves files in src/tests/data/
. However the selenium_standalone / selenium
fixtures serve files in './build' so unless you temporarily copy the wheel there (and make sure it's later deleted including on test failure) that won't work. Since relative paths higher than the root dir for the webserver are disallowed.
I agree those errors are hard to debug, and I think we should try to use pytest-httpserver
more (#823). However that won't help here, because we still serve packages for tests with a SimpleHTTPRequestHandler
Edit: once test_install_custom_relative_url passes, I think we can remove test_relative_url_2
(unless you want to spend more time investigating why it fails).
packages/micropip/test_micropip.py
Outdated
assert req["url"] == "./snowballstemmer-2.0.0-py2.py3-none-any.whl" | ||
|
||
|
||
def test_relative_url_2(): |
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.
def test_relative_url_2(): | |
def test_relative_url(): |
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
What is the status of this PR? |
I think the HTTP request is set up in way that does not handle relative urls correctly. I don't know why, I had a hard time diagnosing it. Maybe if I came back to it now I would have an easier time with it since I'm more familiar with the tools available. While we're at it, could you weigh in on #870? |
As rth mentioned, the easiest solution would be to symlink |
In case you missed it I submitted a PR to your branch that fixes the tests |
Did not notice, thanks. |
I don't think it matters much in this case but would be good to merge in master too |
Fix tests
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 @hoodmane ! LGTM.
Just one last thing, could you please add a changelog entry to 0.17.0 (might need to merge master in to see that section).
Isn't it traditional to call the changelog section [unreleased] and only change the name to a specific version number as part of the release process? This is at least the semver recommended approach. |
Indeed feel free to change it. In general we should probably follow https://keepachangelog.com/en/1.0.0/ better. |
Co-authored-by: Dexter Chua <dec41@srcf.net>
Resolves #867.
Some minor updates to loading_packages / micropip docs.
Docs are still confusing but I think that's not worth working on too much
until we deal with #870