[Suggestion] Refactor mx.py, source file too large

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
リファクタリング
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python
領域
cli

調査の方向性

まず mx.py を読み、既存の mx_[xxx].py モジュールとその構造を比較します。列挙されている関心事項(ビルドとテストのタスク、バージョン管理機能、依存関係の解決、ディストリビューション、IDE サポート)を使って、個別のモジュールに分ける境界を提案します。完了の条件は、レビュー済みのリファクタリング計画、または動作を変更せずに mx.py を小さくする段階的な変更です。

索引モデルが issue の本文から書いたものです。

説明

mx.py is growing rapidly and with this can be unreadable over time.

IDEs like IntelliJ/PyCharm are slowing down parsing the contents. Besides that its best to separate the different aspects of mx.py into separate source files/modules of their own, just like the other mx_[xxx].py files out there.

I glanced through the code and here are some of the high-level parts we could split mx.py into:

  • high-level tasks i.e. build, test, benchmark, etc...
  • git related functionality
  • hg related functionality
  • code blocks that split tasks into processes for multi-processing
  • suite related functionality (Creation and other management tasks)
  • dependency resolution related functionality
  • maven & dependency resolution related functionality
  • gradle & dependency resolution related functionality
  • distribution related functionality
  • IDE related functionality
  • others...

Please make your own suggestions on how you would best like it to be split, but from the current layout of the classes and methods in it, the above was apparent but maybe a better design is inherent and I'm not seeing it immediately.

A good rule to keep such important files lean: only have high-level implementations that outline what the program does, and the how it does it (i.e. implementation parts) would be best to encapsulate elsewhere via Packages, Modules, Classes, etc... This would make it easier to read and change, especially to debug when things break.

I'm happy to slowly refactor it and create PRs for individual concerns - let me know if this is okay and I will create a simple PR to start with?

主要言語
Python
スター
205
フォーク
131
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

graalvm/mx のほかの issue

graalvm/mx の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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