Skip to content
This repository has been archived by the owner on Apr 14, 2022. It is now read-only.

Investigate import strictness and editable installs #1169

Closed
jakebailey opened this issue Jun 5, 2019 · 2 comments · Fixed by #1183
Closed

Investigate import strictness and editable installs #1169

jakebailey opened this issue Jun 5, 2019 · 2 comments · Fixed by #1183
Assignees
Labels
editable-installs pip editable installs / setup.py develop feature: imports
Milestone

Comments

@jakebailey
Copy link
Member

Tracking for #1139.

@jakebailey jakebailey added feature: imports editable-installs pip editable installs / setup.py develop labels Jun 5, 2019
@jakebailey jakebailey added this to the June 2019.1 milestone Jun 5, 2019
@jakebailey jakebailey self-assigned this Jun 5, 2019
@jakebailey
Copy link
Member Author

#1013 (comment) provides https://github.com/carmenbianca/vscodesrc:

+ WORKSPACE_ROOT
    + src
        + mypackage
            + __init__.py
    + tests
        + test_mypackage.py  "from mypackage import foo"

This works with extraPaths set to ["./src"], but involves the editable install issue.

This is a boiled down case of https://github.com/fsfe/reuse-tool and they work the same way:

+ WORKSPACE_ROOT
    + src
        + reuse
            + download.py
            + project.py
            + report.py  "from . import __version", "from .project import Project"
    + tests
        + test_download.py  "from reuse.download import download_license"

#1085 has:

+ WORKSPACE_ROOT
    + projectmain
        + mymodule.py
        + myproject.py  "import mymodule"

Works with ["./projectmain"], and doesn't involve editable installs.


#1137 (comment) provides https://github.com/chudytom/LangServerError:

+ WORKSPACE_ROOT
    + .vscode
    + network
        + section_network_input.py  "from timepredictionslib.helpers.file_parser import FileParser"
    + timepredictionslib
        + build
        + dist
        + timepredictionslib
            + __init__.py
            + prediction_test_result.py
            + helpers
                + __init__.py
                + file_parser.py
        + setup.py

Which works with ["./timepredictionslib"], but similarly would be affected by the editable install issue.


#1137 (comment) provides https://github.com/rdrey/langservtest:

+ WORKSPACE_ROOT
    + .vscode
    + langservtest
        + langservtest
            + errors
                + __init__.py
            + noerrors
                + __init__.py
            + __init__.py
            + test.py  "from langservtest.errors import Test", "from .noerror import RelativeImport"
        + setup.py

Which works with ["./langservtest"], but would be broken when installed as editable.


#989 provides https://github.com/crhan/vscode_python_error_reproduce:

+ WORKSPACE_ROOT
    + package_a
        + setup.py
        + namespaced
            + a
                + __init__.py
    + package_b
        + setup.py
        + namespaced
            + b
                + __init__.py
    + package_c
        + setup.py
        + c
            + __init__.py
                
    + test_file.py "from namespaced.a import func_a", "from namespaced.b import func_b", "from c import func_c"

Which works with ["./package_a", "./package_b", "./package_c"], but again would be affected with editable installs.


#1099 is an interesting case, as the C drive is getting opened, but adding extraPaths should work there as well.

#1118 should have worked with the configuration, but the screenshots show that it's been installed as editable.

#918 has a mix of things (mostly +1s and repeated comments from other threads). The original post, however, talks about actually placing user-editable packages into a virtual environment then editing them there; I think this may be out of scope because we wouldn't really be able to understand what is library code and what is not. This may be out of scope for this reason, but potentially could be improved if the underlying editable install bug is fixed.

@brando90
Copy link

brando90 commented Jun 24, 2020

Why doesn't vscode use my python path to give intelligent suggestions + show parameters/docs?

https://stackoverflow.com/questions/62564321/how-does-one-have-intellisense-or-intellicode-work-for-my-own-packages-install

#2088

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editable-installs pip editable installs / setup.py develop feature: imports
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants