Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,11 @@
"deoptimize",
"emscripten",
"excs",
"flufl",
"fnfe",
"fsdefault",
"ifexp",
"implicits",
"interps",
"jitted",
"jitting",
Expand Down
39 changes: 32 additions & 7 deletions .github/actions/install-linux-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,36 @@ runs:
- name: Install Linux dependencies
shell: bash
if: ${{ runner.os == 'Linux' }}
run: >
sudo apt-get update
env:
GCC_MULTILIB: ${{ inputs.gcc-multilib }}
MUSL_TOOLS: ${{ inputs.musl-tools }}
CLANG: ${{ inputs.clang }}
GCC_AARCH64_LINUX_GNU: ${{ inputs.gcc-aarch64-linux-gnu }}
run: |
if ! sudo apt-get update; then
echo "::warning::apt-get update failed; disabling nonessential Microsoft apt sources and retrying"
for source in /etc/apt/sources.list.d/*microsoft* /etc/apt/sources.list.d/*azure-cli*; do
if [ -e "$source" ]; then
sudo mv "$source" "$source.disabled"
fi
done
sudo apt-get update
fi

sudo apt-get install --no-install-recommends
${{ fromJSON(inputs.gcc-multilib) && 'gcc-multilib' || '' }}
${{ fromJSON(inputs.musl-tools) && 'musl-tools' || '' }}
${{ fromJSON(inputs.clang) && 'clang' || '' }}
${{ fromJSON(inputs.gcc-aarch64-linux-gnu) && 'gcc-aarch64-linux-gnu linux-libc-dev-arm64-cross libc6-dev-arm64-cross' || '' }}
packages=()
if [[ "$GCC_MULTILIB" == "true" ]]; then
packages+=(gcc-multilib)
fi
if [[ "$MUSL_TOOLS" == "true" ]]; then
packages+=(musl-tools)
fi
if [[ "$CLANG" == "true" ]]; then
packages+=(clang)
fi
if [[ "$GCC_AARCH64_LINUX_GNU" == "true" ]]; then
packages+=(gcc-aarch64-linux-gnu linux-libc-dev-arm64-cross libc6-dev-arm64-cross)
fi

if ((${#packages[@]})); then
sudo apt-get install --no-install-recommends "${packages[@]}"
fi
33 changes: 18 additions & 15 deletions Cargo.lock

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

19 changes: 6 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
flamescope = { version = "0.1.2", optional = true }

rustls = { workspace = true, optional = true }
rustls-graviola = { workspace = true, optional = true }

Check warning on line 52 in Cargo.toml

View workflow job for this annotation

GitHub Actions / cargo shear

shear/misplaced_optional_dependency

misplaced optional dependency `rustls-graviola` (remove the `optional` flag and move to `[dev-dependencies]`)

[target.'cfg(windows)'.dependencies]
libc = { workspace = true }
Expand Down Expand Up @@ -183,19 +183,11 @@
rustpython-wtf8 = { path = "crates/wtf8", version = "0.5.0" }
rustpython-doc = { path = "crates/doc", version = "0.5.0" }

# Use RustPython-packaged Ruff crates from the published fork while keeping

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

minimize diff and keep rustpython-ruff_python_parser as commented

# existing crate names in the codebase.
ruff_python_parser = { package = "rustpython-ruff_python_parser", version = "0.15.8" }
ruff_python_ast = { package = "rustpython-ruff_python_ast", version = "0.15.8" }
ruff_text_size = { package = "rustpython-ruff_text_size", version = "0.15.8" }
ruff_source_file = { package = "rustpython-ruff_source_file", version = "0.15.8" }
# To update ruff crates, comment out the above lines and uncomment the following lines to pull directly from the Ruff repository at the specified commit hash.
# Ruff tag 0.15.8 is based on commit c2a8815842f9dc5d24ec19385eae0f1a7188b0d9
# at the time of this capture. We use the commit hash to ensure reproducible builds.
# ruff_python_parser = { git = "https://github.com/astral-sh/ruff.git", rev = "c2a8815842f9dc5d24ec19385eae0f1a7188b0d9" }
# ruff_python_ast = { git = "https://github.com/astral-sh/ruff.git", rev = "c2a8815842f9dc5d24ec19385eae0f1a7188b0d9" }
# ruff_text_size = { git = "https://github.com/astral-sh/ruff.git", rev = "c2a8815842f9dc5d24ec19385eae0f1a7188b0d9" }
# ruff_source_file = { git = "https://github.com/astral-sh/ruff.git", rev = "c2a8815842f9dc5d24ec19385eae0f1a7188b0d9" }
# Use the RustPython Ruff fork for RustPython public `_ast` metadata.
ruff_python_parser = { package = "rustpython-ruff_python_parser", git = "https://github.com/RustPython/ruff.git", tag = "0.15.19-rustpython" }
ruff_python_ast = { package = "rustpython-ruff_python_ast", git = "https://github.com/RustPython/ruff.git", tag = "0.15.19-rustpython" }
ruff_text_size = { package = "rustpython-ruff_text_size", git = "https://github.com/RustPython/ruff.git", tag = "0.15.19-rustpython" }
ruff_source_file = { package = "rustpython-ruff_source_file", git = "https://github.com/RustPython/ruff.git", tag = "0.15.19-rustpython" }

der = { version = "0.8", features = ["alloc", "oid", "pem", "zeroize"] }
phf = { version = "0.13.1", default-features = false, features = ["macros"]}
Expand Down Expand Up @@ -311,6 +303,7 @@
textwrap = { version = "0.16.2", default-features = false }
termios = "0.3.3"
thiserror = "2.0"
thin-vec = "0.2.14"
timsort = "0.1.2"
tk-sys = { git = "https://github.com/arihant2math/tkinter.git", tag = "v0.2.0" }
icu_casemap = "2"
Expand Down
10 changes: 0 additions & 10 deletions Lib/test/test_ast/test_ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ def test_parse_invalid_ast(self):
self.assertRaises(TypeError, ast.parse, ast.Constant(42),
optimize=optval)

@unittest.expectedFailure # TODO: RUSTPYTHON; ValueError: compile() unrecognized flags
def test_optimization_levels__debug__(self):
cases = [(-1, '__debug__'), (0, '__debug__'), (1, False), (2, False)]
for (optval, expected) in cases:
Expand Down Expand Up @@ -586,7 +585,6 @@ def test_invalid_sum(self):
compile(m, "<test>", "exec")
self.assertIn("but got expr()", str(cm.exception))

@unittest.expectedFailure # TODO: RUSTPYTHON; ValueError: expected str for name
def test_invalid_identifier(self):
m = ast.Module([ast.Expr(ast.Name(42, ast.Load()))], [])
ast.fix_missing_locations(m)
Expand Down Expand Up @@ -1365,7 +1363,6 @@ def test_replace_ignore_known_custom_instance_fields(self):
self.assertIs(repl.ctx, context)
self.assertRaises(AttributeError, getattr, repl, 'extra')

@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: "Name\.__replace__\ missing\ 1\ keyword\ argument:\ 'id'\." does not match "replace() does not support Name objects"
def test_replace_reject_missing_field(self):
# case: warn if deleted field is not replaced
node = ast.parse('x').body[0].value
Expand Down Expand Up @@ -1700,7 +1697,6 @@ def check_text(code, empty, full, **kwargs):
full="Module(body=[Import(names=[alias(name='_ast', asname='ast')]), ImportFrom(module='module', names=[alias(name='sub')], level=0)], type_ignores=[])",
)

@unittest.expectedFailure # TODO: RUSTPYTHON; ? ^^^^^^^^^ ^^^^^^^^^
def test_copy_location(self):
src = ast.parse('1 + 1', mode='eval')
src.body.right = ast.copy_location(ast.Constant(2), src.body.right)
Expand Down Expand Up @@ -1737,7 +1733,6 @@ def test_fix_missing_locations(self):
"end_col_offset=0), lineno=1, col_offset=0, end_lineno=1, end_col_offset=0)])"
)

@unittest.expectedFailure # TODO: RUSTPYTHON; ? ^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
def test_increment_lineno(self):
src = ast.parse('1 + 1', mode='eval')
self.assertEqual(ast.increment_lineno(src, n=3), src)
Expand Down Expand Up @@ -1959,7 +1954,6 @@ def test_literal_eval_syntax_errors(self):
(\
\ ''')

@unittest.expectedFailure # TODO: RUSTPYTHON; TypeError: required field "lineno" missing from alias
def test_bad_integer(self):
# issue13436: Bad error message with invalid numeric values
body = [ast.ImportFrom(module='time',
Expand Down Expand Up @@ -3259,7 +3253,6 @@ class MyAttrs(ast.AST):
r"MyAttrs.__init__ got an unexpected keyword argument 'c'."):
obj = MyAttrs(c=3)

@unittest.expectedFailure # TODO: RUSTPYTHON; DeprecationWarning not triggered
def test_fields_and_types_no_default(self):
class FieldsAndTypesNoDefault(ast.AST):
_fields = ('a',)
Expand All @@ -3273,7 +3266,6 @@ class FieldsAndTypesNoDefault(ast.AST):
obj = FieldsAndTypesNoDefault(a=1)
self.assertEqual(obj.a, 1)

@unittest.expectedFailure # TODO: RUSTPYTHON; DeprecationWarning not triggered
def test_incomplete_field_types(self):
class MoreFieldsThanTypes(ast.AST):
_fields = ('a', 'b')
Expand All @@ -3293,7 +3285,6 @@ class MoreFieldsThanTypes(ast.AST):
self.assertEqual(obj.a, 1)
self.assertEqual(obj.b, 2)

@unittest.expectedFailure # TODO: RUSTPYTHON; TypeError: Expected type 'str' but 'bytes' found.
def test_malformed_fields_with_bytes(self):
class BadFields(ast.AST):
_fields = (b'\xff'*64,)
Expand Down Expand Up @@ -3713,7 +3704,6 @@ def assert_ast(self, code, non_optimized_target, optimized_target):
f"{ast.dump(optimized_tree)}",
)

@unittest.expectedFailure # TODO: RUSTPYTHON; ValueError: compile() unrecognized flags
def test_folding_format(self):
code = "'%s' % (a,)"

Expand Down
1 change: 0 additions & 1 deletion Lib/test/test_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ def test_monkeypatch(self):
def test_open(self):
self.do_test("test_open", os_helper.TESTFN)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_cantrace(self):
self.do_test("test_cantrace")

Expand Down
3 changes: 0 additions & 3 deletions Lib/test/test_builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,6 @@ def test_compile_top_level_await_no_coro(self):
msg=f"source={source} mode={mode}")


@unittest.expectedFailure # TODO: RUSTPYTHON
def test_compile_top_level_await(self):
"""Test whether code with top level await can be compiled.

Expand Down Expand Up @@ -627,7 +626,6 @@ def test_compile_async_generator(self):
exec(co, glob)
self.assertEqual(type(glob['ticker']()), AsyncGeneratorType)

@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: <_ast.Name object at 0xb40000731e3d1360> is not an instance of <class '_ast.Constant'>
def test_compile_ast(self):
args = ("a*__debug__", "f.py", "exec")
raw = compile(*args, flags = ast.PyCF_ONLY_AST).body[0]
Expand Down Expand Up @@ -1020,7 +1018,6 @@ def test_exec_redirected(self):
finally:
sys.stdout = savestdout

@unittest.expectedFailure # TODO: RUSTPYTHON; TypeError: Unexpected keyword argument closure
def test_exec_closure(self):
def function_without_closures():
return 3 * 5
Expand Down
1 change: 0 additions & 1 deletion Lib/test/test_cmd_line_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,6 @@ def test_syntaxerror_indented_caret_position(self):
self.assertNotIn("\f", text)
self.assertIn("\n 1 + 1 = 2\n ^^^^^\n", text)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_syntaxerror_multi_line_fstring(self):
script = 'foo = f"""{}\nfoo"""\n'
with os_helper.temp_dir() as script_dir:
Expand Down
1 change: 0 additions & 1 deletion Lib/test/test_codeop.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ def test_filename(self):
self.assertNotEqual(compile_command("a = 1\n", "abc").co_filename,
compile("a = 1\n", "def", 'single').co_filename)

@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: 0 != 2
def test_warning(self):
# Test that the warning is only returned once.
with warnings_helper.check_warnings(
Expand Down
Loading
Loading