-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Don't run whats_left with older CPython versions #4847
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,8 +34,9 @@ | |
|
|
||
| implementation = platform.python_implementation() | ||
| if implementation != "CPython": | ||
| sys.exit("whats_left.py must be run under CPython, got {implementation} instead") | ||
|
|
||
| sys.exit(f"whats_left.py must be run under CPython, got {implementation} instead") | ||
| if sys.version_info[:2] < (3, 11): | ||
| sys.exit(f"whats_left.py must be run under CPython 3.11 or newer, got {implementation} {sys.version} instead") | ||
|
|
||
| def parse_args(): | ||
| parser = argparse.ArgumentParser(description="Process some integers.") | ||
|
|
@@ -483,11 +484,17 @@ def remove_one_indent(s): | |
| if args.signature: | ||
| print("\n# mismatching signatures (warnings)") | ||
| for modname, mismatched in result["mismatched_items"].items(): | ||
| for (item, rustpy_value, cpython_value) in mismatched: | ||
| if cpython_value == "ValueError('no signature found')": | ||
| continue # these items will never match | ||
|
|
||
| print(f"{item} {rustpy_value} != {cpython_value}") | ||
| for i, (item, rustpy_value, cpython_value) in enumerate(mismatched): | ||
| if cpython_value and cpython_value.startswith("ValueError("): | ||
| continue # these items will never match | ||
| if rustpy_value is None or rustpy_value.startswith("ValueError("): | ||
| rustpy_value = f" {rustpy_value}" | ||
| print(f"{item}{rustpy_value}") | ||
| if cpython_value is None or cpython_value.startswith("ValueError("): | ||
| cpython_value = f" {cpython_value}" | ||
| print(f"{' ' * len(item)}{cpython_value}") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also, minor nit here, but we don't account for the potential space added in the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The idea is that ValueError/None aren't signatures. The output is like but we don't repeat " Then for value errors we have or |
||
| if i < len(mismatched) - 1: | ||
| print() | ||
|
DimitrisJim marked this conversation as resolved.
|
||
|
|
||
| if args.doc: | ||
| print("\n# mismatching `__doc__`s (warnings)") | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.