python / python/pymanager

Support shebang additional arguments

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

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

enhancement
Ngôn ngữ chính
Python
Star
344
Fork
74
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
7

Mô tả

Is your feature request related to a problem? Please describe.
I'm trying to set up a self contained script as discussed here. This works great on unix systems, but doesn't quite work on windows. One can almost create a shebang line that works on both with #!/usr/bin/env -S python3 -m uv run --script, except pymanager doesn't propagate the additional arguments.

Describe the solution you'd like
I would like the pymanager shebang handler to propagte additional arguments in the same way as the legacy launcher (reference).

Describe alternatives you've considered
One alternative would be to have pymanager support uv as a target directly, but that would require bespoke handling, and only work for this exact use-case. Handling additional arguments more generally would allow for running script through any sort of module (such as the built-in timeit module) or with any other arguments (such as -v).

Additional context
As mentioned above, the legacy launcher does support additional arguments, but doesn't support #!/usr/bin/env -S, so a cross-platform shebang line is not possible with either the legacy launcher or pymanager.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

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.

Hướng nghiên cứu

Bắt đầu với trình xử lý shebang của pymanager và so sánh cách xử lý đối số của nó với hành vi của trình khởi chạy legacy được mô tả trong tài liệu Python được liên kết. Theo dõi cách các đối số shebang bổ sung được phân tích và truyền khi chạy một script, sau đó xác minh rằng các đối số module và option như -m uv run --script, timeit-v được giữ nguyên.

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

Đánh giá

Công nghệ
python
Lĩnh vực
cli, operating-systems
Loại issue
Tính năng
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
52/100

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.