GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — typing upgrade to 3.13.2 by arihant2math · Pull Request #5590 · RustPython/RustPython

Conversation

@arihant2math

@arihant2math arihant2math commented Mar 9, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Fixes: #5584 #5252
Closes: #4946

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

theoparis and starpit reacted with rocket emoji
All reactions
  • 🚀 2 reactions
@moreal moreal mentioned this pull request Mar 10, 2025
Complement TypeAliasType #5486
Closed
@arihant2math
arihant2math marked this pull request as draft March 24, 2025 04:58
@youknowone

youknowone commented Mar 30, 2025

Copy link
Copy Markdown
Member

The failing tests are unexpected success. Removing expectedFailure will fix them

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@arihant2math
arihant2math force-pushed the typing-unpack branch from aec2557 to b920ff8 Compare March 30, 2025 18:18
@arihant2math arihant2math mentioned this pull request Mar 30, 2025
Update Python libraries and tests from Python 3.13 #5529
Closed
@arihant2math

arihant2math commented Mar 30, 2025

Copy link
Copy Markdown
Contributor Author

Rebasing has lead to an import error/compiler panic.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@youknowone

youknowone commented Mar 31, 2025

Copy link
Copy Markdown
Member

That's because _py_exception_group.py is recently merged.
It uses those features form typing:

from typing import TYPE_CHECKING, Generic, Type, TypeVar, cast, overload

Any chance to break one of them?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@arihant2math arihant2math mentioned this pull request Mar 31, 2025
Update typing to 3.12 #5252
Closed
@arihant2math

arihant2math commented Mar 31, 2025

Copy link
Copy Markdown
Contributor Author

hmmm. Blocking on #5622, so I can rewrite that in rust.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@arihant2math

arihant2math commented Apr 5, 2025

Copy link
Copy Markdown
Contributor Author

Oh wait I can just break that import statement :D

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@arihant2math

arihant2math commented Apr 5, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Blocked on #5628 so I can atleast partially fix codegen.
(I need to use unit tests to see disassembly output)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Apr 14, 2025
stdlib compatability checking scripts #5697
Merged
feat: add typing.Self #5710
Closed
TypeError: '|' not supported between instances of '_CallableGenericAlias' and 'NoneType' #5711
Closed
@arihant2math
arihant2math marked this pull request as ready for review April 18, 2025 04:05
@arihant2math

arihant2math commented Apr 18, 2025

Copy link
Copy Markdown
Contributor Author

One minor issue ... the pip install needs to be fixed. I can't really replicate on my machine because I'm on windows.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

arihant2math added 14 commits April 18, 2025 13:27
@arihant2math
typing.NoDefault
fd0e2d0
@arihant2math
typing upgrade to 3.13
801193d
@arihant2math
minor fix
0ed9535
@arihant2math
compile fix
8a41e95
@arihant2math
formatting
af318d1
@arihant2math
fix tests
4b95a52
@arihant2math
formatting
2e50773
@arihant2math
fix test_future_stmt
a8996ee
@arihant2math
fix importlib tests
afb8b34
@arihant2math
unmark working tests
2f4afab
@arihant2math
fix run
dc3a7eb
Signed-off-by: Ashwin Naren <[email protected]>
@arihant2math
fix test
bec6580
@arihant2math
fix more tests
c61e823
@arihant2math
fix panic
524eb96
@arihant2math
implement more of ParamSpec
1b3ac3f
@arihant2math
arihant2math force-pushed the typing-unpack branch from 0f5af35 to 1b3ac3f Compare April 18, 2025 20:28
@arihant2math arihant2math added A-stdlib cpython CPython source code related labels Apr 21, 2025
@arihant2math
arihant2math force-pushed the typing-unpack branch from f30ec34 to 1b3ac3f Compare April 21, 2025 19:49
@arihant2math
fix spelling
78d753e
@youknowone

youknowone commented Apr 22, 2025

Copy link
Copy Markdown
Member

resolve_mro fails

Traceback (most recent call last):
  File "<stdin>", line 6, in <module>
  File "~/Projects/RustPython/pylib/Lib/runpy.py", line 224, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "~/Projects/RustPython/pylib/Lib/runpy.py", line 94, in _run_module_code
    with _TempModule(mod_name) as temp_module, _ModifiedArgv0(fname):
  File "~/Projects/RustPython/pylib/Lib/runpy.py", line 97, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "~/Projects/RustPython/pylib/Lib/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/var/folders/4l/db5by6f97gl8z692_wckqb3w0000gn/T/tmpp0rarl2n/pip-23.2.1-py3-none-any.whl/pip/__main__.py", line 24, in <module>
  File "/var/folders/4l/db5by6f97gl8z692_wckqb3w0000gn/T/tmpp0rarl2n/pip-23.2.1-py3-none-any.whl/pip/_internal/cli/main.py", line 77, in main
  File "/var/folders/4l/db5by6f97gl8z692_wckqb3w0000gn/T/tmpp0rarl2n/pip-23.2.1-py3-none-any.whl/pip/_internal/commands/__init__.py", line 114, in create_command
  File "~/Projects/RustPython/pylib/Lib/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "_frozen_importlib", line 1382, in _gcd_import
  File "_frozen_importlib", line 1352, in _find_and_load
  File "_frozen_importlib", line 1355, in _find_and_load
  File "_frozen_importlib", line 1329, in _find_and_load_unlocked
  File "_frozen_importlib", line 1326, in _find_and_load_unlocked
  File "_frozen_importlib", line 1326, in _find_and_load_unlocked
  File "_frozen_importlib", line 945, in _load_unlocked
  File "_frozen_importlib", line 943, in _load_unlocked
  File "_frozen_importlib", line 936, in _load_unlocked
  File "_frozen_importlib", line 930, in _load_unlocked
  File "_frozen_importlib_external", line 994, in exec_module
  File "_frozen_importlib", line 488, in _call_with_frames_removed
  File "/var/folders/4l/db5by6f97gl8z692_wckqb3w0000gn/T/tmpp0rarl2n/pip-23.2.1-py3-none-any.whl/pip/_internal/commands/install.py", line 15, in <module>
  File "/var/folders/4l/db5by6f97gl8z692_wckqb3w0000gn/T/tmpp0rarl2n/pip-23.2.1-py3-none-any.whl/pip/_internal/cli/req_command.py", line 26, in <module>
  File "/var/folders/4l/db5by6f97gl8z692_wckqb3w0000gn/T/tmpp0rarl2n/pip-23.2.1-py3-none-any.whl/pip/_internal/operations/prepare.py", line 32, in <module>
  File "/var/folders/4l/db5by6f97gl8z692_wckqb3w0000gn/T/tmpp0rarl2n/pip-23.2.1-py3-none-any.whl/pip/_internal/network/download.py", line 11, in <module>
  File "/var/folders/4l/db5by6f97gl8z692_wckqb3w0000gn/T/tmpp0rarl2n/pip-23.2.1-py3-none-any.whl/pip/_internal/cli/progress_bars.py", line 4, in <module>
  File "/var/folders/4l/db5by6f97gl8z692_wckqb3w0000gn/T/tmpp0rarl2n/pip-23.2.1-py3-none-any.whl/pip/_vendor/rich/progress.py", line 273, in <module>
  File "~/Projects/RustPython/pylib/Lib/_py_abc.py", line 36, in __new__
    cls = super().__new__(mcls, name, bases, namespace, **kwargs)
TypeError: duplicate base class Generic
Traceback (most recent call last):
  File "~/Projects/RustPython/pylib/Lib/runpy.py", line 197, in _run_module_as_main
    "__main__", mod_spec)
  File "~/Projects/RustPython/pylib/Lib/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "~/Projects/RustPython/pylib/Lib/ensurepip/__main__.py", line 5, in <module>
    sys.exit(ensurepip._main())
  File "~/Projects/RustPython/pylib/Lib/ensurepip/__init__.py", line 290, in _main
    default_pip=args.default_pip,
  File "~/Projects/RustPython/pylib/Lib/ensurepip/__init__.py", line 167, in _bootstrap
    with tempfile.TemporaryDirectory() as tmpdir:
  File "~/Projects/RustPython/pylib/Lib/ensurepip/__init__.py", line 200, in _bootstrap
    return _run_pip([*args, *_PACKAGE_NAMES], additional_paths)
  File "~/Projects/RustPython/pylib/Lib/ensurepip/__init__.py", line 101, in _run_pip
    return subprocess.run(cmd, check=True).returncode
  File "~/Projects/RustPython/pylib/Lib/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
  File "~/Projects/RustPython/pylib/Lib/subprocess.py", line 572, in run
    output=stdout, stderr=stderr)
CalledProcessError: (1, ['~/Projects/RustPython/target/debug/rustpython', '-W', 'ignore::DeprecationWarning', '-c', '\nimport runpy\nimport sys\nsys.path = [\'/var/folders/4l/db5by6f97gl8z692_wckqb3w0000gn/T/tmpp0rarl2n/pip-23.2.1-py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'/var/folders/4l/db5by6f97gl8z692_wckqb3w0000gn/T/tmpp0rarl2n\', \'--upgrade\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n'])
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@youknowone youknowone closed this Apr 22, 2025
@youknowone youknowone reopened this Apr 22, 2025
@youknowone

youknowone commented Apr 22, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

While creating a class _ReadContext, it takes 3 bases but 2 of them are Generic:

new heap type: _ReadContext
-- start resolve_mro for:AbstractContextManager, Generic, Generic, 
   base: AbstractContextManager
   base: Generic
   base: Generic

The class is this one: https://github.com/pypa/pip/blob/24f4600851bbb3d7f22aed0ba6b1e2dcc4973412/src/pip/_vendor/rich/progress.py#L287-L305

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@arihant2math
fix typing patch
22dc26e
@youknowone

youknowone commented Apr 22, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Reproducible code

import typing
from typing import ContextManager, Generic, TextIO, BinaryIO
_I = typing.TypeVar("_I", TextIO, BinaryIO)
class _ReadContext(ContextManager[_I], Generic[_I]):
    pass
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

arihant2math added 2 commits April 22, 2025 09:44
@arihant2math
patch _py_abc.py to fix pip
092556a
Signed-off-by: Ashwin Naren <[email protected]>
@arihant2math
mark unexpected successes in test_typing
1512130
Signed-off-by: Ashwin Naren <[email protected]>
@arihant2math

arihant2math commented Apr 22, 2025

Copy link
Copy Markdown
Contributor Author

Great, that's fixed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@arihant2math
arihant2math force-pushed the typing-unpack branch from 812d987 to 7ac2650 Compare April 22, 2025 17:57
@arihant2math
implement _idfunc
53d3960
Signed-off-by: Ashwin Naren <[email protected]>
@arihant2math
arihant2math force-pushed the typing-unpack branch from 7ac2650 to 53d3960 Compare April 22, 2025 18:05
@arihant2math
mark expected failures
e98c2fa
@arihant2math

arihant2math commented Apr 22, 2025

Copy link
Copy Markdown
Contributor Author

Finally, it all works.
Ready for review.

theoparis reacted with rocket emoji
All reactions
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@arihant2math
arihant2math requested review from coolreader18 and youknowone April 22, 2025 19:09
@arihant2math arihant2math mentioned this pull request Apr 23, 2025
3.13 Python Library update PRs #5736
Closed
@arihant2math

arihant2math commented Apr 24, 2025

Copy link
Copy Markdown
Contributor Author

@youknowone do you mind reviewing please?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

youknowone
youknowone approved these changes Apr 24, 2025
View reviewed changes
Comment thread vm/src/stdlib/typing.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@youknowone
Update vm/src/stdlib/typing.rs
b5789b4
@youknowone

youknowone commented Apr 24, 2025

Copy link
Copy Markdown
Member

Even though there are regressions, merging this have benefits to fix pip

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@arihant2math arihant2math mentioned this pull request Apr 24, 2025
Update ensurepip from CPython 3.13.9 #5740
Merged
@youknowone
youknowone merged commit d46bcd9 into RustPython:main Apr 27, 2025
@arihant2math
arihant2math deleted the typing-unpack branch April 27, 2025 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@youknowone youknowone youknowone approved these changes
@coolreader18 coolreader18 Awaiting requested review from coolreader18

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

A-stdlib cpython CPython source code related

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AttributeError when using pip==25.0.1

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@arihant2math @youknowone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.