launch prep: PyPI packaging, README, CI, bug fixes#16
Merged
Conversation
…ibutions Found by running devcard validate on a fresh card — 3 validation errors: - Activity: added longest_gap_days and active_days fields - Collaboration: added org_contributions array with OrgContribution objects - Root: added summary string field devcard validate now passes on generated output.
- Fix me command missing --enrich/--model/--verbose params - Add prominent rate limit warning for unauthenticated users - Package mappings/schema into wheel via force-include - Fix enrichment error message for pip users - Reduce 202 retry to best-effort (1 retry, 2s) - Add PyPI metadata (classifiers, keywords, URLs) - Add CI workflow (pytest + ruff, Python 3.11-3.13) - Add CONTRIBUTING.md - Add py.typed marker - Rewrite README for launch
There was a problem hiding this comment.
Pull request overview
Launch-prep changes to make DevCard ready for PyPI distribution and smoother first-run UX, while tightening a few extractor/advisor behaviors and adding CI coverage.
Changes:
- Package non-code assets (mappings + JSON schema) into the wheel and update runtime path resolution for installed vs. dev mode.
- Improve CLI/UX and robustness:
mecommand options parity, unauthenticated rate-limit warning, best-effort contributor stats retry, and clearer enrichment install error. - Advisor/extractor correctness tweaks: treat missing extractor outputs as
None, filter empty commit messages, and extend schema to cover new/optional fields.
Reviewed changes
Copilot reviewed 18 out of 20 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_extractors/test_commit_quality.py | Updates expectations for filtering empty/missing commit messages. |
| tests/test_advisor_engine.py | Adjusts context defaults to None on missing extractors; adds tests for None handling in rules + formatting. |
| src/devcard/validators/schema_validator.py | Loads schema from installed wheel data directory with dev fallback. |
| src/devcard/renderers/terminal.py | Improves “Lines Changed” rendering layout using Rich grouping. |
| src/devcard/py.typed | Marks package as typed for consumers. |
| src/devcard/mappings.py | Loads mappings from installed wheel data directory with dev fallback. |
| src/devcard/github/client.py | Adds has_token and reduces 202 retry behavior for contributor stats. |
| src/devcard/extractors/lines.py | Uses top repos list directly (repos already filtered upstream). |
| src/devcard/extractors/commit_quality.py | Filters empty messages and simplifies head-ref fetch flow. |
| src/devcard/extractors/activity.py | Avoids commit search endpoint unless authenticated (rate-limit friendly). |
| src/devcard/enrichment/provider.py | Updates install guidance to pip install devcard[enrich]. |
| src/devcard/cli.py | Adds token warning, fixes me option parity for enrich/model/verbose. |
| src/devcard/advisor/engine.py | Loads advisor rules from packaged data; formats None placeholders as N/A. |
| src/devcard/advisor/context.py | Makes many extracted fields optional (None) to distinguish “missing” vs “0”. |
| schema/devcard.v1.schema.json | Extends schema for summary + activity gap fields + org contribution breakdown. |
| README.md | Rewrites README for PyPI launch and agent-oriented positioning; updates install/run instructions. |
| pyproject.toml | Adds PyPI metadata, URLs, py.typed, and hatch wheel force-includes for data assets. |
| CONTRIBUTING.md | Adds contribution guidelines and common workflows. |
| .github/workflows/ci.yml | Adds CI workflow running ruff + pytest on Python 3.11–3.13. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
21
to
24
| """Extract lines added/deleted across a user's top repos.""" | ||
| try: | ||
| non_fork_repos = [r for r in repos if not r.fork][:MAX_REPOS] | ||
| non_fork_repos = repos[:MAX_REPOS] | ||
|
|
Comment on lines
321
to
+324
| table.add_row(rl.repo, f"+{rl.added:,}", f"-{rl.deleted:,}") | ||
| console.print(Panel("\n".join(lines), title="Lines Changed", border_style="bright_green")) | ||
| console.print(table) | ||
| from rich.console import Group | ||
| content = Group(summary, table) | ||
| console.print(Panel(content, title="Lines Changed", border_style="bright_green")) |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mecommand missing--enrich/--model/--verboseparamsTest plan
devcard --help)