RustPython / RustPython/RustPython
Importing RustPython via Git leads to failure in importing local modules.
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 22.4k
- Forks
- 1.5k
- Avg merge
- 16h 33m
- Merged PRs (30d)
- 165
Description
When I import the latest version of RustPython dependencies using Git, I encounter issues with failing to import local modules. However, if I use version 0.4.0 from crates.io, the imports work successfully.
rustpython = { git = "https://github.com/RustPython/RustPython", branch = "main", features = ["stdlib", "freeze-stdlib","threading","ssl-vendor" ] }
rustpython-vm = { git = "https://github.com/RustPython/RustPython", branch = "main" }
python code:
script_dir = os.path.dirname(__file__)
print(f"Script directory: {script_dir}")
print("Python directory contents:")
for item in os.listdir(script_dir):
item_path = os.path.join(script_dir, item)
if os.path.isdir(item_path):
print(f" [DIR] {item}")
test_dir = os.path.join(script_dir, 'test')
if os.path.exists(test_dir):
print(f"\nTest directory contents:")
for item in os.listdir(test_dir):
print(f" {item}")
else:
print(f"\nTest directory does not exist at: {test_dir}")
try:
from test.test_base import TestBase
print("Import successful!")
except ImportError as e:
print(f"Import failed: {e}")
Print log:
[python/main.py:379 in main()] Script directory: /var/mobile/Containers/Data/Application/4FC1AFD7-F437-48CB-B439-B165177E3CEB/Documents/home/debug/main/python
[python/main.py:380 in main()] Python directory contents:
[python/main.py:384 in main()] [DIR] test
[python/main.py:387 in main()] Test directory contents:
[python/main.py:389 in main()] test_base.py
[python/main.py:397 in main()] Import failed: No module named 'test.test_base'
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported import with RustPython from the main Git branch and compare it with the working 0.4.0 crates.io version, using the provided Python snippet and dependency declarations. Trace the local-module import path around the failure; the issue is done when importing test.test_base works with the Git dependencies without breaking the existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100