-
Notifications
You must be signed in to change notification settings - Fork 0
chore: phase 1 -- CI, release pipeline, community files #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| name: Bug report | ||
| description: Report a correctness, performance, or crash issue in snapvec. | ||
| labels: ["bug"] | ||
| body: | ||
| - type: markdown | ||
| attributes: | ||
| value: | | ||
| Thanks for taking the time to file a report. A minimal reproducer | ||
| and your environment details shorten the feedback loop a lot. | ||
|
|
||
| - type: textarea | ||
| id: summary | ||
| attributes: | ||
| label: Summary | ||
| description: One or two sentences describing the issue. | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: reproduction | ||
| attributes: | ||
| label: Reproduction | ||
| description: Minimal code that triggers the issue. Include random seeds. | ||
| render: python | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: expected | ||
| attributes: | ||
| label: Expected vs actual behaviour | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: input | ||
| id: snapvec-version | ||
| attributes: | ||
| label: snapvec version | ||
| placeholder: "0.9.0" | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: input | ||
| id: python-version | ||
| attributes: | ||
| label: Python version | ||
| placeholder: "3.12.2" | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: input | ||
| id: numpy-version | ||
| attributes: | ||
| label: NumPy version | ||
| placeholder: "1.26.4" | ||
|
|
||
| - type: input | ||
| id: platform | ||
| attributes: | ||
| label: OS and CPU | ||
| placeholder: "macOS 14.4 arm64 / Ubuntu 22.04 x86_64 / ..." | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: additional | ||
| attributes: | ||
| label: Additional context |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| blank_issues_enabled: false | ||
| contact_links: | ||
| - name: Question or usage help | ||
| url: https://github.com/stffns/snapvec/discussions | ||
| about: For questions about using snapvec, please use GitHub Discussions. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| name: Feature request | ||
| description: Propose a new feature or an API change. | ||
| labels: ["enhancement"] | ||
| body: | ||
| - type: textarea | ||
| id: problem | ||
| attributes: | ||
| label: What problem are you trying to solve? | ||
| description: A clear description of the use case or limitation. | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: proposal | ||
| attributes: | ||
| label: Proposed solution | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: alternatives | ||
| attributes: | ||
| label: Alternatives considered | ||
|
|
||
| - type: textarea | ||
| id: additional | ||
| attributes: | ||
| label: Additional context | ||
| description: Links to papers, related projects, benchmarks, or prior art. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| ## Summary | ||
|
|
||
| <!-- One or two sentences: what changes and why. --> | ||
|
|
||
| ## Type of change | ||
|
|
||
| - [ ] Bug fix | ||
| - [ ] Feature | ||
| - [ ] Performance improvement | ||
| - [ ] Refactor | ||
| - [ ] Docs / tests only | ||
|
|
||
| ## Checklist | ||
|
|
||
| - [ ] Tests added or updated | ||
| - [ ] `ruff check` passes | ||
| - [ ] `pytest -q` passes locally | ||
| - [ ] CHANGELOG updated under `[Unreleased]` | ||
| - [ ] On-disk format version bumped if the format changed | ||
| - [ ] Benchmark before/after numbers included (for performance PRs) | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: github-actions | ||
| directory: / | ||
| schedule: | ||
| interval: monthly | ||
| open-pull-requests-limit: 5 | ||
|
|
||
| - package-ecosystem: pip | ||
| directory: / | ||
| schedule: | ||
| interval: monthly | ||
| open-pull-requests-limit: 5 | ||
| groups: | ||
| dev-dependencies: | ||
| patterns: | ||
| - "pytest*" | ||
| - "mypy*" | ||
| - "ruff" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| lint: | ||
| name: Lint (ruff + mypy) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
| cache: pip | ||
|
|
||
| - name: Install dev dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -e ".[dev]" | ||
|
|
||
| - name: ruff check | ||
| run: ruff check snapvec/ tests/ | ||
|
|
||
| - name: mypy (strict, warning-only for now) | ||
| run: mypy --strict snapvec/ || true | ||
|
|
||
| test: | ||
| name: Test ${{ matrix.os }} / py${{ matrix.python-version }} | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, macos-14, windows-latest] | ||
| python-version: ["3.10", "3.12"] | ||
| include: | ||
| - os: ubuntu-latest | ||
| python-version: "3.13" | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| cache: pip | ||
|
|
||
| - name: Install libomp (macOS) | ||
| if: runner.os == 'macOS' | ||
| run: brew install libomp | ||
|
|
||
| - name: Install package | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -e ".[dev]" | ||
|
|
||
| - name: Run tests | ||
| run: pytest -q --cov=snapvec --cov-report=term-missing | ||
|
|
||
| - name: Upload coverage (ubuntu + py3.12 only) | ||
| if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: coverage-report | ||
| path: .coverage | ||
| if-no-files-found: ignore |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| tags: ["v*"] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| build_wheels: | ||
| name: Wheels on ${{ matrix.os }} | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - os: ubuntu-latest | ||
| cibw_archs: "x86_64" | ||
| - os: ubuntu-24.04-arm | ||
| cibw_archs: "aarch64" | ||
| - os: macos-13 | ||
| cibw_archs: "x86_64" | ||
| - os: macos-14 | ||
| cibw_archs: "arm64" | ||
| - os: windows-latest | ||
| cibw_archs: "AMD64" | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Build wheels | ||
| uses: pypa/cibuildwheel@v2.22 | ||
| env: | ||
| CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*" | ||
| CIBW_SKIP: "*-musllinux_* pp*" | ||
| CIBW_ARCHS: ${{ matrix.cibw_archs }} | ||
| CIBW_BEFORE_ALL_MACOS: "brew install libomp" | ||
| CIBW_ENVIRONMENT_MACOS: "MACOSX_DEPLOYMENT_TARGET=13.0" | ||
| CIBW_TEST_REQUIRES: "pytest" | ||
| CIBW_TEST_COMMAND: "pytest {project}/tests -q" | ||
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: wheels-${{ matrix.os }}-${{ matrix.cibw_archs }} | ||
| path: ./wheelhouse/*.whl | ||
|
|
||
| build_sdist: | ||
| name: Source distribution | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Build sdist | ||
| run: | | ||
| python -m pip install --upgrade pip build | ||
| python -m build --sdist | ||
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: sdist | ||
| path: dist/*.tar.gz | ||
|
|
||
| publish: | ||
| name: Publish to PyPI | ||
| needs: [build_wheels, build_sdist] | ||
| runs-on: ubuntu-latest | ||
| if: startsWith(github.ref, 'refs/tags/v') | ||
| environment: | ||
| name: pypi | ||
| url: https://pypi.org/project/snapvec/ | ||
| permissions: | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| path: dist | ||
| merge-multiple: true | ||
|
|
||
| - name: Publish via trusted publishing | ||
| uses: pypa/gh-action-pypi-publish@release/v1 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v5.0.0 | ||
| hooks: | ||
| - id: trailing-whitespace | ||
| - id: end-of-file-fixer | ||
| - id: check-yaml | ||
| - id: check-toml | ||
| - id: check-added-large-files | ||
| args: ["--maxkb=500"] | ||
| - id: check-merge-conflict | ||
| - id: mixed-line-ending | ||
| args: ["--fix=lf"] | ||
|
|
||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.8.4 | ||
| hooks: | ||
| - id: ruff | ||
| args: ["--fix"] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # snapvec -- Claude-specific instructions | ||
|
|
||
| ## Commits | ||
| - NEVER add `Co-Authored-By` lines to commit messages. | ||
| - Use conventional prefixes: `feat`, `fix`, `chore`, `docs`, `bench`, `refactor`, `test`. | ||
| - Keep subject under 72 chars. Present-tense imperative. | ||
|
|
||
| ## Code style | ||
| - Prefer ASCII in new or edited text (source, docstrings, docs, commits). | ||
| No em dashes, no smart quotes, no ellipsis character. Use `-`, `--`, | ||
| `"`, `'`, `...`. Existing math notation in docstrings (`sqrt`, arrows, | ||
| inner-product brackets) may remain unless you are already rewriting | ||
| that block. | ||
| - English everywhere in code, docstrings, commits, and README. | ||
|
|
||
| ## Project layout | ||
| - `snapvec/` = library (public API in `__init__.py`). | ||
| - `tests/` = pytest suite (151 tests as of v0.9.0). | ||
| - `experiments/` = rough benchmarks and profiling scripts -- do not treat as first-class code. | ||
| - `bench/` (future) = reproducible benchmark suite that runs in CI. | ||
|
|
||
| ## Running checks locally | ||
| ```bash | ||
| ruff check snapvec/ tests/ | ||
| pytest -q | ||
| mypy --strict snapvec/ # 17 errors as of 2026-04-20, warning-only in CI | ||
| ``` | ||
|
|
||
| ## File format invariants | ||
| - Any change to the on-disk format (`.snpv`, `.snpq`, `.snpr`, `.snpi`) must bump | ||
| the format version in `snapvec/_file_format.py` and add a round-trip test. | ||
| - Do not remove or reorder existing serialized fields without a migration path. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # Contributor Covenant Code of Conduct | ||
|
|
||
| ## Our Pledge | ||
|
|
||
| We as members, contributors, and leaders pledge to make participation in our | ||
| community a harassment-free experience for everyone. | ||
|
|
||
| ## Our Standards | ||
|
|
||
| Examples of behavior that contributes to a positive environment: | ||
| - Using welcoming and inclusive language. | ||
| - Being respectful of differing viewpoints and experiences. | ||
| - Gracefully accepting constructive criticism. | ||
| - Focusing on what is best for the community. | ||
|
|
||
| Examples of unacceptable behavior: | ||
| - The use of sexualized language or imagery and unwelcome sexual attention. | ||
| - Trolling, insulting or derogatory comments, and personal or political attacks. | ||
| - Public or private harassment. | ||
| - Publishing others' private information without explicit permission. | ||
|
|
||
| ## Enforcement | ||
|
|
||
| Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
| reported by contacting the project maintainer at **stffens@gmail.com**. All | ||
| complaints will be reviewed and investigated promptly and fairly. | ||
|
|
||
| ## Attribution | ||
|
|
||
| This Code of Conduct is adapted from the | ||
| [Contributor Covenant](https://www.contributor-covenant.org), version 2.1. |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR checklist requires
ruff formatto pass, but the PR description states formatting checks are intentionally omitted becauseruff formatrewrites the hand-aligned constants insnapvec/_codebooks.py. Please align the PR template with the intended workflow (e.g., drop theruff formatitem or exclude the sensitive file so formatting can be required).