Skip to content

Commit

Permalink
fix: import resolution bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mtshiba committed Dec 7, 2024
1 parent 4c57e6e commit a24164b
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 15 deletions.
22 changes: 11 additions & 11 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ edition = "2021"
repository = "https://github.com/mtshiba/pylyzer"

[workspace.dependencies]
erg_common = { version = "0.6.49-nightly.0", features = ["py_compat", "els"] }
erg_compiler = { version = "0.6.49-nightly.0", features = ["py_compat", "els"] }
els = { version = "0.1.61-nightly.0", features = ["py_compat"] }
erg_common = { version = "0.6.49-nightly.1", features = ["py_compat", "els"] }
erg_compiler = { version = "0.6.49-nightly.1", features = ["py_compat", "els"] }
els = { version = "0.1.61-nightly.1", features = ["py_compat"] }
# rustpython-parser = { version = "0.3.0", features = ["all-nodes-with-ranges", "location"] }
# rustpython-ast = { version = "0.3.0", features = ["all-nodes-with-ranges", "location"] }
rustpython-parser = { git = "https://github.com/RustPython/Parser", version = "0.4.0", features = ["all-nodes-with-ranges", "location"] }
Expand Down
2 changes: 2 additions & 0 deletions tests/foo/bar.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
i = 0

class Bar:
CONST = "foo.bar"
def f(self): return 1

class Baz(Exception):
CONST = "foo.baz"
pass

class Qux(Baz):
Expand Down
5 changes: 4 additions & 1 deletion tests/foo/baz/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
i = 0
i = 0

class Bar:
CONST = "foo.baz.bar"
7 changes: 7 additions & 0 deletions tests/import.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import foo
from . import foo
from foo import bar, Bar
from foo.bar import Baz
from foo import baz
import random
from random import randint as rdi
Expand Down Expand Up @@ -30,6 +31,12 @@

assert foo.i == 0
assert Bar().f() == 1
assert Bar.CONST == "foo.bar"
assert Baz.CONST == "foo.baz"

from foo.baz import Bar

assert Bar.CONST == "foo.baz.bar"

from glob import glob
print(glob("*"))
Expand Down

0 comments on commit a24164b

Please sign in to comment.