seqa-py 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.
@@ -0,0 +1,18 @@
1
+ # Copy to .env and fill in values
2
+
3
+ # AWS S3
4
+ AWS_ACCESS_KEY_ID=
5
+ AWS_SECRET_ACCESS_KEY=
6
+ AWS_REGION=
7
+ S3_BUCKET=
8
+
9
+ # Azure Blob
10
+ AZURE_TENANT_ID=
11
+ AZURE_CLIENT_ID=
12
+ AZURE_CLIENT_SECRET=
13
+ AZURE_STORAGE_ACCOUNT=
14
+ AZURE_STORAGE_CONTAINER=
15
+
16
+ # GCS
17
+ GOOGLE_STORAGE_ACCOUNT=
18
+ GOOGLE_BUCKET=
@@ -0,0 +1,83 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ build-linux:
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ matrix:
16
+ target: [x86_64, aarch64]
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - uses: PyO3/maturin-action@v1
20
+ with:
21
+ target: ${{ matrix.target }}
22
+ args: --release --out dist
23
+ manylinux: auto
24
+ - uses: actions/upload-artifact@v4
25
+ with:
26
+ name: wheels-linux-${{ matrix.target }}
27
+ path: dist
28
+
29
+ build-macos:
30
+ runs-on: macos-latest
31
+ steps:
32
+ - uses: actions/checkout@v4
33
+ - uses: PyO3/maturin-action@v1
34
+ with:
35
+ target: universal2-apple-darwin
36
+ args: --release --out dist
37
+ - uses: actions/upload-artifact@v4
38
+ with:
39
+ name: wheels-macos
40
+ path: dist
41
+
42
+ build-windows:
43
+ runs-on: windows-latest
44
+ steps:
45
+ - uses: actions/checkout@v4
46
+ - uses: PyO3/maturin-action@v1
47
+ with:
48
+ target: x86_64
49
+ args: --release --out dist
50
+ - uses: actions/upload-artifact@v4
51
+ with:
52
+ name: wheels-windows
53
+ path: dist
54
+
55
+ sdist:
56
+ runs-on: ubuntu-latest
57
+ steps:
58
+ - uses: actions/checkout@v4
59
+ - uses: PyO3/maturin-action@v1
60
+ with:
61
+ command: sdist
62
+ args: --out dist
63
+ - uses: actions/upload-artifact@v4
64
+ with:
65
+ name: wheels-sdist
66
+ path: dist
67
+
68
+ publish:
69
+ needs: [build-linux, build-macos, build-windows, sdist]
70
+ runs-on: ubuntu-latest
71
+ environment: pypi
72
+ steps:
73
+ - uses: actions/download-artifact@v4
74
+ with:
75
+ pattern: wheels-*
76
+ merge-multiple: true
77
+ path: dist
78
+ - uses: PyO3/maturin-action@v1
79
+ with:
80
+ command: upload
81
+ args: --non-interactive --skip-existing dist/*
82
+ env:
83
+ MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
@@ -0,0 +1,12 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.pyc
4
+ *.pyo
5
+ .env
6
+ .pytest_cache/
7
+ .ruff_cache/
8
+ dist/
9
+ *.egg-info/
10
+ target
11
+ *.so
12
+ .idea/
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,64 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Project Overview
6
+
7
+ seqa_py is a Python port of [seqa-rs](../seqa-rs) — a library for querying genomic files (BAM, VCF, GFF, BED, BigWig, BigBed, FASTA) across cloud and local storage backends.
8
+
9
+ ## Build & Test Commands
10
+
11
+ ```bash
12
+ uv sync # Install Python dependencies
13
+ uv run maturin develop # Compile Rust extension (required after any src/lib.rs change)
14
+ uv run pytest # Run all tests
15
+ uv run pytest tests/test_local.py -v # Run local tests (no cloud creds needed)
16
+ uv run pytest tests/test_local.py::TestVcfLocal::test_first_line # Single test
17
+ uv run ruff check . # Lint
18
+ uv run ruff format . # Format
19
+ ```
20
+
21
+ The Rust extension must be rebuilt (`maturin develop`) any time `src/lib.rs` changes.
22
+
23
+ ## Architecture
24
+
25
+ ### Coordinate System
26
+
27
+ All genomic formats preserve their native coordinates. Internal canonical format is **0-based half-open** `[begin, end)`. Terminology: always `begin`/`end`, never `start`/`stop`.
28
+
29
+ | Format | System |
30
+ |--------|--------|
31
+ | BED, BAM, BigWig | 0-based half-open |
32
+ | VCF, GFF, GTF | 1-based closed |
33
+
34
+ ### Extension Layout
35
+
36
+ - `src/lib.rs` — PyO3 bindings; compiled to `_seqa_py.so` via maturin.
37
+ - `seqa_py/__init__.py` — Python wrapper; imports `query_file` from `._seqa_py` (relative). The `module-name = "seqa_py._seqa_py"` setting in `pyproject.toml` ensures maturin installs the extension inside the `seqa_py` package and creates a `seqa_py.pth` editable pointer.
38
+ - `seqa_core` is referenced via local path `../seqa-rs/seqa_core` in `Cargo.toml`.
39
+
40
+ ### Storage Layer
41
+
42
+ File access is cloud-agnostic. `StoreService.from_uri()` auto-detects backend from URL scheme (`s3://`, `az://`, `gs://`, `file://`, `http(s)://`).
43
+
44
+ ### Search Pipeline
45
+
46
+ Per-format search functions (`bam_search`, `tabix_search`, `fasta_search`, `bigwig_search`, `bigbed_search`) each take a `SearchOptions` object and return a `SearchResult`.
47
+
48
+ ## Environment Variables
49
+
50
+ Cloud storage and database access require environment variables:
51
+ - **S3**: `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION`, `S3_BUCKET`
52
+ - **Azure**: `AZURE_TENANT_ID`, `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET`, `AZURE_STORAGE_CONTAINER`, `AZURE_STORAGE_ACCOUNT`
53
+ - **GCS**: `GOOGLE_STORAGE_ACCOUNT`, `GOOGLE_BUCKET`
54
+
55
+ ## Test Deletion Policy
56
+
57
+ **Never delete a failing test** to make CI green. Before removing any test, you must:
58
+
59
+ 1. Identify every assertion and code path exercised by the test.
60
+ 2. Find an existing *passing* test that covers each of those cases — not just "similar" functionality, but the same inputs, the same code path, and equivalent assertions.
61
+ 3. If full coverage cannot be confirmed, mark the test with `@pytest.mark.skip` and a comment explaining why (e.g., machine-specific path, missing credentials) rather than deleting it.
62
+ 4. Prefer moving credential-dependent tests to integration test files over removing them.
63
+
64
+ Silently dropping tests to unblock CI is not acceptable.