Configure auto-import to omit src from import statements
I maintainer di solito rispondono entro 7 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 2.2k
- Fork
- 197
- Merge medio
- 2g 13h
- PR unite (30g)
- 5
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di python-rope/rope
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
python-rope/rope#927 ·
I maintainer di solito rispondono entro 7 giorni
-
Extract raises IndexError or ModuleSyntaxError instead of RefactoringError for an empty or whitespace-only regionForse già presa @aliassar l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
python-rope/rope#926 ·
I maintainer di solito rispondono entro 7 giorni
-
simplify.real_code blanks t-strings, so renames inside them edit the wrong offsetForse già presa @sean0407 l’ha presa 10 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
python-rope/rope#913 ·
I maintainer di solito rispondono entro 7 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
python-rope/rope#925 ·
I maintainer di solito rispondono entro 7 giorni
-
Extract method/variable and introduce parameter don't check whether the new name is already in useAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
python-rope/rope#924 ·
I maintainer di solito rispondono entro 7 giorni
Tutte le issue di python-rope/rope
Issue simili
-
Paraxial.trace returns NaN for an object at infinity when the entrance pupil is at the first surfaceAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement ios launcher
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Substrait consumer doesn't recognise `shift_left` / `shift_right` from functions_arithmetic.yamlApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
apache/datafusion#27059 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
loteran/Arctis-Sound-Manager#368 ·
I maintainer di solito rispondono entro 1 giorno
-
feed submission
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
MobilityData/mobility-database-catalogs#1787 ·
I maintainer di solito rispondono entro 2 giorni