Skip to content
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

Try testing against python 3.12 #1282

Merged
merged 12 commits into from
Jun 19, 2023

Conversation

blink1073
Copy link
Contributor

No description provided.

@blink1073
Copy link
Contributor Author

Error during setup (pip install):

ERROR: Exception:
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 169, in exc_logging_wrapper
    status = run_func(*args)
             ^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/site-packages/pip/_internal/commands/debug.py", line 195, in run
    show_vendor_versions()
  File "/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/site-packages/pip/_internal/commands/debug.py", line 101, in show_vendor_versions
    show_actual_vendor_versions(vendor_txt_versions)
  File "/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/site-packages/pip/_internal/commands/debug.py", line 81, in show_actual_vendor_versions
    actual_version = get_vendor_version_from_module(module_name)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/site-packages/pip/_internal/commands/debug.py", line 61, in get_vendor_version_from_module
    module = get_module_from_module_name(module_name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/site-packages/pip/_internal/commands/debug.py", line 56, in get_module_from_module_name
    __import__(f"pip._vendor.{module_name}", globals(), locals(), level=0)
  File "/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/site-packages/pip/_vendor/typing_extensions.py", line 1174, in <module>
    class TypeVar(typing.TypeVar, _DefaultMixin, _root=True):
TypeError: type 'typing.TypeVar' is not an acceptable base type

@blink1073
Copy link
Contributor Author

I opened pypa/pip#12053

@blink1073
Copy link
Contributor Author

Okay, now we're blocked on cython support, so we can build pyzmq: cython/cython#5285

@minrk
Copy link
Contributor

minrk commented May 28, 2023

I believe pyzmq 25.1 should build on 3.12b1 now, if you want to try again

@blink1073
Copy link
Contributor Author

I believe pyzmq 25.1 should build on 3.12b1 now

Works, thanks!

Next step, we need to ignore a warning from dateutil:

ImportError while loading conftest '/home/runner/work/jupyter_server/jupyter_server/tests/conftest.py'.
tests/conftest.py:4: in <module>
    from nbformat import writes
../../../.local/share/hatch/env/virtual/jupyter-server/horQbOoS/test/lib/python3.12/site-packages/nbformat/__init__.py:11: in <module>
    from . import v1, v2, v3, v4
../../../.local/share/hatch/env/virtual/jupyter-server/horQbOoS/test/lib/python3.12/site-packages/nbformat/v4/__init__.py:23: in <module>
    from .convert import downgrade, upgrade
../../../.local/share/hatch/env/virtual/jupyter-server/horQbOoS/test/lib/python3.12/site-packages/nbformat/v4/convert.py:11: in <module>
    from nbformat import v3, validator
../../../.local/share/hatch/env/virtual/jupyter-server/horQbOoS/test/lib/python3.12/site-packages/nbformat/validator.py:16: in <module>
    from .json_compat import ValidationError, _validator_for_name, get_current_validator
../../../.local/share/hatch/env/virtual/jupyter-server/horQbOoS/test/lib/python3.12/site-packages/nbformat/json_compat.py:11: in <module>
    import jsonschema
../../../.local/share/hatch/env/virtual/jupyter-server/horQbOoS/test/lib/python3.12/site-packages/jsonschema/__init__.py:13: in <module>
    from jsonschema._format import FormatChecker
../../../.local/share/hatch/env/virtual/jupyter-server/horQbOoS/test/lib/python3.12/site-packages/jsonschema/_format.py:494: in <module>
    import isoduration
../../../.local/share/hatch/env/virtual/jupyter-server/horQbOoS/test/lib/python3.12/site-packages/isoduration/__init__.py:3: in <module>
    from isoduration.parser import parse_duration
../../../.local/share/hatch/env/virtual/jupyter-server/horQbOoS/test/lib/python3.12/site-packages/isoduration/parser/__init__.py:2: in <module>
    from isoduration.parser.parsing import parse_date_duration
../../../.local/share/hatch/env/virtual/jupyter-server/horQbOoS/test/lib/python3.12/site-packages/isoduration/parser/parsing.py:4: in <module>
    import arrow  # type: ignore
../../../.local/share/hatch/env/virtual/jupyter-server/horQbOoS/test/lib/python3.12/site-packages/arrow/__init__.py:2: in <module>
    from .api import get, now, utcnow
../../../.local/share/hatch/env/virtual/jupyter-server/horQbOoS/test/lib/python3.12/site-packages/arrow/api.py:12: in <module>
    from arrow.arrow import TZ_EXPR, Arrow
../../../.local/share/hatch/env/virtual/jupyter-server/horQbOoS/test/lib/python3.12/site-packages/arrow/arrow.py:32: in <module>
    from dateutil import tz as dateutil_tz
../../../.local/share/hatch/env/virtual/jupyter-server/horQbOoS/test/lib/python3.12/site-packages/dateutil/tz/__init__.py:2: in <module>
    from .tz import *
../../../.local/share/hatch/env/virtual/jupyter-server/horQbOoS/test/lib/python3.12/site-packages/dateutil/tz/tz.py:37: in <module>
    EPOCH = datetime.datetime.utcfromtimestamp(0)
E   DeprecationWarning: datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.fromtimestamp(timestamp, datetime.UTC).

@blink1073
Copy link
Contributor Author

dateutil/dateutil#1284

@blink1073
Copy link
Contributor Author

Next error is from pytest: pytest-dev/pytest#10977

@blink1073
Copy link
Contributor Author

Okay, something that needs to change in nbformat:

ServerApp:filemanager.py:942 Error while saving file: foo/.hidden_dir/nb.ipynb The default datetime adapter is deprecated as of Python 3.12; see the sqlite3 documentation for suggested replacement recipes
Traceback (most recent call last):
  File "/home/runner/work/jupyter_server/jupyter_server/jupyter_server/services/contents/filemanager.py", line 927, in save
    self.check_and_sign(nb, path)
  File "/home/runner/work/jupyter_server/jupyter_server/jupyter_server/services/contents/manager.py", line 713, in check_and_sign
    self.notary.sign(nb)
  File "/home/runner/.local/share/hatch/env/virtual/jupyter-server/horQbOoS/test/lib/python3.12/site-packages/nbformat/sign.py", line 464, in sign
    self.store.store_signature(signature, self.algorithm)
  File "/home/runner/.local/share/hatch/env/virtual/jupyter-server/horQbOoS/test/lib/python3.12/site-packages/nbformat/sign.py", line 202, in store_signature
    self.db.execute(
  File "/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/sqlite3/dbapi2.py", line 68, in adapt_datetime
    warn(msg.format(what="datetime adapter"), DeprecationWarning, stacklevel=2)
DeprecationWarning: The default datetime adapter is deprecated as of Python 3.12; see the sqlite3 documentation for suggested replacement recipes

@blink1073
Copy link
Contributor Author

jupyter/nbformat#363

@@ -26,6 +26,8 @@ jobs:
python-version: "pypy-3.8"
- os: macos-latest
python-version: "3.10"
- os: ubuntu-latest
python-version: "3.12.0-beta.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I learned from here that you can use python-version: "3.12" if you add allow-prereleases: true to setup-python. Then we don't have to change this field as 3.12 move towards release.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@minrk
Copy link
Contributor

minrk commented May 31, 2023

PyPI let me upload prerelease wheels for 3.12, so if you use --pre, you ought to get wheels, I think.

@blink1073
Copy link
Contributor Author

PyPI let me upload prerelease wheels for 3.12, so if you use --pre, you ought to get wheels, I think.

Thanks, I'm trying to separate concerns first and test against stable deps.

@blink1073
Copy link
Contributor Author

Weird, 69 tests failed on the first attempt but all succeeded on the second attempt.

ERROR tests/test_gateway.py::test_websocket_connection_closed - socket.gaierror: [Errno -3] Temporary failure in name resolution
ERROR tests/test_paths.py::test_path_regex - socket.gaierror: [Errno -3] Temporary failure in name resolution
ERROR tests/test_paths.py::test_path_regex_bad - socket.gaierror: [Errno -3] Temporary failure in name resolution
FAILED tests/test_files.py::test_hidden_files[maybe_hidden0-jupyter_server.files.handlers.FilesHandler] - tornado.httpclient.HTTPClientError: HTTP 404: Not Found
FAILED tests/test_files.py::test_hidden_files[maybe_hidden0-jupyter_server.base.handlers.AuthenticatedFileHandler] - tornado.httpclient.HTTPClientError: HTTP 404: Not Found
FAILED tests/test_files.py::test_hidden_files[maybe_hidden1-jupyter_server.files.handlers.FilesHandler] - tornado.httpclient.HTTPClientError: HTTP 404: Not Found
FAILED tests/test_files.py::test_hidden_files[maybe_hidden1-jupyter_server.base.handlers.AuthenticatedFileHandler] - tornado.httpclient.HTTPClientError: HTTP 404: Not Found
FAILED tests/test_files.py::test_hidden_files[maybe_hidden2-jupyter_server.files.handlers.FilesHandler] - tornado.httpclient.HTTPClientError: HTTP 404: Not Found
FAILED tests/test_files.py::test_hidden_files[maybe_hidden2-jupyter_server.base.handlers.AuthenticatedFileHandler] - tornado.httpclient.HTTPClientError: HTTP 404: Not Found
FAILED tests/test_files.py::test_hidden_files[maybe_hidden3-jupyter_server.files.handlers.FilesHandler] - tornado.httpclient.HTTPClientError: HTTP 404: Not Found
FAILED tests/test_files.py::test_hidden_files[maybe_hidden3-jupyter_server.base.handlers.AuthenticatedFileHandler] - tornado.httpclient.HTTPClientError: HTTP 404: Not Found
FAILED tests/test_files.py::test_regression_is_hidden[jupyter_server.files.handlers.FilesHandler] - tornado.httpclient.HTTPClientError: HTTP 500: Internal Server Error
FAILED tests/test_files.py::test_regression_is_hidden[jupyter_server.base.handlers.AuthenticatedFileHandler] - tornado.httpclient.HTTPClientError: HTTP 500: Internal Server Error
FAILED tests/test_gateway.py::test_channel_queue_get_msg_without_timeout - TimeoutError: Operation timed out after None seconds
FAILED tests/test_gateway.py::test_websocket_connection_closed - socket.gaierror: [Errno -3] Temporary failure in name resolution
FAILED tests/test_terminal.py::test_terminal_create_with_cwd - TimeoutError: Operation timed out after None seconds
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-GET-/view/{nbpath}-None] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-GET-/api/contents-None] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-POST-/api/contents-{"type": "directory"}] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-PUT-/api/contents/foo-{"type": "directory"}] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-PATCH-/api/contents/{nbpath}-{"path": "/newpath"}] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-DELETE-/api/contents/{nbpath}-None] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-GET-/api/kernels-None] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-GET-/api/kernels/{kernel_id}-None] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-GET-/api/kernels/{kernel_id}/channels-None] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-POST-/api/kernels/{kernel_id}/interrupt-None] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-POST-/api/kernels/{kernel_id}/restart-None] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-DELETE-/api/kernels/{kernel_id}-None] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-POST-/api/kernels-None] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-GET-/api/kernelspecs-None] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-GET-/api/kernelspecs/{kernelspec}-None] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-GET-/api/nbconvert-None] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-GET-/api/spec.yaml-None] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-GET-/api/status-None] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-GET-/api/config/foo-None] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-PUT-/api/config/foo-{}] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-PATCH-/api/config/foo-{}] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-POST-api/security/csp-report-None] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-GET-/api/sessions-None] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-GET-/api/sessions/{session_id}-None] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-PATCH-/api/sessions/{session_id}-{}] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-DELETE-/api/sessions/{session_id}-None] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-POST-/api/sessions-{"path": "foo", "type": "bar"}] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-POST-/api/terminals-] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-GET-/api/terminals-None] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-GET-/terminals/websocket/{term_name}-None] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_authorizer.py::test_authorized_requests[False-DELETE-/api/terminals/{term_name}-None] - tornado.httpclient.HTTPClientError: HTTP 403: Forbidden
FAILED tests/auth/test_legacy_login.py::test_change_password[True] - tornado.httpclient.HTTPClientError: HTTP 302: Found
FAILED tests/auth/test_legacy_login.py::test_change_password[False] - tornado.httpclient.HTTPClientError: HTTP 302: Found
FAILED tests/auth/test_legacy_login.py::test_login_cookie - tornado.httpclient.HTTPClientError: HTTP 302: Found
FAILED tests/auth/test_legacy_login.py::test_logout - tornado.httpclient.HTTPClientError: HTTP 302: Found
FAILED tests/auth/test_login.py::test_next_bad[\\\\tree] - tornado.httpclient.HTTPClientError: HTTP 302: Found
FAILED tests/auth/test_login.py::test_next_bad[//some-host] - tornado.httpclient.HTTPClientError: HTTP 302: Found
FAILED tests/auth/test_login.py::test_next_bad[//host{base_url}tree] - tornado.httpclient.HTTPClientError: HTTP 302: Found
FAILED tests/auth/test_login.py::test_next_bad[https://google.com/] - tornado.httpclient.HTTPClientError: HTTP 302: Found
FAILED tests/auth/test_login.py::test_next_bad[/absolute/not/base_url] - tornado.httpclient.HTTPClientError: HTTP 302: Found
FAILED tests/auth/test_login.py::test_next_ok[tree/] - tornado.httpclient.HTTPClientError: HTTP 302: Found
FAILED tests/auth/test_login.py::test_next_ok[//{base_url}tree] - tornado.httpclient.HTTPClientError: HTTP 302: Found
FAILED tests/auth/test_login.py::test_next_ok[notebooks/notebook.ipynb] - tornado.httpclient.HTTPClientError: HTTP 302: Found
FAILED tests/auth/test_login.py::test_next_ok[tree//something] - tornado.httpclient.HTTPClientError: HTTP 302: Found
FAILED tests/auth/test_login.py::test_login_cookie - tornado.httpclient.HTTPClientError: HTTP 302: Found
FAILED tests/auth/test_login.py::test_change_password[True] - tornado.httpclient.HTTPClientError: HTTP 302: Found
FAILED tests/auth/test_login.py::test_change_password[False] - tornado.httpclient.HTTPClientError: HTTP 302: Found
FAILED tests/auth/test_login.py::test_logout - tornado.httpclient.HTTPClientError: HTTP 302: Found
FAILED tests/services/contents/test_api.py::test_regression_is_hidden[FileContentsManager] - tornado.httpclient.HTTPClientError: HTTP 500: Internal Server Error
FAILED tests/services/contents/test_api.py::test_regression_is_hidden[AsyncFileContentsManager] - tornado.httpclient.HTTPClientError: HTTP 500: Internal Server Error
FAILED tests/services/contents/test_fileio.py::test_async_file_manager_mixin - jsonschema.exceptions.ValidationError: Notebook could not be converted from version 1 to version 2 because it's missing a key: cells
FAILED tests/services/kernels/test_cull.py::test_cull_idle[jp_server_config0] - tornado.httpclient.HTTPClientError: HTTP 404: Not Found
FAILED tests/services/kernels/test_cull.py::test_cull_idle[jp_server_config1] - tornado.httpclient.HTTPClientError: HTTP 404: Not Found
FAILED tests/services/kernels/test_cull.py::test_cull_dead[jp_server_config0] - tornado.httpclient.HTTPClientError: HTTP 404: Not Found

@blink1073
Copy link
Contributor Author

I kicked the job to see what it does on the second run.

@blink1073
Copy link
Contributor Author

Same result on a re-run.

@blink1073
Copy link
Contributor Author

All tests are now passing on the first try, I'm guessing due to the 3.12b2 release.

@blink1073 blink1073 merged commit 8c2987f into jupyter-server:main Jun 19, 2023
@blink1073 blink1073 deleted the test-against-3.12 branch June 19, 2023 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants