Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 560b10dc57efbcd25a76b08c39bd6952830605c7
      
https://github.com/WebKit/WebKit/commit/560b10dc57efbcd25a76b08c39bd6952830605c7
  Author: Elliott Williams <[email protected]>
  Date:   2026-10-08 (Thu, 08 Oct 2026)

  Changed paths:
    M Tools/Scripts/libraries/webkitcorepy/MANIFEST.in
    A Tools/Scripts/libraries/webkitcorepy/mypy.ini
    M Tools/Scripts/libraries/webkitcorepy/setup.py
    M Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py
    M Tools/Scripts/libraries/webkitcorepy/webkitcorepy/call_by_need.py
    M Tools/Scripts/libraries/webkitcorepy/webkitcorepy/decorators.py
    M Tools/Scripts/libraries/webkitcorepy/webkitcorepy/filtered_call.py
    M Tools/Scripts/libraries/webkitcorepy/webkitcorepy/mocks/__init__.py
    M Tools/Scripts/libraries/webkitcorepy/webkitcorepy/null_context.py
    A Tools/Scripts/libraries/webkitcorepy/webkitcorepy/py.typed
    M 
Tools/Scripts/libraries/webkitcorepy/webkitcorepy/skill_testing/__init__.py
    M Tools/Scripts/libraries/webkitcorepy/webkitcorepy/string_utils.py
    M Tools/Scripts/libraries/webkitcorepy/webkitcorepy/testing/__init__.py
    A Tools/Scripts/libraries/webkitcorepy/webkitcorepy/testing/type_checking.py
    A Tools/Scripts/libraries/webkitcorepy/webkitcorepy/tests/mypy_unittest.py
    M Tools/Scripts/libraries/webkitcorepy/webkitcorepy/version.py
    M Tools/Scripts/webkitpy/test/main.py

  Log Message:
  -----------
  [webkitcorepy] Add a mypy test and type annotations for core decorators and 
proxies
https://bugs.webkit.org/show_bug.cgi?id=326850

Reviewed by Jonathan Bedard.

Type-check webkitcorepy with mypy in --strict mode, and annotate the
modules that the rest of webkitcorepy (and webkitbugspy and webkitscmpy) build
on. Includes the core decorators and proxy objects.

Of note, memoized functions keep their return types but accept any
arguments, since Memoize injects `cached` and `timeout` keyword
arguments. Memoize now uses functools.wraps, so memoized functions keep
their name and docstring, and expose the function they wrap as
__wrapped__.

Modules that have not been annotated yet are listed in mypy.ini with
ignore_errors, and will be removed from that list as they're annotated.

The test runs mypy through webkitcorepy.testing.run_mypy, which webkitcorepy,
webkitbugspy, and webkitscmpy will share. Move the autoinstaller
registration of mypy and its dependencies from webkitpy.

AutoInstall can't install typeshed's stub-only packages (their
versions have more components than it parses), so packages whose types come
from those (requests, yaml, six, urllib3) are treated as untyped, even where
their stubs happen to be installed.

Strict mode forbids implicit re-exports, so declare __all__ for webkitcorepy,
webkitcorepy.testing, and webkitcorepy.skill_testing, listing the names they
already export.

Bump webkitcorepy to 1.0.6.

* Tools/Scripts/libraries/webkitcorepy/MANIFEST.in:
* Tools/Scripts/libraries/webkitcorepy/mypy.ini: Added.
* Tools/Scripts/libraries/webkitcorepy/setup.py:
* Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py:
* Tools/Scripts/libraries/webkitcorepy/webkitcorepy/call_by_need.py:
(CallByNeed.__init__):
(CallByNeed.__getattribute__):
(CallByNeed.value):
(CallByNeed.__call__):
(CallByNeed.__repr__):
(CallByNeed.__str__):
* Tools/Scripts/libraries/webkitcorepy/webkitcorepy/decorators.py:
(Memoized):
(Memoized.__call__):
(Memoized.clear):
(Memoize.__init__):
(Memoize.__call__):
(Memoize.__call__.decorator):
(Memoize.clear):
(hybridmethod):
(hybridmethod.__init__):
(hybridmethod.__get__):
(hybridmethod.__get__.wrapper):
* Tools/Scripts/libraries/webkitcorepy/webkitcorepy/filtered_call.py:
(filtered_call):
* Tools/Scripts/libraries/webkitcorepy/webkitcorepy/mocks/__init__.py:
(_lazy):
(__getattr__):
(__dir__):
* Tools/Scripts/libraries/webkitcorepy/webkitcorepy/null_context.py:
(NullContext.__bool__):
(NullContext.__nonzero__):
(NullContext.__enter__):
(NullContext.__exit__):
* Tools/Scripts/libraries/webkitcorepy/webkitcorepy/py.typed: Added.
* Tools/Scripts/libraries/webkitcorepy/webkitcorepy/skill_testing/__init__.py:
* Tools/Scripts/libraries/webkitcorepy/webkitcorepy/string_utils.py:
(encode):
(decode):
(ordinal):
(pluralize):
(join):
(split):
(out_of):
(elapsed):
* Tools/Scripts/libraries/webkitcorepy/webkitcorepy/testing/__init__.py:
* Tools/Scripts/libraries/webkitcorepy/webkitcorepy/testing/type_checking.py: 
Added.
(run_mypy):
* Tools/Scripts/libraries/webkitcorepy/webkitcorepy/tests/mypy_unittest.py: 
Added.
(TypeAnnotations):
(TypeAnnotations.test_mypy):
* Tools/Scripts/libraries/webkitcorepy/webkitcorepy/version.py:
(Version.from_string):
(Version.from_iterable):
(Version.from_name):
(Version.__init__):
(Version.__len__):
(Version.__iter__):
(Version.__getitem__):
(Version.__setitem__):
(Version.matches):
(Version._strip_zeros):
(Version.__contains__):
(Version.__str__):
(Version.__repr__):
(Version.__hash__):
(Version.__eq__):
(Version.__lt__):
(Version.__le__):
(Version.__gt__):
(Version.__ge__):
* Tools/Scripts/webkitpy/test/main.py:
(main):

Canonical link: https://commits.webkit.org/323165@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to