ghp 0.1.0__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.
- ghp-0.1.0/.github/workflows/ci.yml +40 -0
- ghp-0.1.0/.github/workflows/publish.yml +52 -0
- ghp-0.1.0/.gitignore +6 -0
- ghp-0.1.0/PKG-INFO +63 -0
- ghp-0.1.0/README.md +55 -0
- ghp-0.1.0/pyproject.toml +19 -0
- ghp-0.1.0/scripts/test-install.sh +22 -0
- ghp-0.1.0/src/ghp/__init__.py +0 -0
- ghp-0.1.0/src/ghp/cli.py +610 -0
- ghp-0.1.0/tests/test_cli.py +342 -0
- ghp-0.1.0/tests/test_packaging.py +15 -0
- ghp-0.1.0/uv.lock +136 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- uses: actions/setup-python@v5
|
|
14
|
+
with:
|
|
15
|
+
python-version: "3.11"
|
|
16
|
+
- uses: astral-sh/setup-uv@v5
|
|
17
|
+
- name: unit
|
|
18
|
+
run: PYTHONPATH=src python -m unittest discover -s tests
|
|
19
|
+
- name: build
|
|
20
|
+
run: |
|
|
21
|
+
uv venv
|
|
22
|
+
. .venv/bin/activate
|
|
23
|
+
uv pip install build
|
|
24
|
+
python -m build
|
|
25
|
+
- name: uv tool smoke
|
|
26
|
+
env:
|
|
27
|
+
HOME: ${{ runner.temp }}/home-dist
|
|
28
|
+
UV_CACHE_DIR: ${{ runner.temp }}/uv-cache
|
|
29
|
+
run: |
|
|
30
|
+
mkdir -p "$HOME"
|
|
31
|
+
uv tool install --force --no-index --find-links dist ghp
|
|
32
|
+
"$HOME/.local/bin/ghp" --help
|
|
33
|
+
- name: uv tool local smoke
|
|
34
|
+
env:
|
|
35
|
+
HOME: ${{ runner.temp }}/home-local
|
|
36
|
+
UV_CACHE_DIR: ${{ runner.temp }}/uv-cache-local
|
|
37
|
+
run: |
|
|
38
|
+
mkdir -p "$HOME"
|
|
39
|
+
uv tool install --force -e .
|
|
40
|
+
"$HOME/.local/bin/ghp" --help
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- uses: actions/setup-python@v5
|
|
14
|
+
with:
|
|
15
|
+
python-version: "3.11"
|
|
16
|
+
- name: build
|
|
17
|
+
run: |
|
|
18
|
+
python -m pip install --upgrade build
|
|
19
|
+
python -m build
|
|
20
|
+
- uses: actions/upload-artifact@v4
|
|
21
|
+
with:
|
|
22
|
+
name: dist
|
|
23
|
+
path: dist/
|
|
24
|
+
|
|
25
|
+
publish:
|
|
26
|
+
needs: build
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
permissions:
|
|
29
|
+
id-token: write
|
|
30
|
+
environment:
|
|
31
|
+
name: pypi
|
|
32
|
+
url: https://pypi.org/p/ghp
|
|
33
|
+
steps:
|
|
34
|
+
- uses: actions/download-artifact@v4
|
|
35
|
+
with:
|
|
36
|
+
name: dist
|
|
37
|
+
path: dist/
|
|
38
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
39
|
+
|
|
40
|
+
verify:
|
|
41
|
+
needs: publish
|
|
42
|
+
runs-on: ubuntu-latest
|
|
43
|
+
steps:
|
|
44
|
+
- uses: astral-sh/setup-uv@v5
|
|
45
|
+
- name: verify pypi install
|
|
46
|
+
env:
|
|
47
|
+
HOME: ${{ runner.temp }}/home
|
|
48
|
+
UV_CACHE_DIR: ${{ runner.temp }}/uv-cache
|
|
49
|
+
run: |
|
|
50
|
+
mkdir -p "$HOME"
|
|
51
|
+
uv tool install --force ghp
|
|
52
|
+
"$HOME/.local/bin/ghp" --help
|
ghp-0.1.0/.gitignore
ADDED
ghp-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ghp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Stateless GitHub activity summary — compact, LLM-friendly output
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Requires-Python: >=3.9
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
|
|
9
|
+
# ghp
|
|
10
|
+
|
|
11
|
+
Stateless GitHub activity summary. Compact, LLM-friendly output.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
uv tool install ghp
|
|
17
|
+
# or
|
|
18
|
+
uvx ghp
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Dev
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
uv sync --group dev
|
|
25
|
+
uv run ghp --version
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
ghp # open issues + PRs snapshot
|
|
32
|
+
ghp 1h # deltas since 1 hour ago
|
|
33
|
+
ghp 2026-03-07T14:00:00Z # deltas since timestamp
|
|
34
|
+
ghp --json # machine-readable output
|
|
35
|
+
ghp --me @clod # highlight mentions
|
|
36
|
+
ghp --repo owner/name # explicit repo
|
|
37
|
+
# default delta cursor comes from .ghp-last-update-timestamp if present
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Behavior
|
|
41
|
+
|
|
42
|
+
- Cursor defaults to `.ghp-last-update-timestamp` in the current working directory when `--since` is omitted.
|
|
43
|
+
- Successful runs autosave the current timestamp back to `.ghp-last-update-timestamp`.
|
|
44
|
+
- `--since` accepts relative shorthands (`30m`, `2h`, `1d`, `1w`) and normalizes timestamps to canonical UTC.
|
|
45
|
+
- Snapshot mode returns open issues and open PRs.
|
|
46
|
+
- Delta mode returns issues, PRs, issue comments, PR review comments, and recent commits since the cutoff.
|
|
47
|
+
- API or auth failures exit non-zero instead of silently pretending there was no activity.
|
|
48
|
+
- `--json` prints a machine-readable payload; on failure it emits a JSON object with an `error` field and exits non-zero.
|
|
49
|
+
|
|
50
|
+
## Auth
|
|
51
|
+
|
|
52
|
+
Looks for tokens in this order:
|
|
53
|
+
1. `$GITHUB_PAT`
|
|
54
|
+
2. `$GITHUB_TOKEN`
|
|
55
|
+
3. `$GH_TOKEN`
|
|
56
|
+
4. `gh auth token` (gh CLI)
|
|
57
|
+
|
|
58
|
+
## Test
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
uv run python -m unittest discover -s tests
|
|
62
|
+
scripts/test-install.sh
|
|
63
|
+
```
|
ghp-0.1.0/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# ghp
|
|
2
|
+
|
|
3
|
+
Stateless GitHub activity summary. Compact, LLM-friendly output.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
uv tool install ghp
|
|
9
|
+
# or
|
|
10
|
+
uvx ghp
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Dev
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
uv sync --group dev
|
|
17
|
+
uv run ghp --version
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
ghp # open issues + PRs snapshot
|
|
24
|
+
ghp 1h # deltas since 1 hour ago
|
|
25
|
+
ghp 2026-03-07T14:00:00Z # deltas since timestamp
|
|
26
|
+
ghp --json # machine-readable output
|
|
27
|
+
ghp --me @clod # highlight mentions
|
|
28
|
+
ghp --repo owner/name # explicit repo
|
|
29
|
+
# default delta cursor comes from .ghp-last-update-timestamp if present
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Behavior
|
|
33
|
+
|
|
34
|
+
- Cursor defaults to `.ghp-last-update-timestamp` in the current working directory when `--since` is omitted.
|
|
35
|
+
- Successful runs autosave the current timestamp back to `.ghp-last-update-timestamp`.
|
|
36
|
+
- `--since` accepts relative shorthands (`30m`, `2h`, `1d`, `1w`) and normalizes timestamps to canonical UTC.
|
|
37
|
+
- Snapshot mode returns open issues and open PRs.
|
|
38
|
+
- Delta mode returns issues, PRs, issue comments, PR review comments, and recent commits since the cutoff.
|
|
39
|
+
- API or auth failures exit non-zero instead of silently pretending there was no activity.
|
|
40
|
+
- `--json` prints a machine-readable payload; on failure it emits a JSON object with an `error` field and exits non-zero.
|
|
41
|
+
|
|
42
|
+
## Auth
|
|
43
|
+
|
|
44
|
+
Looks for tokens in this order:
|
|
45
|
+
1. `$GITHUB_PAT`
|
|
46
|
+
2. `$GITHUB_TOKEN`
|
|
47
|
+
3. `$GH_TOKEN`
|
|
48
|
+
4. `gh auth token` (gh CLI)
|
|
49
|
+
|
|
50
|
+
## Test
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
uv run python -m unittest discover -s tests
|
|
54
|
+
scripts/test-install.sh
|
|
55
|
+
```
|
ghp-0.1.0/pyproject.toml
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "ghp"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Stateless GitHub activity summary — compact, LLM-friendly output"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
|
|
13
|
+
[project.scripts]
|
|
14
|
+
ghp = "ghp.cli:main"
|
|
15
|
+
|
|
16
|
+
[dependency-groups]
|
|
17
|
+
dev = [
|
|
18
|
+
"build",
|
|
19
|
+
]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
5
|
+
tmp="$(mktemp -d)"
|
|
6
|
+
trap 'rm -rf "$tmp"' EXIT
|
|
7
|
+
|
|
8
|
+
cd "$root"
|
|
9
|
+
|
|
10
|
+
export UV_CACHE_DIR="$tmp/cache-build"
|
|
11
|
+
export HOME="$tmp/home"
|
|
12
|
+
mkdir -p "$HOME"
|
|
13
|
+
|
|
14
|
+
uv run --with build python -m build
|
|
15
|
+
|
|
16
|
+
UV_TOOL_DIR="$tmp/tools-dist" UV_CACHE_DIR="$tmp/cache-dist" \
|
|
17
|
+
uv tool install --force --no-index --find-links dist ghp
|
|
18
|
+
"$HOME/.local/bin/ghp" --version
|
|
19
|
+
|
|
20
|
+
UV_TOOL_DIR="$tmp/tools-editable" UV_CACHE_DIR="$tmp/cache-editable" \
|
|
21
|
+
uv tool install --force -e .
|
|
22
|
+
"$HOME/.local/bin/ghp" --version
|
|
File without changes
|