Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

typing upgrade to 3.13.2#5590

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
youknowone merged 23 commits intoRustPython:mainfromarihant2math:typing-unpack
Apr 27, 2025
Merged

Conversation

arihant2math
Copy link
Collaborator

@arihant2matharihant2math commentedMar 9, 2025
edited
Loading

Fixes:#5584#5252
Closes:#4946

theoparis and starpit reacted with rocket emoji
@morealmoreal mentioned this pull requestMar 10, 2025
@arihant2matharihant2math marked this pull request as draftMarch 24, 2025 04:58
@youknowone
Copy link
Member

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

@arihant2math
Copy link
CollaboratorAuthor

Rebasing has lead to an import error/compiler panic.

@youknowone
Copy link
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?

@arihant2matharihant2math mentioned this pull requestMar 31, 2025
@arihant2math
Copy link
CollaboratorAuthor

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

@arihant2math
Copy link
CollaboratorAuthor

Oh wait I can just break that import statement :D

@arihant2math
Copy link
CollaboratorAuthor

arihant2math commentedApr 5, 2025
edited
Loading

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

@arihant2math
Copy link
CollaboratorAuthor

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

@youknowone
Copy link
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 GenericTraceback (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'])

@youknowone
Copy link
Member

youknowone commentedApr 22, 2025
edited
Loading

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

@youknowone
Copy link
Member

youknowone commentedApr 22, 2025
edited
Loading

Reproducible code

importtypingfromtypingimportContextManager,Generic,TextIO,BinaryIO_I=typing.TypeVar("_I",TextIO,BinaryIO)class_ReadContext(ContextManager[_I],Generic[_I]):pass

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
@arihant2math
Copy link
CollaboratorAuthor

Great, that's fixed.

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
@arihant2math
Copy link
CollaboratorAuthor

Finally, it all works.
Ready for review.

theoparis reacted with rocket emoji

@arihant2math
Copy link
CollaboratorAuthor

@youknowone do you mind reviewing please?

@youknowone
Copy link
Member

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

@youknowoneyouknowone merged commitd46bcd9 intoRustPython:mainApr 27, 2025
21 of 22 checks passed
@arihant2matharihant2math deleted the typing-unpack branchApril 27, 2025 06:44
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@youknowoneyouknowoneyouknowone approved these changes

@coolreader18coolreader18Awaiting requested review from coolreader18

Assignees
No one assigned
Labels
A-stdlibcpythonCPython 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
2 participants
@arihant2math@youknowone

[8]ページ先頭

©2009-2025 Movatter.jp