-
Notifications
You must be signed in to change notification settings - Fork 437
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
documentation request: how to follow imports within a virtualenv #117
Comments
Thanks for the report, would you like to provide pull requests to clarify the usage of |
This change relates to facebook#117. I am to make it more explicit that `--search-path` is passed multiple times, rather than a single time with a delimited list of directories (e.g. `path/to:your/pyton:modules/and/stubs`)
Sure thing! Full disclosure: I'm only familiar with Aside: looking through the code, I noticed at ./client/configuration.py#Configuration.__init__ it looks like you could ingest the |
Sorry for the late reply, but this dropped from my radar somehow. I am looking at the PR, I have minor comments on that one. As for the second point you mentioned, we might as well extend the pre-existing flag ( |
Summary: This change relates to #117. I am to make it more explicit that `--search-path` is passed multiple times, rather than a single time with a delimited list of directories (e.g. `path/to:your/pyton:modules/and/stubs`) Pull Request resolved: #120 Differential Revision: D13165526 Pulled By: dark fbshipit-source-id: 50f2201ded12788c3e98fd71f724966a483c550f
Summary: dark this is re: the comment you made in #117 about extending `--preserve-pythonpath`. When it's used, I include `sys.path` in the paths searched. Please check the test output of to verify the paths are as expected. With `PYTHONPATH=additional/:directories/`, it sets ```python >>> configuration.search_path [ 'additional/', 'directories/', # vvv the contents of sys.path that are directories '', '/your/env/anaconda3/lib/python3.6', '/your/env/anaconda3/lib/python3.6/lib-dynload', '/your/env/anaconda3/lib/python3.6/site-packages', # ^^^ 'command/', 'line/', 'json/', 'file/', ] ``` Assuming my understanding is correct and python searches `$PYTHONPATH` and then `sys.path` for packages, then this should fix #121 as well. Pull Request resolved: #123 Differential Revision: D13413376 Pulled By: dark fbshipit-source-id: 41de2eecb9175378e1e0d17649d60eaef5cabfcc
I am having issues running inside a conda environment as well.
Are virtual environments supported? |
Issue Scope
--search-path
The Story
I wanted to write an example of checking pip-installed imports using pyre. After reading through the documentation, I found that vanilla
source activate my-venv; pyre --source-directory to/check check
was not detecting packages I hadpip install
ed in my virtualenv. Reading #64, I tried passing in a unix-style path, separated by:
s. This failed with a semi-informative error message,pyre_check.exceptions.EnvironmentException: colon/separated:list/of:paths/to/search is not a valid directory.
I found passing in multiple--search-paths
worked:This solution isn't 100% intuitive. The guided tour should include an example like this of working in a virtualenv to make pyre easier to adopt. Updating the
--search-path SEARCH_PATH
documentation fromto something like
would also clarify pyre usage.
The text was updated successfully, but these errors were encountered: