Ben Darnell [Sun, 9 Apr 2023 21:31:38 +0000 (21:31 +0000)]
ci: Update build workflow
Build wheels for Python 3.12 as well.
Update various dependencies. The upload/download artifact actions
were using deprecated versions, and we were using a deprecated
macos build image. While we're at it, update the other OS versions
and cibuildwheel.
Ben Darnell [Sat, 8 Apr 2023 19:42:05 +0000 (19:42 +0000)]
typing: Eagerly import all submodules in __init__.pyi
This makes the auto-import functionality compatible with mypy
and other typing-based tools such as autocomplete functionality.
Excluding these imports from static typing feels like a premature
optimization and made it much less appealing to make use of the
auto-imports.
This may slow down type checking of applications that use Tornado by
a little, since the type checker must now process all of Tornado and
not only the subset that was imported. However, the increasing use
of long-lived daemons for type checkers should mitigate this cost.
Ben Darnell [Wed, 15 Feb 2023 21:23:32 +0000 (21:23 +0000)]
wsgi: Set multithread flag correctly
Required making WSGIContainer.environ() an instance method.
This is technically a backwards-incompatible change to a documented
method but it was never really meant to be documented and seems
unlikely to be used.
Ben Darnell [Wed, 8 Feb 2023 20:12:47 +0000 (20:12 +0000)]
asyncio: Remove obsolete code
AsyncioLoop.start() used to save, set, and restore the thread-local
event loop. This avoided some edge cases in early versions of asyncio;
this appears to no longer be necessary since Python 3.7 introduced
the get_running_loop() method.
Removing this logic improves compatibility with Python 3.12, where
it is difficult if not impossible to do the same thing without
generating DeprecationWarnings.
Ben Darnell [Sat, 28 Jan 2023 19:10:16 +0000 (19:10 +0000)]
web: List all set_cookie arguments instead of kwargs
Multiple arguments needed special cases anyway, so it's better to
just be explicit about what's supported.
set_signed_cookie still uses kwarg forwarding since we don't need
to worry about the special cases at this level and using
explicit arguments would involve duplicating defaults in multiple
places.
Ben Darnell [Mon, 23 Jan 2023 18:51:53 +0000 (18:51 +0000)]
web: Rename "secure_cookie" methods to "signed_cookie"
This more precisely states the kind of security that is provided, and
avoids confusion with the use of the word "secure" as a standard
cookie attribute and prefix.
Ben Darnell [Fri, 20 Jan 2023 20:05:50 +0000 (20:05 +0000)]
Update most deps
Sphinx is pinned to <6 because of a conflict with sphinx_rtd_theme
Tox is pinned to <4 because we're affected by some backwards-incompatible
renamings in the config file.
Ben Darnell [Fri, 20 Jan 2023 19:51:28 +0000 (19:51 +0000)]
Consolidate maint and docs requirements files
This division was just complicating things unnecessarily.
Also adopt pip-tools instead of doing it all by hand.
No pinned versions have been changed in this commit.
Ben Darnell [Fri, 16 Dec 2022 20:52:15 +0000 (15:52 -0500)]
ci: Skip python 3.12 for now
The breaking changes begun by the deprecation warnings in 3.10 have
arrived, but according to https://github.com/python/cpython/issues/93453
the scope has changed somewhat (for the better, I think). Don't test
on 3.12 until we've adapted to the new plan.
Ben Darnell [Sun, 27 Nov 2022 20:06:08 +0000 (15:06 -0500)]
all: Support lazy imports of submodules
A getattr hook in the top-level "tornado" package now imports submodules
automatically, eliminating the need to explicitly reference multiple submodules
in imports
Ben Darnell [Sun, 27 Nov 2022 02:50:04 +0000 (21:50 -0500)]
testing: Deprecate environment-dependent behavior in ExpectLog
ExpectLog is sensitive to the difference between tornado.testing.main
(which sets the logging level to info) and most other test runners,
which do not. In the future ExpectLog will match WARNING and above
by default; matching lower levels without using the ``level`` argument
is deprecated.
Fix one test in httpserver_test.py that is affected by this.
Ben Darnell [Sat, 19 Nov 2022 22:20:33 +0000 (17:20 -0500)]
setup: Drop support for python 3.7
The main reason to drop this version before it reaches its EOL is so
that we can begin to use unittest.IsolatedAsyncioTestCase to replace
deprecated portions of the tornado.testing module.
A secondary reason is that Python 3.8 introduced support for the
samesite cookie attribute, which allows us to deprecate the
xsrf_token mechanism.