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

Investigate import strictness and editable installs #1169

Closed

Description

Tracking for #1139.

Activity

  1. jakebailey commented on Jun 7, 2019

    @jakebailey
    MemberAuthor

    #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.

  2. brando90 commented on Jun 24, 2020

    @brando90

    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions