-
Notifications
You must be signed in to change notification settings - Fork 45
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.
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
Import module order issue #651
Comments
I think that's a bit of an unusual case, but if you can write a test to reproduce that, then it seems like a reasonable change. |
@Dreamsorcerer names like |
Here are the simple steps to reproduce Folder Structure
|
I meant a test, in a PR. |
Here is the reproducable test, seems its happening only with process.. so can't mock process in this test.
Here is the working test.. |
1.1.2
3.9.3
3.11
linux
Issue Summary
If you have a package with same module name, adev tries to import the module from that package rather than honoring the project root.
Assume project structure is like this
sample command:
adev runserver app.py --root=/opt/app/services/s1/ --app-factory=create_app --port=8080 --aux-port=8086 --verbose --no-livereload
I am assuming, it will load the app modules from s1 root. But its loading
app
module from l1 package which hasapp
module.I debugged the issue and found that we are appending the root as module path. Python is seraching the module in sequential order and load the
app
module froml1
package as its in sys path ahead ofroot
aiohttp-devtools/aiohttp_devtools/runserver/config.py
Line 139 in 5858de8
I changed to following
sys.path.insert(0, str(self.python_path))
and it sovled the issue!The text was updated successfully, but these errors were encountered: