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 — Remove unused rust impl for formatting dis output by ShaharNaveh · Pull Request #7660 · RustPython/RustPython

Remove unused rust impl for formatting dis output #7660

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.

Sign up for GitHub

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

Merged
youknowone merged 28 commits into RustPython:main from ShaharNaveh:remove-fmt-dis
May 5, 2026

Uh oh!

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

Merged

Remove unused rust impl for formatting dis output #7660

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
2cbbaf1
Remove unused rust impl for formatting dis output
ShaharNaveh Apr 23, 2026
774bdcd
remove `examples/dis.rs`
ShaharNaveh Apr 23, 2026
ad9feb0
Added tests
ShaharNaveh Apr 23, 2026
256252c
Update lock
ShaharNaveh Apr 28, 2026
7e8938d
Try to set snapshot dir
ShaharNaveh Apr 28, 2026
693ab8c
Remove verbose flag
ShaharNaveh Apr 28, 2026
ce8b0c8
Regenerate snapshots after #7711
ShaharNaveh Apr 28, 2026
d9751c9
Revert "Bump insta from 1.46.3 to 1.47.2 (#7706)"
ShaharNaveh Apr 28, 2026
b0ec4a0
Debug info
ShaharNaveh Apr 29, 2026
dc4c857
Show diff as well
ShaharNaveh Apr 29, 2026
bae530c
Show debug faster
ShaharNaveh Apr 29, 2026
7a77e65
CI: true env
ShaharNaveh Apr 29, 2026
58c8d53
Recert CI
ShaharNaveh Apr 29, 2026
a3f690e
Add `CI: true` in ci emv
ShaharNaveh Apr 29, 2026
182b4f5
Reapply "Bump insta from 1.46.3 to 1.47.2 (#7706)"
ShaharNaveh Apr 29, 2026
c235e6c
simplify macro
ShaharNaveh Apr 30, 2026
42353fa
trim on function side
ShaharNaveh Apr 30, 2026
2450d69
Force insta workspace root
ShaharNaveh May 1, 2026
b5326b3
Merge remote-tracking branch 'upstream/main' into remove-fmt-dis
ShaharNaveh May 1, 2026
e4f7ea0
Merge remote-tracking branch 'upstream/main' into remove-fmt-dis
ShaharNaveh May 2, 2026
89a4da6
Merge remote-tracking branch 'upstream/main' into remove-fmt-dis
ShaharNaveh May 2, 2026
8f3d793
Merge remote-tracking branch 'upstream/main' into remove-fmt-dis
ShaharNaveh May 4, 2026
1cc518f
Merge remote-tracking branch 'upstream/main' into remove-fmt-dis
ShaharNaveh May 4, 2026
ad2b24f
fix merge
ShaharNaveh May 4, 2026
fd5d487
Merge remote-tracking branch 'upstream/main' into remove-fmt-dis
ShaharNaveh May 5, 2026
5c3aa0d
fixing bad merge
ShaharNaveh May 5, 2026
15d212f
regen snapshot
ShaharNaveh May 5, 2026
5806655
Merge remote-tracking branch 'upstream/main' into remove-fmt-dis
ShaharNaveh May 5, 2026
File filter
Filter by extension


Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

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

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

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

Diff view
Diff view

There are no files selected for viewing

5 changes: 4 additions & 1 deletion 5 .github/workflows/ci.yaml
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ env:
CARGO_PROFILE_RELEASE_DEBUG: 0
CARGO_TERM_COLOR: always
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true # TODO: Remove on 2026/06/02
CI: true

jobs:
determine_changes:
Expand Down Expand Up @@ -111,7 +112,9 @@ jobs:
uses: ./.github/actions/install-macos-deps

- name: run rust tests
run: cargo test --workspace ${{ env.WORKSPACE_EXCLUDES }} --verbose --features threading ${{ env.CARGO_ARGS }}
run: cargo test --workspace ${{ env.WORKSPACE_EXCLUDES }} --features threading ${{ env.CARGO_ARGS }}
Comment thread

@fanninpm fanninpm Apr 29, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
run: cargo test --workspace ${{ env.WORKSPACE_EXCLUDES }} --features threading ${{ env.CARGO_ARGS }}
run: cargo test --workspace ${{ env.WORKSPACE_EXCLUDES }} --features threading ${{ env.CARGO_ARGS }}
env:
CI: true

What about here?

Sorry, something went wrong.

Uh oh!

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

All reactions

@ShaharNaveh ShaharNaveh Apr 29, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think there's a value to putting it at the top. other tools in the future (or even exiting ones) might look at this value, it because a standard from what I can tell. but it's not a hill I'm willing to die on

Sorry, something went wrong.

Uh oh!

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

All reactions
env:
INSTA_WORKSPACE_ROOT: ${{ github.workspace }}

- run: cargo doc --locked
if: runner.os == 'Linux'
Expand Down
3 changes: 2 additions & 1 deletion 3 Cargo.lock
Show comments
View file
Open in desktop

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Oops, something went wrong.

Uh oh!

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

1 change: 0 additions & 1 deletion 1 crates/codegen/Cargo.toml
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ unicode_names2 = { workspace = true }

[dev-dependencies]
ruff_python_parser = { workspace = true }
insta = { workspace = true }

[lints]
workspace = true
100 changes: 0 additions & 100 deletions 100 crates/codegen/src/compile.rs
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -12275,26 +12275,6 @@ def f(sys, os, file):
})
}

macro_rules! assert_dis_snapshot {
($value:expr) => {
insta::assert_snapshot!(
insta::internals::AutoName,
$value.display_expand_code_objects().to_string(),
stringify!($value)
)
};
}

#[test]
fn test_if_ors() {
assert_dis_snapshot!(compile_exec(
"\
if True or False or False:
pass
Comment thread
Comment on lines -12289 to -12293

@youknowone youknowone Apr 24, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh.. are these test going to be entirely deleted? This is not desired. Can we replace the snapshot test to other way not depending on internal dis?

Sorry, something went wrong.

Uh oh!

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

All reactions

@ShaharNaveh ShaharNaveh Apr 24, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only way I can think of is to move them under crates/vm or crates/stdlib, then parsing the source code into a PyCode, then run it like:

let module = vm.import("dis", 0)?;
let dis = module.get_attr("dis", vm)?;
let res = dis.call(my_pycode, vm)?;

// <convert res to String and pass to Insta>

Sorry, something went wrong.

Uh oh!

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

All reactions

@ShaharNaveh ShaharNaveh Apr 28, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@youknowone lmk what you think

Sorry, something went wrong.

Uh oh!

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

All reactions
"
));
}

#[test]
fn test_trace_assert_true_try_pair() {
let trace = compile_exec_late_cfg_trace(
Expand Down Expand Up @@ -12529,44 +12509,6 @@ def f(self):
);
}

#[test]
fn test_if_ands() {
assert_dis_snapshot!(compile_exec(
"\
if True and False and False:
pass
"
));
}

#[test]
fn test_if_mixed() {
assert_dis_snapshot!(compile_exec(
"\
if (True and False) or (False and True):
pass
"
));
}

#[test]
fn test_nested_bool_op() {
assert_dis_snapshot!(compile_exec(
"\
x = Test() and False or False
"
));
}

#[test]
fn test_const_bool_not_op() {
assert_dis_snapshot!(compile_exec_optimized(
"\
x = not True
"
));
}

#[test]
fn test_plain_constant_bool_op_folds_to_selected_operand() {
let code = compile_exec(
Expand Down Expand Up @@ -12840,24 +12782,6 @@ def f(self, mod):
);
}

#[test]
fn test_nested_double_async_with() {
assert_dis_snapshot!(compile_exec(
"\
async def test():
for stop_exc in (StopIteration('spam'), StopAsyncIteration('ham')):
with self.subTest(type=type(stop_exc)):
try:
async with egg():
raise stop_exc
except Exception as ex:
self.assertIs(ex, stop_exc)
else:
self.fail(f'{stop_exc} was suppressed')
"
));
}

#[test]
fn test_scope_exit_instructions_keep_line_numbers() {
let code = compile_exec(
Expand Down Expand Up @@ -14006,20 +13930,6 @@ def f(expected_ns, namespace):
}
}

#[test]
fn test_bare_function_annotations_check_attribute_and_subscript_expressions() {
assert_dis_snapshot!(compile_exec(
"\
def f(one: int):
int.new_attr: int
[list][0].new_attr: [int, str]
my_lst = [1]
my_lst[one]: int
return my_lst
"
));
}

#[test]
fn test_non_simple_bare_name_annotation_does_not_create_local_binding() {
let code = compile_exec(
Expand Down Expand Up @@ -14052,16 +13962,6 @@ def f2bad():
);
}

#[test]
fn test_constant_true_if_pass_keeps_line_anchor_nop() {
assert_dis_snapshot!(compile_exec(
"\
if 1:
pass
"
));
}

#[test]
fn test_negative_constant_binop_folds_after_unary_folding() {
let code = compile_exec(
Expand Down
3 changes: 1 addition & 2 deletions 3 crates/codegen/src/ir.rs
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -9378,8 +9378,7 @@ impl CodeInfo {
} else {
OpArg::new(ins.target.0)
};
let instr_display = instr.display(display_arg, self);
eprint!("{instr_display}: {depth} {effect:+} => ");
eprint!("{display_arg:?}: {depth} {effect:+} => ");
}
let new_depth = depth.checked_add_signed(effect).ok_or({
if effect < 0 {
Expand Down
67 changes: 0 additions & 67 deletions 67 ..._compile__tests__bare_function_annotations_check_attribute_and_subscript_expressions.snap
Show comments
View file
Open in desktop

This file was deleted.

Oops, something went wrong.

Uh oh!

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

9 changes: 0 additions & 9 deletions 9 crates/codegen/src/snapshots/rustpython_codegen__compile__tests__const_bool_not_op.snap
Show comments
View file
Open in desktop

This file was deleted.

Oops, something went wrong.

Uh oh!

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

10 changes: 0 additions & 10 deletions 10 ...hots/rustpython_codegen__compile__tests__constant_true_if_pass_keeps_line_anchor_nop.snap
Show comments
View file
Open in desktop

This file was deleted.

Oops, something went wrong.

Uh oh!

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

8 changes: 0 additions & 8 deletions 8 crates/codegen/src/snapshots/rustpython_codegen__compile__tests__if_ands.snap
Show comments
View file
Open in desktop

This file was deleted.

Oops, something went wrong.

Uh oh!

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

8 changes: 0 additions & 8 deletions 8 crates/codegen/src/snapshots/rustpython_codegen__compile__tests__if_mixed.snap
Show comments
View file
Open in desktop

This file was deleted.

Oops, something went wrong.

Uh oh!

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

10 changes: 0 additions & 10 deletions 10 crates/codegen/src/snapshots/rustpython_codegen__compile__tests__if_ors.snap
Show comments
View file
Open in desktop

This file was deleted.

Oops, something went wrong.

Uh oh!

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

35 changes: 0 additions & 35 deletions 35 crates/codegen/src/snapshots/rustpython_codegen__compile__tests__nested_bool_op.snap
Show comments
View file
Open in desktop

This file was deleted.

Oops, something went wrong.

Uh oh!

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

Loading
Oops, something went wrong.

Uh oh!

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

Loading
Oops, something went wrong.

Uh oh!

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

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 01402520 — 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.