-
Notifications
You must be signed in to change notification settings - Fork 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
Testing using notebook>=6.1 requires requests_unixsocket
#5644
Comments
Well, that didn't take long! 😄 @fcollonval - thank you for opening this issue. Could you please elaborate on how the import of
It is true that this particular package was added to test dependencies in 6.1 so I can understand an existing environment encountering an import error if the test dependencies were not updated. I agree that this could (and probably should) be tightened up a bit, making it a platform-specific dependency and import statement, but I'm trying to understand how this is an incompatibility issue and want to be sure it isn't truly blocking you. |
@kevin-bates Thanks for the quick reply. Indeed I should have be more precise on the context. The But you are right, the package is pure Python (despite addressing pure Unix feature). So the problem is more about the additional dependency for testing of extension packages. So I see two solutions:
|
Thanks for the clarification @fcollonval. I think the right thing to do is better-isolate the dependency and produce a patch. That said, I do feel that those dependent on notebook's test framework should be aware that dependencies can change (at any time) and the onus is on them to ensure those requirements are satisfied by using |
requests_unixsocket
makes notebook.test
incompatible with Windowsrequests_unixsocket
Thank you for easing my life 😉
You are right - but that is of course more complicated when relying on conda... |
Before and after doing pip stuff, I've started always running "pip check":
it's the best we've got, in lieu of a day solver. Unfortunately wouldn't
help in this case.
While pip extras work fine for one time solves, like setting up CI, they
are not actually that reliable for interactively composing larger
environments, long-term, as extras "constraints" can sometimes be lost in
successive solves, nor will "pip check" tell you if anything is wrong.
If using conda-forge, an additional "output" metapackage (e.g.
notebook-with-testing) could be created by @conda-forge/notebook-feedstock.
The tests are (hopefully) already executed there on all the platforms
shipped, which these days can be more then what the upstream CI regimes
test, so the maintainers would already be accutely aware of testing
dependency changes.
If being able to rely on notebook testing deps is important for
downstreams, and this has happened before, it could be published as a
standalone package on pypi, and similarly for conda, so that "pip check"
can be used confidently, and should be used at test time by notebook
itself. Sounds like a fair amount of work, though.
… |
Thanks for your input @bollwyvl On the conda front, unfortunately the testing is light (testing It may be interesting to move to a multiple outputs package. But is it worth it knowing |
As I said, doing these changes here would be a lot of work, and may not be worth it. And sure, jupyter_server is coming. However, use of (and therefore testing with) With the addition of even more supported platforms that many upstreams aren't even thinking about, the only feasible way to do this is by being as aggressive as possible with automated testing: pip check, PRing dependency feedstocks when things break, using coverage thresholds, etc. I usually draw the line at browser tests, though. Worst case: every couple weeks, I have to fix something, or add a test skip for something that isn't marked appropriately or has expectations like being in a git checkout. Best case: we find upstream issues, coming in with a full reproduction case, if not a PR, which is about the only way I've found to garner good will as a downstream packager. On conda-forge: the official line, of course, is "conda-forge is not your CI". My personal stance, for the good of the brand, is to never knowingly push out versions that cause breakage on user systems, as this results in unhappy users, and issues created on already-maintainer-strapped projects who may not even like conda to begin with. I'd far rather just not ship a version, get a patch upstream, and wait for the next release. |
Thanks @bollwyvl - I agree that this repo will require a lengthy maintenance and yes, we need to prevent disruptions for downstream applications - even if only related to testing. We should try to note any dependency changes and understand their downstream impacts. (I probably should have made that connection for 6.1, but this is a rookie at helm.) Given the diminishing maintainer focus on this repo, I think it is best to take the easiest route for this particular issue and avoid installing |
Thanks all!
|
Indeed thank you all. |
Update to provide a quick answer:
If you are relying on
notebook.tests
for testing your own code (like a jupyter server extension), be sure to installnotebook[test]
dependencies in your test environment. Starting withnotebook>=6.1
,requests-unixsocket
was added as test dependency.That import makes
notebook.test
incompatible with Windows:notebook/notebook/tests/launchnotebook.py
Line 19 in 94af525
Is it even used as that package was removed in #5451?
If it is needed what about using
pytest.importorskip
?The text was updated successfully, but these errors were encountered: