Package to Module Conversion

Aperta
#791 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 7 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
18/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
tooling

Direzione di ricerca

The request is a package-to-module refactoring, the inverse of the existing topackage refactoring that the issue mentions; use that as the reference for how rope rewrites imports across a project. The issue leaves open how to merge __init__.py, bar.py and barbar.py into one file and how to rewrite from foo.bar import X references, so the design has to be settled before any code. Done would mean a tested refactoring that turns a package into a module and rewrites the imports, agreed with the maintainers first.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I have multiple packages with containing very small modules (e.g. 10 lines of code).
I would like to turn a package into a module:

foo/
  __init__.py
 bar.py
 barbar.py

becomes: foo.py containing all code of foo/{__init__.py,bar.py, barbar.py} without relatives import. All other imports of a project needs to be rewritten, from foo.bar import X becomes from foo import X.

I see there is a topackage, so it would be kind of the inverse, I guess?

Lingua principale
Python
Stelle
2.2k
Fork
197
Merge medio
2g 13h
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di python-rope/rope

Tutte le issue di python-rope/rope

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.