Skip to content

Support poetry license metadata - #310

Merged
soimkim merged 2 commits into
mainfrom
feat/toml
Aug 26, 2026
Merged

Support poetry license metadata#310
soimkim merged 2 commits into
mainfrom
feat/toml

Conversation

@JustinWonjaePark

@JustinWonjaePark JustinWonjaePark commented Aug 25, 2026

Copy link
Copy Markdown
Contributor
  • Add support for licenses declared in Poetry configuration.

Signed-off-by: Park Wonjae <wonjae.park@lge.com>
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3c3a4e20-ffa9-4a9d-b49f-1c20d97a7276

📥 Commits

Reviewing files that changed from the base of the PR and between ca8c3bc and 2b154b0.

📒 Files selected for processing (1)
  • src/fosslight_source/run_manifest_extractor.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Changes

Pyproject license extraction

Layer / File(s) Summary
TOML license lookup
src/fosslight_source/run_manifest_extractor.py
The TOML path checks for an explicit project.license key and reads a string license from tool.poetry.license.
Regex license lookup
src/fosslight_source/run_manifest_extractor.py
The regex fallback handles missing [project] sections, reads project license values, and reads quoted Poetry license values. The file-form license branch was removed.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 2b154

This localized manifest metadata change has no actionable merge-blocking risk remaining and is merge-ready after normal checks and review.

Suggested reviewers: soimkim

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding Poetry license metadata support in the manifest extractor.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/toml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@JustinWonjaePark JustinWonjaePark self-assigned this Aug 25, 2026
@JustinWonjaePark JustinWonjaePark added the chore [PR/Issue] Refactoring, maintenance the code label Aug 25, 2026
@JustinWonjaePark
JustinWonjaePark marked this pull request as ready for review August 25, 2026 09:11
@soimkim soimkim changed the title feat(manifest): support legacy Poetry license metadata feat(manifest): support Poetry license metadata Aug 26, 2026
When tomllib/tomli loads the file, return immediately so Poetry/PEP 621 results are not re-read via regex.

@soimkim soimkim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

항목 평가
비효율 tomllib 성공 후 regex fall-through가 가장 큰 낭비

@soimkim soimkim changed the title feat(manifest): support Poetry license metadata feat(manifest): support poetry license metadata Aug 26, 2026
@soimkim

soimkim commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

@JustinWonjaePark , 추가 수정에 대한 설명입니다.
배경
get_licenses_from_pyproject_toml

  1. tomllib / tomli로 구조 파싱 (PEP 621 [project], Poetry legacy [tool.poetry])
  2. 파서 실패 시를 위한 텍스트 regex fallback
    이전에는 1번이 성공해도 license를 못 찾으면 return 없이 2번으로 넘어가, 같은 파일을 다시 읽고 regex로 재검색

변경
구조 파싱이 성공하면 license 유무와 관계없이 즉시 반환합니다.

  • license를 찾음 → 기존처럼 해당 리스트 return
  • 못 찾음 / {file=...} 등 → [] return
  • regex fallback은 tomllib/tomli가 실패한 경우에만 수행

이유

  • 유효한 TOML이면 구조 파싱 결과가 기준이어야 함
  • 이중 I/O·regex는 불필요하고, 주석 등에서 license= 오탐 여지도 있음
  • 정상 케이스(PEP 621 string/{text=}, Poetry legacy, {file=}→[])의 추출 결과는 동일

@soimkim
soimkim merged commit cda05fb into main Aug 26, 2026
7 of 8 checks passed
@soimkim
soimkim deleted the feat/toml branch August 26, 2026 01:27
@soimkim soimkim changed the title feat(manifest): support poetry license metadata Support poetry license metadata Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore [PR/Issue] Refactoring, maintenance the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants