codestrain 0.1.2__tar.gz → 0.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {codestrain-0.1.2 → codestrain-0.1.3}/.github/workflows/ci.yml +4 -0
- codestrain-0.1.3/.github/workflows/release.yml +125 -0
- {codestrain-0.1.2 → codestrain-0.1.3}/PKG-INFO +1 -1
- {codestrain-0.1.2 → codestrain-0.1.3}/pyproject.toml +1 -1
- codestrain-0.1.2/.github/workflows/release.yml +0 -80
- {codestrain-0.1.2 → codestrain-0.1.3}/.assets/logo.png +0 -0
- {codestrain-0.1.2 → codestrain-0.1.3}/.gitignore +0 -0
- {codestrain-0.1.2 → codestrain-0.1.3}/CONTRIBUTING.md +0 -0
- {codestrain-0.1.2 → codestrain-0.1.3}/LICENSE +0 -0
- {codestrain-0.1.2 → codestrain-0.1.3}/README.md +0 -0
- {codestrain-0.1.2 → codestrain-0.1.3}/TESTING.md +0 -0
- {codestrain-0.1.2 → codestrain-0.1.3}/codestrain_cli.py +0 -0
- {codestrain-0.1.2 → codestrain-0.1.3}/tests/__init__.py +0 -0
- {codestrain-0.1.2 → codestrain-0.1.3}/tests/conftest.py +0 -0
- {codestrain-0.1.2 → codestrain-0.1.3}/tests/fixtures/projects/-Users-test-projectA/session-001.jsonl +0 -0
- {codestrain-0.1.2 → codestrain-0.1.3}/tests/fixtures/projects/-Users-test-projectA/session-002.jsonl +0 -0
- {codestrain-0.1.2 → codestrain-0.1.3}/tests/fixtures/projects/-Users-test-projectB/session-003.jsonl +0 -0
- {codestrain-0.1.2 → codestrain-0.1.3}/tests/fixtures/projects/empty-project/empty.jsonl +0 -0
- {codestrain-0.1.2 → codestrain-0.1.3}/tests/smoke.sh +0 -0
- {codestrain-0.1.2 → codestrain-0.1.3}/tests/test_jsonl.py +0 -0
- {codestrain-0.1.2 → codestrain-0.1.3}/tests/test_unit.py +0 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
# Opt into Node.js 24 for JS-based actions; default will flip on 2026-06-02.
|
|
9
|
+
# See https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
|
|
10
|
+
env:
|
|
11
|
+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
build:
|
|
15
|
+
name: Build distributions
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Set up Python
|
|
22
|
+
uses: actions/setup-python@v5
|
|
23
|
+
with:
|
|
24
|
+
python-version: "3.12"
|
|
25
|
+
|
|
26
|
+
- name: Install build tooling
|
|
27
|
+
run: python -m pip install --upgrade build
|
|
28
|
+
|
|
29
|
+
- name: Build sdist and wheel
|
|
30
|
+
working-directory: .
|
|
31
|
+
run: python -m build
|
|
32
|
+
|
|
33
|
+
- name: Upload distributions
|
|
34
|
+
uses: actions/upload-artifact@v4
|
|
35
|
+
with:
|
|
36
|
+
name: dist
|
|
37
|
+
path: dist/
|
|
38
|
+
|
|
39
|
+
publish:
|
|
40
|
+
name: Publish to PyPI
|
|
41
|
+
needs: build
|
|
42
|
+
runs-on: ubuntu-latest
|
|
43
|
+
environment: pypi
|
|
44
|
+
permissions:
|
|
45
|
+
id-token: write
|
|
46
|
+
steps:
|
|
47
|
+
- name: Download distributions
|
|
48
|
+
uses: actions/download-artifact@v4
|
|
49
|
+
with:
|
|
50
|
+
name: dist
|
|
51
|
+
path: dist/
|
|
52
|
+
|
|
53
|
+
- name: Publish to PyPI via Trusted Publisher
|
|
54
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
55
|
+
|
|
56
|
+
bump-homebrew:
|
|
57
|
+
name: Bump Homebrew Formula
|
|
58
|
+
needs: publish
|
|
59
|
+
runs-on: ubuntu-latest
|
|
60
|
+
if: ${{ !contains(github.ref_name, 'rc') && !contains(github.ref_name, 'a') && !contains(github.ref_name, 'b') }}
|
|
61
|
+
steps:
|
|
62
|
+
# mislav/bump-homebrew-formula-action proved flaky against PyPI's
|
|
63
|
+
# /packages/source/ redirect (HTTP 404 on its HEAD probe even after
|
|
64
|
+
# the file is reachable via GET). Rolling our own bump is more
|
|
65
|
+
# reliable and easier to debug: query PyPI's JSON API for the
|
|
66
|
+
# canonical URL + sha256, then sed-update the formula and push.
|
|
67
|
+
|
|
68
|
+
- name: Wait for PyPI propagation
|
|
69
|
+
run: sleep 60
|
|
70
|
+
|
|
71
|
+
- name: Fetch PyPI sdist metadata
|
|
72
|
+
id: pypi
|
|
73
|
+
run: |
|
|
74
|
+
set -eu
|
|
75
|
+
VERSION="${GITHUB_REF_NAME#v}"
|
|
76
|
+
echo "Looking up codestrain==$VERSION on PyPI..."
|
|
77
|
+
# Retry up to 6 times (1 min total) in case the metadata
|
|
78
|
+
# endpoint lags behind the file CDN.
|
|
79
|
+
for i in 1 2 3 4 5 6; do
|
|
80
|
+
BODY=$(curl -fsS "https://pypi.org/pypi/codestrain/$VERSION/json" 2>/dev/null) && break
|
|
81
|
+
echo " attempt $i failed; sleeping 10s"
|
|
82
|
+
sleep 10
|
|
83
|
+
done
|
|
84
|
+
if [ -z "${BODY:-}" ]; then
|
|
85
|
+
echo "::error::PyPI metadata for codestrain==$VERSION never appeared"
|
|
86
|
+
exit 1
|
|
87
|
+
fi
|
|
88
|
+
URL=$(echo "$BODY" | jq -r '.urls[] | select(.packagetype=="sdist") | .url')
|
|
89
|
+
SHA=$(echo "$BODY" | jq -r '.urls[] | select(.packagetype=="sdist") | .digests.sha256')
|
|
90
|
+
echo " url=$URL"
|
|
91
|
+
echo " sha=$SHA"
|
|
92
|
+
{
|
|
93
|
+
echo "version=$VERSION"
|
|
94
|
+
echo "url=$URL"
|
|
95
|
+
echo "sha=$SHA"
|
|
96
|
+
} >> "$GITHUB_OUTPUT"
|
|
97
|
+
|
|
98
|
+
- name: Update Formula in codestrain/homebrew-tap
|
|
99
|
+
env:
|
|
100
|
+
COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
|
|
101
|
+
VERSION: ${{ steps.pypi.outputs.version }}
|
|
102
|
+
URL: ${{ steps.pypi.outputs.url }}
|
|
103
|
+
SHA: ${{ steps.pypi.outputs.sha }}
|
|
104
|
+
run: |
|
|
105
|
+
set -eu
|
|
106
|
+
git clone --depth 1 \
|
|
107
|
+
"https://x-access-token:${COMMITTER_TOKEN}@github.com/codestrain/homebrew-tap.git" tap
|
|
108
|
+
cd tap
|
|
109
|
+
# sed has to use a delimiter that doesn't appear in URLs (|).
|
|
110
|
+
sed -i -E "s|^ url \".*\"| url \"${URL}\"|" Formula/codestrain.rb
|
|
111
|
+
sed -i -E "s|^ sha256 \".*\"| sha256 \"${SHA}\"|" Formula/codestrain.rb
|
|
112
|
+
echo "=== updated formula ==="
|
|
113
|
+
head -12 Formula/codestrain.rb
|
|
114
|
+
git config user.email "actions@github.com"
|
|
115
|
+
git config user.name "github-actions[bot]"
|
|
116
|
+
git add Formula/codestrain.rb
|
|
117
|
+
if git diff --cached --quiet; then
|
|
118
|
+
echo "no formula change — skipping commit"
|
|
119
|
+
exit 0
|
|
120
|
+
fi
|
|
121
|
+
git commit -m "codestrain ${VERSION}
|
|
122
|
+
|
|
123
|
+
Auto-bumped from PyPI sdist for tag ${GITHUB_REF_NAME}.
|
|
124
|
+
Source: https://github.com/codestrain/codestrain-cli/releases/tag/${GITHUB_REF_NAME}"
|
|
125
|
+
git push
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
name: Release
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
tags:
|
|
6
|
-
- "v*"
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
build:
|
|
10
|
-
name: Build distributions
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
steps:
|
|
13
|
-
- name: Checkout
|
|
14
|
-
uses: actions/checkout@v4
|
|
15
|
-
|
|
16
|
-
- name: Set up Python
|
|
17
|
-
uses: actions/setup-python@v5
|
|
18
|
-
with:
|
|
19
|
-
python-version: "3.12"
|
|
20
|
-
|
|
21
|
-
- name: Install build tooling
|
|
22
|
-
run: python -m pip install --upgrade build
|
|
23
|
-
|
|
24
|
-
- name: Build sdist and wheel
|
|
25
|
-
working-directory: .
|
|
26
|
-
run: python -m build
|
|
27
|
-
|
|
28
|
-
- name: Upload distributions
|
|
29
|
-
uses: actions/upload-artifact@v4
|
|
30
|
-
with:
|
|
31
|
-
name: dist
|
|
32
|
-
path: dist/
|
|
33
|
-
|
|
34
|
-
publish:
|
|
35
|
-
name: Publish to PyPI
|
|
36
|
-
needs: build
|
|
37
|
-
runs-on: ubuntu-latest
|
|
38
|
-
environment: pypi
|
|
39
|
-
permissions:
|
|
40
|
-
id-token: write
|
|
41
|
-
steps:
|
|
42
|
-
- name: Download distributions
|
|
43
|
-
uses: actions/download-artifact@v4
|
|
44
|
-
with:
|
|
45
|
-
name: dist
|
|
46
|
-
path: dist/
|
|
47
|
-
|
|
48
|
-
- name: Publish to PyPI via Trusted Publisher
|
|
49
|
-
uses: pypa/gh-action-pypi-publish@release/v1
|
|
50
|
-
|
|
51
|
-
bump-homebrew:
|
|
52
|
-
name: Bump Homebrew Formula
|
|
53
|
-
needs: publish
|
|
54
|
-
runs-on: ubuntu-latest
|
|
55
|
-
if: ${{ !contains(github.ref_name, 'rc') && !contains(github.ref_name, 'a') && !contains(github.ref_name, 'b') }}
|
|
56
|
-
steps:
|
|
57
|
-
# Wait briefly so the new sdist is queryable on PyPI's CDN.
|
|
58
|
-
- name: Wait for PyPI propagation
|
|
59
|
-
run: sleep 30
|
|
60
|
-
|
|
61
|
-
- name: Open PR against codestrain/homebrew-tap
|
|
62
|
-
uses: mislav/bump-homebrew-formula-action@v3
|
|
63
|
-
with:
|
|
64
|
-
formula-name: codestrain
|
|
65
|
-
formula-path: Formula/codestrain.rb
|
|
66
|
-
homebrew-tap: codestrain/homebrew-tap
|
|
67
|
-
base-branch: main
|
|
68
|
-
# Compute download URL from the just-published PyPI sdist.
|
|
69
|
-
# mislav/bump-homebrew-formula-action auto-strips `v` prefix from
|
|
70
|
-
# github.ref_name, so v0.1.2 → 0.1.2 in the URL.
|
|
71
|
-
download-url: https://files.pythonhosted.org/packages/source/c/codestrain/codestrain-${{ github.ref_name }}.tar.gz
|
|
72
|
-
commit-message: |
|
|
73
|
-
codestrain {{version}}
|
|
74
|
-
|
|
75
|
-
Auto-bumped by mislav/bump-homebrew-formula-action.
|
|
76
|
-
Source: https://github.com/codestrain/codestrain-cli/releases/tag/${{ github.ref_name }}
|
|
77
|
-
env:
|
|
78
|
-
# Fine-grained PAT with `Contents: write` on codestrain/homebrew-tap.
|
|
79
|
-
# Stored as a repo secret in codestrain/codestrain-cli.
|
|
80
|
-
COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codestrain-0.1.2 → codestrain-0.1.3}/tests/fixtures/projects/-Users-test-projectA/session-001.jsonl
RENAMED
|
File without changes
|
{codestrain-0.1.2 → codestrain-0.1.3}/tests/fixtures/projects/-Users-test-projectA/session-002.jsonl
RENAMED
|
File without changes
|
{codestrain-0.1.2 → codestrain-0.1.3}/tests/fixtures/projects/-Users-test-projectB/session-003.jsonl
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|