-
Notifications
You must be signed in to change notification settings - Fork 297
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
Pytest-Tornasync triggering Deprecation Warnings with Tornado 6.2 #876
Comments
To be clear, I believe it is 100% compatible. The use of deprecated APIs that work fine isn't really a compatibility problem, it's a possible future compatibility problem. It's the strict warnings filters in this repo that turn deprecations into errors that cause the failure. I think deprecations into failures would ideally be treated like we already treat prerelease dependencies in ipykernel - a low priority, low pressure failure that doesn't affect most of the test runs. This can also be worked around by defining an |
FWIW I did try to override the |
I agree that it needs to be addressed, I just disagree about the priority level of it and time scale. Nothing is broken and won't be for quite some time. It doesn't make sense to me to block all other work to fix something that's not broken. It's also just factually incorrect that this is incompatible with tornado 6.2. It's presumably incompatible with tornado 7, and 6.2 is informing us what will change with plenty of time to deal with it, under no significant time pressure (at least a year). |
Fair enough, I updated the title. If we want to get CI passing we can add a targeted |
Having looked at it a bit more, there's un-overrideable logic in pytest-tornasync that uses the deprecated I'd recommend switching to pytest-asyncio as a runner for the async tests, and either vendor the relevant fixtures from pytest-tornasync (just these <100 lines), or switch back to the less intrusive The main reason for pytest-tornasync's creation doesn't exist anymore: |
There are changes in our code necessary to avoid handles on the non-running loop (the APIs deprecated in Python 3.10 and tornado 6.2). So far, I've only found our couple of One simple way to do some of that would be to change the outermost |
I've found this issue when trying to understand why jupyter-server depends on pytest-tornasync. FYI the pytest-tornasync seems to be abandoned for years. I'm trying to package all dependencies of Jupyter into Fedora Linux and the status of tornasync makes is much harder. Is there any chance you'll remove that dependency and switch to something newer/better? |
@frenzymadness can you help us understand exactly what the issue is when packaging on Fedora? A couple of things to note... pytest-tornasync hasn't cut a release in awhile, true, but I believe this is because the plugin was essentially "feature complete" from its start. It has a very narrow scope—managing the tornado async event loop between tests. pytest-tornasync isn't a dependency of jupyter_server—it's only a dependency for jupyter_server's unit tests. It shouldn't be required unless you're installing the Jupyter Server's test dependencies explicitly. Coincidently, @blink1073 is in the process of moving our fixtures entirely out of the jupyter_server package into the (newly revived) pytest-jupyter package. Currently, pytest-jupyter still uses pytest-tornasync, but the isolation of these dependencies are a bit more clean. Also, I should mention, we have recently discussed manually copying out the fixtures from pytest-tornasync and adding them directly to pytest-jupyter (adding proper attribution/credit/lincensing to pytest-tornasync), so we could evolve these fixtures further. The issues you're seeing might be further motivation to finish that work. Before we go down this road, it would help us to understand your issue more clearly. |
@Zsailer sure thing, thanks for your interest. The first thing to note is that when building RPM packages, it's best practice to run its unittests which means that I should package also test dependencies. As a maintainer of an RPM package in a Linux distro, I'm responsible for it being buildable and installable, and having an active upstream development is always good because when a problem appears (for example, in Fedora, we've already started testing Python packages with Python 3.12) I have to either drop the package or fix it. And dropping a package is harder when other packages already depend on it. And when I see a project like tornasync, I hesitate to package it as an RPM because it seems to be inactive in general with some specific issues making my packaging work harder, namely:
To be 100% honest. We have tried to package JupyterLab into Fedora multiple times but the effort failed because the package is too complex and requires too many dependencies. Because it's possible to install it from PyPI into a virtual environment, we kept only Notebook in the distro so we have at least something directly available to users. But now, Notebook 7 is also based on the same components as JupyterLab so I'm trying it again. I've also discovered one possibly related problem. If I want to package jupyter-server, I have to also package jupyter-server-terminals because it's a runtime dependency of jupyter-server. But jupyter-server-terminals has jupyter-server[test] in its testing dependencies which creates a dependency loop. It's possible to break a dependency loop like this by packaging the first version of each package without tests but having a new package with pytest fixtures both of those packages will depend on can also break it and make it easier. My current plan is to package server-terminals without tests and then jupyter-server without tornasync (if possible) or also without tests to skip the need to package tornasync. |
Given the above, I think the best course is for us to inline |
Thanks for this! There is still a dependency loop between jupyter-server and pytest-jupyter but at least I don't have to package the tornasync package. By the way, jupyter-server-terminals also depends on tornasync which is something you might want to change. |
Thanks, yes, there are some follow up tasks to move some libraries onto |
Description
Our prerelease builds are failing due to deprecation warnings:
Reproduce
Run the test suite with tornado 6.2 beta.
Expected behavior
Test suite passes
Proposal
We may need to use the approach recommended by tornado, that looks like the following (based on one of their own unit tests):
The text was updated successfully, but these errors were encountered: