Support moving and renaming a module with a file destination
Mantenedores costumam responder em até 7 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 38/100
Direção de pesquisa
Start by reading MoveModule.get_changes() and the existing move and rename refactorings to determine whether composing them already supports this workflow. If extending MoveModule, define destination and collision semantics, then cover normal, from, aliased, relative, and in-module imports with regression tests. Done means renamed file destinations rewrite imports consistently; assess the separate find_relative_module() change with its own reproducer and test.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Proposal
Consider extending MoveModule.get_changes() to accept a destination file, so callers can move and rename a module in one refactoring, for example:
old_package/module.py → new_package/renamed.py
Currently, MoveModule requires a folder destination. Commit https://github.com/python-rope/rope/commit/e7bfd4f5f4cb798f5b96ba7111e07e16254958f7 experiments with accepting file destinations and adjusting import rewriting. The feature idea seems worth considering, but the patch needs further work rather than merging unchanged.
Suggested scope
- Define destination-file semantics, including whether the file must not yet exist, collision handling, and how package moves differ from module moves.
- Update import rewriting consistently for both unchanged and renamed module basenames. The experimental patch's special case for
from old_package import moduleonly handles a destination with the same basename. - Cover normal imports, from-imports, aliases, relative imports, and imports inside the moved module with regression tests.
- Avoid the patch's broad
except Exceptionhandler, which hides the underlying failure.
First assess whether composing the existing move and rename refactorings already provides this behaviour reliably. If so, a convenience API or documentation may be preferable to extending MoveModule.
Separate concern
The same commit changes find_relative_module() to fall back to the project root when folder is false. That change should not be included without a separate reproducer and regression test establishing the intended relative-import behaviour.
This suggestion is based on source review of the commit and the current implementation, not behavioural testing of the patch.
- Linguagem predominante
- Python
- Estrelas
- 2.2k
- Forks
- 197
- Merge médio
- 2d 13h
- PRs com merge (30d)
- 5
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de python-rope/rope
-
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 88/100
python-rope/rope#927 ·
Mantenedores costumam responder em até 7 dias
-
Extract raises IndexError or ModuleSyntaxError instead of RefactoringError for an empty or whitespace-only regionTalvez já em andamento @aliassar assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
python-rope/rope#926 ·
Mantenedores costumam responder em até 7 dias
-
simplify.real_code blanks t-strings, so renames inside them edit the wrong offsetTalvez já em andamento @sean0407 assumiu há 10 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
python-rope/rope#913 ·
Mantenedores costumam responder em até 7 dias
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 30/100
python-rope/rope#925 ·
Mantenedores costumam responder em até 7 dias
-
Extract method/variable and introduce parameter don't check whether the new name is already in useAberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 62/100
python-rope/rope#924 ·
Mantenedores costumam responder em até 7 dias
Todas as issues de python-rope/rope
Issues semelhantes
-
HandyModRTransform.deriv3 is wrong for m > 2Talvez já em andamento @SajalDevX assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
read_messages: the first read after subscribe/psubscribe returns no messages even when some are waitingTalvez já em andamento @matheussilvano assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 80/100
The-Swarm-Corporation/swarms-framework-docs#399 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 1 dia
-
bump patch
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
autowarefoundation/autoware_carla_scenario#1321 ·
Mantenedores costumam responder em até 1 dia