Configure auto-import to omit src from import statements

オープン
#753 コメント 7 件 リアクション 3 件 担当者 0 名 GitHub で見る

メンテナーはふだん 7 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
tooling

調査の方向性

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時間
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

python-rope/rope のほかの issue

python-rope/rope の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。