Skip to content

Add usethis show license command#1663

Merged
nathanjmcdougall merged 7 commits intomainfrom
copilot/add-usethis-show-license-command
Mar 31, 2026
Merged

Add usethis show license command#1663
nathanjmcdougall merged 7 commits intomainfrom
copilot/add-usethis-show-license-command

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 30, 2026

  • Add identify[license] as a project dependency
  • Add license detection error class to src/usethis/_integrations/project/errors.py
  • Create src/usethis/_integrations/project/license.py with license detection logic (heuristics: identify package → pyproject.toml license field → classifiers)
  • Add show_license() to src/usethis/_core/show.py
  • Add license CLI command to src/usethis/_ui/interface/show.py
  • Write unit tests for license detection logic (27 tests)
  • Write CLI integration tests for usethis show license (4 tests)
  • Run static checks and update auto-generated docs (prek ✓, basedpyright ✓)
  • Run code review and address feedback (narrowed exception handling, single backticks in docstrings)
  • Run CodeQL checks (0 alerts)

Resolves #1670

Skills used

  • usethis-qa-static-checks — for running prek and basedpyright

Copilot AI and others added 3 commits March 30, 2026 23:27
Implements license detection using three heuristics:
1. Scan common license files at root using `identify[license]` package
2. Read `project.license` field from pyproject.toml (PEP 639/621)
3. Check `project.classifiers` for license classifiers

Outputs the license in SPDX format.

Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/737efe22-3ae6-4f6b-9a10-74becba773ee

Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/737efe22-3ae6-4f6b-9a10-74becba773ee

Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/737efe22-3ae6-4f6b-9a10-74becba773ee

Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Copilot AI changed the title [WIP] Add usethis show license command Add usethis show license command Mar 30, 2026
Copilot AI requested a review from nathanjmcdougall March 30, 2026 23:36
@nathanjmcdougall nathanjmcdougall marked this pull request as ready for review March 30, 2026 23:52
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

❌ Patch coverage is 96.51163% with 3 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/usethis/_integrations/project/license.py 95.71% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 30, 2026

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing copilot/add-usethis-show-license-command (c424095) with main (ae394f8)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (3e81c35) during the generation of this report, so ae394f8 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Trove classifiers for licenses are deprecated.
@nathanjmcdougall nathanjmcdougall merged commit 53e020c into main Mar 31, 2026
20 checks passed
@nathanjmcdougall nathanjmcdougall deleted the copilot/add-usethis-show-license-command branch March 31, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In the usethis-agents agent skill, mention that the static checks skill should be used Create a usethis show license command

2 participants