Skip to content

Commit dbab9e5

Browse files
committed
Finalize CLI, package, and repo polish for test release
1 parent 9e66051 commit dbab9e5

39 files changed

Lines changed: 1929 additions & 318 deletions

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @oceanusXXD
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Bug report
3+
about: Report a reproducible problem in code2skill
4+
title: "[Bug] "
5+
labels: bug
6+
assignees: ""
7+
---
8+
9+
## Summary
10+
11+
## Reproduction Steps
12+
13+
## Expected Behavior
14+
15+
## Actual Behavior
16+
17+
## Environment
18+
19+
- Python version:
20+
- OS:
21+
- code2skill version:
22+
23+
## Additional Context

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Usage questions
4+
url: https://github.com/oceanusXXD/code2skill/discussions
5+
about: Ask workflow or adoption questions in Discussions when available.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name: Feature request
3+
about: Propose a new capability or workflow improvement
4+
title: "[Feature] "
5+
labels: enhancement
6+
assignees: ""
7+
---
8+
9+
## Problem Statement
10+
11+
## Proposed Behavior
12+
13+
## Alternatives Considered
14+
15+
## Additional Context

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## Summary
2+
3+
- what changed
4+
- why it changed
5+
6+
## Validation
7+
8+
- [ ] `python -m pytest -q`
9+
- [ ] `python -m build`
10+
- [ ] `python -m twine check dist/*` when packaging changed
11+
12+
## Docs And Release Notes
13+
14+
- [ ] docs updated if CLI/API/release behavior changed
15+
- [ ] changelog updated if release-facing behavior changed
16+
- [ ] release note added under `docs/releases/` if preparing a release

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 5
8+
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: weekly
13+
open-pull-requests-limit: 5

.github/workflows/ci.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
test-and-build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: ["3.10", "3.11", "3.12"]
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Upgrade pip
27+
run: python -m pip install --upgrade pip
28+
29+
- name: Install test dependencies
30+
run: python -m pip install -e .[test]
31+
32+
- name: Run unit tests
33+
run: python -m pytest -q
34+
35+
package-smoke:
36+
runs-on: ubuntu-latest
37+
needs: test-and-build
38+
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v4
42+
43+
- name: Setup Python
44+
uses: actions/setup-python@v5
45+
with:
46+
python-version: "3.12"
47+
48+
- name: Upgrade pip
49+
run: python -m pip install --upgrade pip
50+
51+
- name: Install release dependencies
52+
run: python -m pip install -e .[release]
53+
54+
- name: Build package
55+
run: python -m build
56+
57+
- name: Check package metadata
58+
run: python -m twine check dist/*
59+
60+
- name: Install built wheel
61+
shell: bash
62+
run: |
63+
python -m pip install dist/code2skill-*.whl
64+
code2skill --help
65+
python -m code2skill --version
66+
python - <<'PY'
67+
import importlib.resources
68+
from code2skill import adapt_repository, create_scan_config, estimate, run_ci, scan
69+
70+
assert all(callable(item) for item in [adapt_repository, create_scan_config, estimate, run_ci, scan])
71+
assert importlib.resources.files("code2skill").joinpath("py.typed").is_file()
72+
PY

.github/workflows/release.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
id-token: write
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.12"
23+
24+
- name: Upgrade pip
25+
run: python -m pip install --upgrade pip
26+
27+
- name: Install release dependencies
28+
run: python -m pip install -e .[release]
29+
30+
- name: Build package
31+
run: python -m build
32+
33+
- name: Check package metadata
34+
run: python -m twine check dist/*
35+
36+
- name: Validate version and release note
37+
shell: bash
38+
run: |
39+
python - <<'PY'
40+
import pathlib
41+
import tomllib
42+
import sys
43+
44+
root = pathlib.Path(".")
45+
sys.path.insert(0, str(root / "src"))
46+
from code2skill import __version__
47+
48+
tag = "${{ github.ref_name }}"
49+
version = tag.removeprefix("v")
50+
pyproject = tomllib.loads((root / "pyproject.toml").read_text(encoding="utf-8"))
51+
declared = pyproject["project"]["version"]
52+
if declared != version:
53+
raise SystemExit(f"Tag {tag} does not match pyproject version {declared}.")
54+
if __version__ != version:
55+
raise SystemExit(f"Tag {tag} does not match runtime version {__version__}.")
56+
release_note = root / "docs" / "releases" / f"v{version}.md"
57+
if not release_note.exists():
58+
raise SystemExit(f"Missing release note file: {release_note}")
59+
PY
60+
61+
- name: Publish to PyPI
62+
uses: pypa/gh-action-pypi-publish@release/v1
63+
64+
- name: Create GitHub Release
65+
uses: softprops/action-gh-release@v2
66+
with:
67+
body_path: docs/releases/${{ github.ref_name }}.md

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ __pycache__/
44
.pytest_cache/
55
.venv/
66
venv/
7+
.venv-smoke/
78
# Generated analysis and Skill outputs.
89
.code2skill/
910
.code2skill-*/
1011
# Local release/smoke environments.
1112
.pypi-smoke/
1213
.pypi-smoke-out/
14+
.release-smoke/
1315
build/
1416
dist/

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Changelog
2+
3+
This file tracks repository-level release history for `code2skill`.
4+
Detailed notes for each tagged release live under [`docs/releases/`](./docs/releases/).
5+
6+
## Unreleased
7+
8+
- Added checked-in GitHub Actions workflows for CI and tagged releases.
9+
- Added dedicated CLI, Python API, output layout, and release guide documents.
10+
- Added package typing metadata via `py.typed`.
11+
- Split package extras into `test`, `release`, and `dev`.
12+
13+
## v0.1.4
14+
15+
- Release notes: [docs/releases/v0.1.4.md](./docs/releases/v0.1.4.md)
16+
17+
## v0.1.3
18+
19+
- Release notes: [docs/releases/v0.1.3.md](./docs/releases/v0.1.3.md)
20+
21+
## v0.1.2
22+
23+
- Release notes: [docs/releases/v0.1.2.md](./docs/releases/v0.1.2.md)
24+
25+
## v0.1.1
26+
27+
- Release notes: [docs/releases/v0.1.1.md](./docs/releases/v0.1.1.md)
28+
29+
## v0.1.0
30+
31+
- Release notes: [docs/releases/v0.1.0.md](./docs/releases/v0.1.0.md)

0 commit comments

Comments
 (0)