Skip to content

Commit 49df8d1

Browse files
committed
chore: add CI pipeline, badges, CONTRIBUTING and CODE_OF_CONDUCT
1 parent 66e1e0d commit 49df8d1

4 files changed

Lines changed: 100 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
jobs:
10+
ci:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.10", "3.11", "3.12", "3.13"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: actions/setup-python@v5
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
cache: pip
23+
24+
- run: pip install -e ".[dev]"
25+
- run: ruff check .
26+
- run: pytest -q

CODE_OF_CONDUCT.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity, level of experience, nationality, personal appearance, race, religion, or sexual identity.
6+
7+
## Our Standards
8+
9+
**Expected behaviour:**
10+
- Be respectful and constructive in all interactions
11+
- Accept feedback gracefully
12+
- Focus on what's best for the project and community
13+
14+
**Unacceptable behaviour:**
15+
- Harassment, insults, or personal attacks
16+
- Trolling or deliberately disruptive behaviour
17+
- Publishing others' private information without consent
18+
19+
## Enforcement
20+
21+
Instances of unacceptable behaviour may be reported by opening a [GitHub issue](https://github.com/PracticalMind/graver/issues) or contacting the maintainers directly. All reports will be reviewed and investigated promptly.
22+
23+
Maintainers have the right to remove, edit, or reject contributions that do not align with this Code of Conduct.
24+
25+
## Attribution
26+
27+
Adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1.

CONTRIBUTING.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Contributing to graver
2+
3+
## Setup
4+
5+
```bash
6+
git clone https://github.com/PracticalMind/graver
7+
cd graver
8+
python -m venv .venv
9+
source .venv/bin/activate # Windows: .venv\Scripts\activate
10+
pip install -e ".[dev]"
11+
```
12+
13+
## Before submitting
14+
15+
```bash
16+
ruff check . # linting
17+
pytest -q # tests
18+
```
19+
20+
Both must pass cleanly.
21+
22+
## Code standards
23+
24+
- Type hints on all functions
25+
- No commented-out code
26+
- Docstrings only when the why is non-obvious — method names should be self-explanatory
27+
28+
## Pull requests
29+
30+
- Branch from `main`, name it `type/short-description` (e.g. `feat/export-json`, `fix/version-collision`)
31+
- One logical change per PR
32+
- For significant changes, open an issue first to align on approach
33+
34+
## Reporting issues
35+
36+
Use [GitHub Issues](https://github.com/PracticalMind/graver/issues). Include a minimal reproducible example where possible.

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
# Graver
22

3+
[![CI](https://github.com/PracticalMind/graver/actions/workflows/ci.yml/badge.svg)](https://github.com/PracticalMind/graver/actions/workflows/ci.yml)
4+
[![PyPI](https://img.shields.io/pypi/v/graver)](https://pypi.org/project/graver/)
5+
[![Python](https://img.shields.io/pypi/pyversions/graver)](https://pypi.org/project/graver/)
6+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7+
38
Git-like version control for your LLM prompts.
49

5-
Save prompt versions, view history, compare diffs, and roll back all from Python, with zero external dependencies.
10+
Save prompt versions, view history, compare diffs, and roll back, all from Python, with zero external dependencies.
611

712
## Why graver?
813

914
LLM prompts change constantly. Tracking what changed, when, and which version performed better quickly becomes a mess.
1015

1116
graver solves this:
12-
- Every change is automatically versioned v1, v2, v3...
17+
- Every change is automatically versioned - v1, v2, v3...
1318
- Roll back to any version instantly
1419
- Pin a specific version as your main (canonical) prompt
1520
- See exactly what changed between two versions
@@ -45,7 +50,7 @@ print(p.changes("v1", "v2"))
4550

4651
## CLI
4752

48-
The `gr` command lets you use graver directly from the terminal no Python script needed. Useful for quickly saving files, inspecting version history, or integrating into shell scripts and CI/CD pipelines.
53+
The `gr` command lets you use graver directly from the terminal, no Python script needed. Useful for quickly saving files, inspecting version history, or integrating into shell scripts and CI/CD pipelines.
4954

5055
```bash
5156
gr list # list all saved prompts
@@ -117,7 +122,7 @@ Returns the full version history of this prompt, ordered from oldest to newest.
117122

118123
### `set_main(version) -> None`
119124

120-
Marks a specific version as the main (canonical) version. The main version does not change automatically when new versions are saved only when `set_main()` is called again.
125+
Marks a specific version as the main (canonical) version. The main version does not change automatically when new versions are saved, only when `set_main()` is called again.
121126

122127
| Parameter | Type | Description |
123128
|-----------|------|-------------|
@@ -165,7 +170,7 @@ Returns the raw line-by-line difference between two versions as a dict. Use this
165170
| `v1` | `str` | Base version (e.g. `"v1"`). |
166171
| `v2` | `str` | Target version (e.g. `"v2"`). |
167172

168-
**Returns:** Dict with keys `added`, `removed`, `unchanged` each a list of strings.
173+
**Returns:** Dict with keys `added`, `removed`, `unchanged`, each a list of strings.
169174

170175
---
171176

@@ -238,7 +243,7 @@ Every `Prompt` writes to a `.graver/` folder in your working directory.
238243
}
239244
```
240245

241-
Version numbering is automatic: each `save()` call increments the counter. Versions are never overwritten only explicitly deleted via `delete_version()`.
246+
Version numbering is automatic: each `save()` call increments the counter. Versions are never overwritten, only explicitly deleted via `delete_version()`.
242247

243248
## License
244249

0 commit comments

Comments
 (0)