atom-community / atom-community/ide-python

Ability for completion/going-to-definition for symbols from virtualenv bound to specific project

未关闭
#128 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
238
派生
40
PR 合并指标
30 天内没有已合并 PR

描述

I use [pyenv](https://github.com/pyenv/pyenv) to keep multiple python installation (py2, py3 etc.)

And I use [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv) to maintain separate python environments for different projects (i.e. virtualenv).

All python versions and virtualenvs live in directory `~/.pyenv/versions`.

```shell
$ ls ~/.pyenv/versions
2.7.13 2.7.14 3.6.3 3.6.4 3.7.0 project-x project-y

$ ~/.pyenv/versions/3.7.0/bin/python -V
Python 3.7.0

$ ~/.pyenv/versions/project-x/bin/python -V
Python 2.7.14
```

All my projects' code live in `~/workspace`:

```shell
$ ls ~/workspace
project-x project-y
```

I always make my project name as the same as its virtualenv name, you see, there are `project-x` and `project-y`.

I also place a file named of `.python-version` under project root dir, [let the magic automatically activate the specific virtualenv on entering project dir](https://github.com/pyenv/pyenv-virtualenv#activate-virtualenv).

```shell
$ cat ~/workspace/project-x/.python-version
project-x

$ cd ~/workspace/project-x
(project-x) $
```

I use [Atome Project Manager](https://atom.io/packages/project-manager) to remember my project dirs, So I can do quick switch from and to different editor windows, each window for one project.

---

So I want **IDE-python** call the right python binary and do completion/going-to-definition from the right python environment, Possible?

贡献指南

打开贡献指南

调研方向

首先跟踪 IDE-python 如何为 Atom 项目选择解释器,并使用项目根目录中的 .python-version 和 pyenv 路径作为复现设置。当 completion 和 go-to-definition 针对 project-x 和 project-y 从所选项目的 virtualenv 中解析符号,而不是从共享的 Python 安装中解析时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
developer-experience, tooling
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。