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

Đang mở
#194 16 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
cli

Hướng nghiên cứu

Bắt đầu bằng cách đọc mx.py và so sánh cấu trúc của nó với các mô-đun mx_[xxx].py hiện có. Sử dụng các mối quan tâm được liệt kê —các tác vụ build và test, chức năng kiểm soát phiên bản, phân giải dependency, các bản phân phối và hỗ trợ IDE— để đề xuất ranh giới cho các mô-đun riêng biệt. Được xem là hoàn thành khi có kế hoạch refactoring đã được review hoặc các thay đổi tăng dần giúp mx.py nhỏ hơn mà không thay đổi hành vi của nó.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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?

Ngôn ngữ chính
Python
Star
205
Fork
131
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của graalvm/mx

Tất cả issue của graalvm/mx

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.