Enhancement: read `[options.extras_require]` from `setup.cfg` as optional dependencies

Đang mở Phù hợp với người mới
#708 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
85/100
Loại issue
Tính năng
Độ 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
backend, data

Hướng nghiên cứu

Bắt đầu tại src/core-open/scanners/python-scanner.ts, ở parseSetupCfg (khoảng dòng 1131–1158), sau đó đọc cách xử lý hiện có cho [options] và [project.optional-dependencies]. Thêm kiểm thử cho các trường hợp extras được liệt kê và xem test/sbom-python-optional.test.ts cùng docs/sbom-dependency-scope.md để xác định phạm vi SBOM mong đợi. Hoàn tất khi extras trở thành optionalDependencies, các yêu cầu production vẫn được ưu tiên và extras rỗng hoặc không có không thêm gói nào.

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

Mô tả

enhancement good first issue
  • Difficulty: small
  • Area: Python scanner / SBOM
Problem

parseSetupCfg in src/core-open/scanners/python-scanner.ts (around lines 1131–1158) reads [options] install_requires and python_requires only. It never looks at [options.extras_require]:

[options.extras_require]
dev =
    pytest>=7
    ruff
docs = sphinx>=7

PEP 621 [project.optional-dependencies] is already exported as optionalDependencies. A setuptools project that still uses setup.cfg extras has those packages missing from vg scan and vg sbom export.

Expected behaviour

Every extra in [options.extras_require] becomes a row with section optionalDependencies, the same way [project.optional-dependencies] does. A package already listed in install_requires stays a production row and keeps the production spec. Extra names do not become packages.

Acceptance
  • Tests cover one extra, several extras, a package in both install_requires and an extra (production wins), and a setup.cfg with no extras section (unchanged).
  • vg sbom export marks those rows the same way other optional Python extras are marked (see docs/sbom-dependency-scope.md and test/sbom-python-optional.test.ts).
  • An empty extras section does not invent packages.

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.