Configure auto-import to omit src from import statements
维护者通常 7 天内回复
还没有人认领这个 Issue。
评估
调研方向
The request is for a rope configuration option that controls whether a src/ source folder appears in generated import paths, so start with how rope resolves module names relative to the project root and to configured source folders. The issue mentions python_files and source_folders as settings the reporter already tried, so read how those are handled. Done means a documented option that makes auto-import produce REPO.x rather than src.REPO.x, with tests covering a src/ layout. The thread has been inactive for about 680 days, so confirm with maintainers that the approach is still wanted.
由索引模型根据 Issue 内容生成。
描述
Is your feature request related to a problem? Please describe.
I work in python projects that use poetry for dependency management, and use a src/ folder for the repository. When importing an anything from within the repo, rope defaults to importing relative to the root directory, instead of from the package source.
e.g.
from src.REPO.x import y
Describe the solution you'd like
I'd like to be able to set a configuration for rope (eg in pytool.toml) to tell Rope to not reference the src in the import, and instead just use the repo name.
e.g.
from REPO.x import y
Describe alternatives you've considered
See discussion in pylsp: https://github.com/python-lsp/python-lsp-server/discussions/525
I've experimented with changing the existing config of python_files and source_folders, but this hasn't given much success.
Additional context
I use rope as part of pylsp.
- 主要语言
- Python
- 星标
- 2.2k
- 派生
- 197
- 平均合并
- 2 天 13 小时
- 30 天内合并 PR
- 5
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
python-rope/rope 的其他 Issue
-
难度 1/5 1-3 小时 新手友好度 88/100
python-rope/rope#927 ·
维护者通常 7 天内回复
-
Extract raises IndexError or ModuleSyntaxError instead of RefactoringError for an empty or whitespace-only region可能已有人在做 @aliassar 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
python-rope/rope#926 ·
维护者通常 7 天内回复
-
simplify.real_code blanks t-strings, so renames inside them edit the wrong offset可能已有人在做 @sean0407 于 11 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 83/100
python-rope/rope#913 ·
维护者通常 7 天内回复
-
难度 4/5 3-5 天 新手友好度 30/100
python-rope/rope#925 ·
维护者通常 7 天内回复
-
Extract method/variable and introduce parameter don't check whether the new name is already in use未关闭
难度 3/5 1-2 天 新手友好度 62/100
python-rope/rope#924 ·
维护者通常 7 天内回复
相似的 Issue
-
bug ready-for-dev
难度 1/5 1-3 小时 新手友好度 92/100
OpenHands/extensions#897 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
tensorflow/datasets#11253 ·
维护者通常 1 天内回复
-
fix(core): a config section with all keys commented out crashes startup可能已有人在做 @Aryanbhargava18 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
kubeflow/mcp-server#512 ·
维护者通常 1 天内回复
-
Stop trusting the compromised eMudhra CA certificates可能已有人在做 @anth-volk 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
PolicyEngine/uk-triple-lock#54 ·
维护者通常 1 天内回复
-
DBFS append mode silently overwrites existing files可能已有人在做 @IlyaKhalafi 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 77/100
fsspec/filesystem_spec#2429 ·
维护者通常 1 天内回复