Bug: `setup.cfg` `install_requires` on the same line as the key is not read

Đang mở Phù hợp với người mới
#707 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

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

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
88/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python, typescript
Lĩnh vực
cli, devtools

Hướng nghiên cứu

Bắt đầu tại src/core-open/scanners/python-scanner.ts, ở parseSetupCfg, và đọc cách install_requires được khớp cũng như cách từng mục được chuyển cho parseRequirementLine. Thêm hoặc mở rộng các bài kiểm tra manifest Python bên cạnh các bài kiểm tra hiện có, kiểm tra các dạng trên cùng dòng, dạng tiếp nối và dạng xuống dòng rồi thụt lề, đồng thời xác nhận python_requires không thay đổi. Hoàn thành khi mọi gói được liệt kê đều được báo cáo và dạng hiện có vẫn đạt.

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

Mô tả

bug good first issue
  • Difficulty: small
  • Area: Python scanner
Problem

parseSetupCfg in src/core-open/scanners/python-scanner.ts (around line 1148) only matches a multiline indented list:

const installReqMatch = optionsSection[1]!.match(/install_requires\s*=\s*\n((?:\s+.*\n?)*)/);

The regex requires a newline after =. These common forms are dropped:

[options]
install_requires = requests>=2.31, flask>=3.0
[options]
install_requires = requests>=2.31
    flask>=3.0

The already-supported form (value starts on the next line, one requirement per indented line) must keep working.

Expected behaviour

install_requires accepts a same-line list (comma-separated or a single requirement), a list that starts on the same line and continues with indented lines, and the current newline-then-indent form. Each entry is parsed with the existing parseRequirementLine helper.

Acceptance
  • Tests live next to other Python manifest tests (for example a new test/python-setup-cfg.test.ts, or cases in test/python-runtime-pin.test.ts).
  • install_requires = requests>=2.31 on one line reports requests.
  • A comma-separated same-line list reports every package.
  • A value that starts on the same line and continues with indented lines reports every package.
  • The current indented-only form still works.
  • python_requires on the same [options] section is unchanged.

Ngôn ngữ chính
TypeScript
Star
4
Fork
3
Merge trung bình
1 ngày 22 giờ
Pull request đã merge (30 ngày)
76

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 vibgrate/cli

Tất cả issue của vibgrate/cli

Issue tương tự

Thêm issue về TypeScript

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.