Skip to content
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

running against a python env inside a docker container? #582

Closed
dcsanx opened this issue Mar 24, 2020 · 2 comments
Closed

running against a python env inside a docker container? #582

dcsanx opened this issue Mar 24, 2020 · 2 comments
Labels
question Further information is requested

Comments

@dcsanx
Copy link

dcsanx commented Mar 24, 2020

rather than using virtualenv, we develop with a python env contained in a custom docker image.
I'm wondering if pyright can see into that built image to look for installed modules?

where the dockerfile looks something like this:

FROM python:3-stretch

RUN pip install --upgrade pip

ADD submodules/xyz/package /tmp/dpl
RUN cd /tmp/dpl && python setup.py sdist bdist_wheel
ENV PIP_FIND_LINKS=/tmp/dpl/dist

ADD requirements.txt ./
RUN pip install -r requirements.txt

@dcsanx dcsanx added the enhancement request New feature or request label Mar 24, 2020
@jakebailey
Copy link
Member

jakebailey commented Mar 24, 2020

Have you used VS Code's dev containers?

I believe it's common to use VS Code's remote mode (which makes dev containers work) to ensure the editor bits are running in the right environment. I'm not sure it's feasible to get the editor to use a container's filesystem without actually running in it.

Relevant section: https://code.visualstudio.com/docs/remote/containers#_using-an-image-or-dockerfile

@erictraut
Copy link
Collaborator

Are you running Pyright (the command-line version) inside of the docker container? We run Pyright inside of a docker container for our CI (continuous integration) pipeline. Or are you looking to run the VS Code extension outside of the docker container but point to the docker container for your installed Python environment?

Pyright should be able to use any Python environment as long as it's accessible through a file system path.

@erictraut erictraut added question Further information is requested and removed enhancement request New feature or request labels Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants