mirror of https://github.com/astral-sh/ruff
Upgrade RustPython to handle AnnAssign
This commit is contained in:
parent
74ecdc73ac
commit
cc691ee833
|
|
@ -1787,7 +1787,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustpython-ast"
|
name = "rustpython-ast"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/charliermarsh/RustPython.git?rev=ff6112d7c70729be76eaad8c9e5b8ef24d13de99#ff6112d7c70729be76eaad8c9e5b8ef24d13de99"
|
source = "git+https://github.com/charliermarsh/RustPython.git?rev=8cc3d23ddaa6339bf56608adaeefabff3ad329e7#8cc3d23ddaa6339bf56608adaeefabff3ad329e7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"num-bigint",
|
"num-bigint",
|
||||||
"rustpython-compiler-core",
|
"rustpython-compiler-core",
|
||||||
|
|
@ -1796,7 +1796,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustpython-compiler-core"
|
name = "rustpython-compiler-core"
|
||||||
version = "0.1.2"
|
version = "0.1.2"
|
||||||
source = "git+https://github.com/charliermarsh/RustPython.git?rev=ff6112d7c70729be76eaad8c9e5b8ef24d13de99#ff6112d7c70729be76eaad8c9e5b8ef24d13de99"
|
source = "git+https://github.com/charliermarsh/RustPython.git?rev=8cc3d23ddaa6339bf56608adaeefabff3ad329e7#8cc3d23ddaa6339bf56608adaeefabff3ad329e7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bincode",
|
"bincode",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
|
|
@ -1813,7 +1813,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustpython-parser"
|
name = "rustpython-parser"
|
||||||
version = "0.1.2"
|
version = "0.1.2"
|
||||||
source = "git+https://github.com/charliermarsh/RustPython.git?rev=ff6112d7c70729be76eaad8c9e5b8ef24d13de99#ff6112d7c70729be76eaad8c9e5b8ef24d13de99"
|
source = "git+https://github.com/charliermarsh/RustPython.git?rev=8cc3d23ddaa6339bf56608adaeefabff3ad329e7#8cc3d23ddaa6339bf56608adaeefabff3ad329e7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ahash",
|
"ahash",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ notify = { version = "4.0.17" }
|
||||||
once_cell = { version = "1.13.1" }
|
once_cell = { version = "1.13.1" }
|
||||||
rayon = { version = "1.5.3" }
|
rayon = { version = "1.5.3" }
|
||||||
regex = { version = "1.6.0" }
|
regex = { version = "1.6.0" }
|
||||||
rustpython-parser = { features = ["lalrpop"], git = "https://github.com/charliermarsh/RustPython.git", rev = "ff6112d7c70729be76eaad8c9e5b8ef24d13de99" }
|
rustpython-parser = { features = ["lalrpop"], git = "https://github.com/charliermarsh/RustPython.git", rev = "8cc3d23ddaa6339bf56608adaeefabff3ad329e7" }
|
||||||
serde = { version = "1.0.143", features = ["derive"] }
|
serde = { version = "1.0.143", features = ["derive"] }
|
||||||
serde_json = { version = "1.0.83" }
|
serde_json = { version = "1.0.83" }
|
||||||
toml = { version = "0.5.9" }
|
toml = { version = "0.5.9" }
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,7 @@ def ternary_optarg(prec, exp_range, itr):
|
||||||
class Foo:
|
class Foo:
|
||||||
CLASS_VAR = 1
|
CLASS_VAR = 1
|
||||||
REFERENCES_CLASS_VAR = {"CLASS_VAR": CLASS_VAR}
|
REFERENCES_CLASS_VAR = {"CLASS_VAR": CLASS_VAR}
|
||||||
# TODO: This should be recognized as a defined variable.
|
ANNOTATED_CLASS_VAR: int = 2
|
||||||
ANNOTATED_CLASS_VAR: int = 2 # noqa: F821
|
|
||||||
|
|
||||||
|
|
||||||
class Class:
|
class Class:
|
||||||
|
|
@ -42,11 +41,11 @@ class Class:
|
||||||
# TODO(charlie): This should be recognized as a defined variable.
|
# TODO(charlie): This should be recognized as a defined variable.
|
||||||
Class # noqa: F821
|
Class # noqa: F821
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
x = 1 / 0
|
x = 1 / 0
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
|
||||||
|
|
||||||
# TODO: This should be recognized as a defined variable.
|
y: int = 1
|
||||||
y: int = 1 # noqa: F821
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue