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

Run stubtest on py313 in CI #11987

Merged
merged 12 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ env:
jobs:
stubtest-stdlib:
name: Check stdlib with stubtest
# TODO: run on py313 with other platforms
AlexWaygood marked this conversation as resolved.
Show resolved Hide resolved
if: ${{ github.repository == 'python/typeshed' || github.event_name == 'workflow_dispatch' }}
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -55,6 +56,24 @@ jobs:
- name: Run stubtest
run: python tests/stubtest_stdlib.py

stubtest-stdlib-py313:
name: Check py313 stdlib with stubtest
# TODO: get it passing on all platforms and add it to the main matrix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.13
cache: pip
cache-dependency-path: requirements-tests.txt
allow-prereleases: true
check-latest: true
- name: Install dependencies
run: pip install -r requirements-tests.txt
- name: Run stubtest
run: python tests/stubtest_stdlib.py

stubtest-third-party:
name: Check third party stubs with stubtest
if: ${{ github.repository == 'python/typeshed' || github.event_name == 'workflow_dispatch' }}
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/stubtest_stdlib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,21 @@ jobs:
run: pip install -r requirements-tests.txt
- name: Run stubtest
run: python tests/stubtest_stdlib.py

stubtest-stdlib-py313:
name: Check py313 stdlib with stubtest
# TODO: get it passing on all platforms and add it to the main matrix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.13
cache: pip
cache-dependency-path: requirements-tests.txt
allow-prereleases: true
check-latest: true
- name: Install dependencies
run: pip install -r requirements-tests.txt
- name: Run stubtest
run: python tests/stubtest_stdlib.py
51 changes: 0 additions & 51 deletions stdlib/@tests/stubtest_allowlists/common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,6 @@ ipaddress._BaseAddress.is_unspecified
ipaddress._BaseAddress.max_prefixlen
ipaddress._BaseAddress.packed
ipaddress._BaseNetwork.max_prefixlen
lib2to3.pygram.pattern_symbols
lib2to3.pygram.python_symbols
lib2to3.pytree.Base.__new__
lib2to3.pytree.Base.children
lib2to3.pytree.Base.type
lib2to3.pytree.BasePattern.__new__
lib2to3.pytree.BasePattern.type
lib2to3.pytree.NegatedPattern.match
lib2to3.pytree.NegatedPattern.match_seq
multiprocessing.JoinableQueue
multiprocessing.Queue
multiprocessing.SimpleQueue
Expand Down Expand Up @@ -118,9 +109,6 @@ tarfile.TarFile.errors # errors is initialized for some reason as None even tho
tkinter.simpledialog.[A-Z_]+
tkinter.simpledialog.TclVersion
tkinter.simpledialog.TkVersion
tkinter.tix.[A-Z_]+
tkinter.tix.TclVersion
tkinter.tix.TkVersion
tkinter.Misc.after # we intentionally don't allow everything that "works" at runtime
traceback.TracebackException.from_exception # explicitly expanding arguments going into TracebackException __init__
typing(_extensions)?\.IO\.__next__ # Added because IO streams are iterable. See https://github.com/python/typeshed/commit/97bc450acd60c1bcdafef3ce8fbe3b95a9c0cac3
Expand Down Expand Up @@ -186,9 +174,6 @@ encodings.utf_7
encodings.uu_codec
encodings.zlib_codec
json.scanner
lib2to3.btm_utils
lib2to3.fixer_util
lib2to3.patcomp
sqlite3.dump
turtledemo
turtledemo\..+
Expand Down Expand Up @@ -217,7 +202,6 @@ ctypes.ARRAY
ctypes.SetPointerType
ctypes.c_voidp
ctypes.util.test
lib2to3.pgen2.grammar.Grammar.loads
mimetypes.MimeTypes.add_type
modulefinder.test
multiprocessing.managers.Server.accepter
Expand Down Expand Up @@ -250,22 +234,6 @@ multiprocessing.pool.ThreadPool.Process
multiprocessing.synchronize.Semaphore.get_value
tkinter.Misc.config
tkinter.font.Font.counter
tkinter.tix.CObjView
tkinter.tix.DialogShell
tkinter.tix.ExFileSelectDialog
tkinter.tix.FileSelectDialog
tkinter.tix.FileTypeList
tkinter.tix.Grid
tkinter.tix.NoteBookFrame
tkinter.tix.OptionName
tkinter.tix.ResizeHandle
tkinter.tix.ScrolledGrid
tkinter.tix.ScrolledHList
tkinter.tix.ScrolledListBox
tkinter.tix.ScrolledTList
tkinter.tix.ScrolledText
tkinter.tix.ScrolledWindow
tkinter.tix.Shell
turtle.TNavigator.speed

# Undocumented implementation details of a deprecated class
Expand All @@ -285,27 +253,13 @@ profile.Profile.trace_dispatch_i
profile.Profile.trace_dispatch_l
profile.Profile.trace_dispatch_mac
profile.Profile.trace_dispatch_return
cgi.FieldStorage.bufsize
cgi.FieldStorage.read_binary
cgi.FieldStorage.read_lines
cgi.FieldStorage.read_lines_to_eof
cgi.FieldStorage.read_lines_to_outerboundary
cgi.FieldStorage.read_multi
cgi.FieldStorage.read_single
cgi.FieldStorage.read_urlencoded
cgi.FieldStorage.skip_lines
email.contentmanager.get_and_fixup_unknown_message_content
email.contentmanager.get_message_content
email.contentmanager.get_non_text_content
email.contentmanager.get_text_content
email.contentmanager.set_bytes_content
email.contentmanager.set_message_content
email.contentmanager.set_text_content
pipes.Template.makepipeline
pipes.Template.open_r
pipes.Template.open_w
sunau.Au_read.initfp
sunau.Au_write.initfp
turtle.ScrolledCanvas.adjustScrolls
turtle.ScrolledCanvas.onResize
wave.Wave_read.initfp
Expand Down Expand Up @@ -442,11 +396,9 @@ multiprocessing.managers.BaseListProxy.reverse
multiprocessing.managers.BaseListProxy.sort
multiprocessing.managers.DictProxy.__iter__
multiprocessing.managers.DictProxy.__len__
multiprocessing.managers.DictProxy.clear
multiprocessing.managers.DictProxy.copy
multiprocessing.managers.DictProxy.items
multiprocessing.managers.DictProxy.keys
multiprocessing.managers.DictProxy.popitem
multiprocessing.managers.DictProxy.values

multiprocessing.(dummy|managers).Namespace.__[gs]etattr__ # Any field can be set on Namespace
Expand Down Expand Up @@ -484,7 +436,6 @@ typing\.Protocol
typing(_extensions)?\._TypedDict

# Special primitives
typing_extensions\.Annotated
typing_extensions\.Final
typing_extensions\.NamedTuple
typing_extensions\.LiteralString
Expand Down Expand Up @@ -564,9 +515,7 @@ sys.implementation # Actually SimpleNamespace but then you wouldn't have conven

# A factory function that returns 'most efficient lock'.
# Marking it as a function will make it impossible for users to use the Lock type as an annotation.
threading.Lock
threading.RLock
multiprocessing.dummy.Lock
multiprocessing.dummy.RLock

# Dynamically created, has unnecessary *args
Expand Down
6 changes: 6 additions & 0 deletions stdlib/@tests/stubtest_allowlists/darwin-py310.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
webbrowser.MacOSX.__init__

# Doesn't exist on macos:
spwd
msilib(.[a-z]+)?
ossaudiodev
7 changes: 7 additions & 0 deletions stdlib/@tests/stubtest_allowlists/darwin-py311.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
webbrowser.MacOSX.__init__

# These entries looks like a `setup-python` bug:
(dbm.gnu)?
(_?locale.bind_textdomain_codeset)?
Expand All @@ -6,3 +8,8 @@
(_?locale.dgettext)?
(_?locale.gettext)?
(_?locale.textdomain)?

# Doesn't exist on macos:
spwd
msilib(.[a-z]+)?
ossaudiodev
7 changes: 7 additions & 0 deletions stdlib/@tests/stubtest_allowlists/darwin-py312.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
webbrowser.MacOSX.__init__

# TODO: fix
_curses.unget_wch
_curses.window.get_wch
Expand All @@ -11,3 +13,8 @@ curses.window.get_wch
(_?locale.dgettext)?
(_?locale.gettext)?
(_?locale.textdomain)?

# Doesn't exist on macos:
spwd
msilib(.[a-z]+)?
ossaudiodev
39 changes: 39 additions & 0 deletions stdlib/@tests/stubtest_allowlists/darwin-py313.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# new in py313
fcntl.F_GETNOSIGPIPE
fcntl.F_OFD_GETLK
fcntl.F_OFD_SETLK
fcntl.F_OFD_SETLKW
fcntl.F_RDAHEAD
fcntl.F_SETNOSIGPIPE
mmap.MAP_HASSEMAPHORE
mmap.MAP_JIT
mmap.MAP_NOCACHE
mmap.MAP_NOEXTEND
mmap.MAP_RESILIENT_CODESIGN
mmap.MAP_RESILIENT_MEDIA
mmap.MAP_TPRO
mmap.MAP_TRANSLATED_ALLOW_EXECUTE
mmap.MAP_UNIX03
os.waitid
os.waitid_result
posix.waitid
posix.waitid_result
time.CLOCK_MONOTONIC_RAW_APPROX
time.CLOCK_UPTIME_RAW_APPROX
webbrowser.MacOSX
_curses.A_ITALIC
_decimal.DecimalTuple.__replace__

# TODO: fix
_curses.unget_wch
_curses.window.get_wch
curses.window.get_wch

# These entries looks like a `setup-python` bug:
(dbm.gnu)?
(_?locale.bind_textdomain_codeset)?
(_?locale.bindtextdomain)?
(_?locale.dcgettext)?
(_?locale.dgettext)?
(_?locale.gettext)?
(_?locale.textdomain)?
6 changes: 6 additions & 0 deletions stdlib/@tests/stubtest_allowlists/darwin-py38.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
webbrowser.MacOSX.__init__

# Doesn't exist on macos:
spwd
msilib(.[a-z]+)?
ossaudiodev
6 changes: 6 additions & 0 deletions stdlib/@tests/stubtest_allowlists/darwin-py39.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
webbrowser.MacOSX.__init__

# Doesn't exist on macos:
spwd
msilib(.[a-z]+)?
ossaudiodev
5 changes: 0 additions & 5 deletions stdlib/@tests/stubtest_allowlists/darwin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ _ctypes.dlclose
_ctypes.dlopen
_ctypes.dlsym

webbrowser.MacOSX.__init__

# ==========
# Allowlist entries that cannot or should not be fixed
# ==========
Expand All @@ -38,13 +36,10 @@ _msi
_winapi
asyncio.windows_events
asyncio.windows_utils
msilib(.[a-z]+)?
msvcrt
nt
winreg
winsound
ossaudiodev
spwd

# multiprocessing.popen_spawn_win32 exists on Darwin but fail to import
multiprocessing.popen_spawn_win32
Expand Down
6 changes: 6 additions & 0 deletions stdlib/@tests/stubtest_allowlists/linux-py310.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Exists at runtime, but missing from stubs
spwd.struct_spwd.sp_nam
spwd.struct_spwd.sp_pwd

# doesn't exist on linux
msilib(.[a-z]+)?
6 changes: 6 additions & 0 deletions stdlib/@tests/stubtest_allowlists/linux-py311.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Exists at runtime, but missing from stubs
spwd.struct_spwd.sp_nam
spwd.struct_spwd.sp_pwd

# doesn't exist on linux
msilib(.[a-z]+)?
7 changes: 7 additions & 0 deletions stdlib/@tests/stubtest_allowlists/linux-py312.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Exists on some Linux builds, and is documented,
# but is unavailable in Github Actions on Linux with Python 3.12
(os|posix).CLONE_NEWTIME

# Exists at runtime, but missing from stubs
spwd.struct_spwd.sp_nam
spwd.struct_spwd.sp_pwd

# doesn't exist on linux
msilib(.[a-z]+)?
Loading
Loading