hermes-pubky 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.
Files changed (52) hide show
  1. hermes_pubky-0.1.0/.github/workflows/ci.yml +125 -0
  2. hermes_pubky-0.1.0/.github/workflows/release.yml +151 -0
  3. hermes_pubky-0.1.0/.gitignore +9 -0
  4. hermes_pubky-0.1.0/Cargo.lock +5634 -0
  5. hermes_pubky-0.1.0/Cargo.toml +52 -0
  6. hermes_pubky-0.1.0/LICENSE +21 -0
  7. hermes_pubky-0.1.0/PKG-INFO +279 -0
  8. hermes_pubky-0.1.0/PUBLISHING.md +94 -0
  9. hermes_pubky-0.1.0/README.md +253 -0
  10. hermes_pubky-0.1.0/docs/ARCHITECTURE.md +79 -0
  11. hermes_pubky-0.1.0/docs/SECURITY.md +67 -0
  12. hermes_pubky-0.1.0/e2e/e2e.rs +445 -0
  13. hermes_pubky-0.1.0/examples/testnet_fixture.rs +80 -0
  14. hermes_pubky-0.1.0/pyproject.toml +51 -0
  15. hermes_pubky-0.1.0/python/hermes_pubky/__init__.py +30 -0
  16. hermes_pubky-0.1.0/python/hermes_pubky/__main__.py +81 -0
  17. hermes_pubky-0.1.0/python/hermes_pubky/cli.py +285 -0
  18. hermes_pubky-0.1.0/python/hermes_pubky/config.py +204 -0
  19. hermes_pubky-0.1.0/python/hermes_pubky/installer.py +73 -0
  20. hermes_pubky-0.1.0/python/hermes_pubky/outbox.py +220 -0
  21. hermes_pubky-0.1.0/python/hermes_pubky/paths.py +124 -0
  22. hermes_pubky-0.1.0/python/hermes_pubky/plugin_template/__init__.py.tmpl +13 -0
  23. hermes_pubky-0.1.0/python/hermes_pubky/plugin_template/cli.py.tmpl +5 -0
  24. hermes_pubky-0.1.0/python/hermes_pubky/plugin_template/plugin.yaml.tmpl +7 -0
  25. hermes_pubky-0.1.0/python/hermes_pubky/prompt.py +124 -0
  26. hermes_pubky-0.1.0/python/hermes_pubky/provider.py +332 -0
  27. hermes_pubky-0.1.0/python/hermes_pubky/remote.py +128 -0
  28. hermes_pubky-0.1.0/python/hermes_pubky/schema.py +222 -0
  29. hermes_pubky-0.1.0/python/hermes_pubky/setup_flow.py +297 -0
  30. hermes_pubky-0.1.0/python/hermes_pubky/status.py +120 -0
  31. hermes_pubky-0.1.0/python/hermes_pubky/store.py +175 -0
  32. hermes_pubky-0.1.0/python/hermes_pubky/sync.py +347 -0
  33. hermes_pubky-0.1.0/scripts/check_hermes_integration.py +174 -0
  34. hermes_pubky-0.1.0/scripts/smoke_test.py +60 -0
  35. hermes_pubky-0.1.0/src/auth.rs +155 -0
  36. hermes_pubky-0.1.0/src/errors.rs +162 -0
  37. hermes_pubky-0.1.0/src/http.rs +60 -0
  38. hermes_pubky-0.1.0/src/lib.rs +76 -0
  39. hermes_pubky-0.1.0/src/runtime.rs +78 -0
  40. hermes_pubky-0.1.0/src/session.rs +252 -0
  41. hermes_pubky-0.1.0/src/urls.rs +281 -0
  42. hermes_pubky-0.1.0/tests/conftest.py +43 -0
  43. hermes_pubky-0.1.0/tests/fakes.py +50 -0
  44. hermes_pubky-0.1.0/tests/test_config.py +192 -0
  45. hermes_pubky-0.1.0/tests/test_installer.py +150 -0
  46. hermes_pubky-0.1.0/tests/test_native.py +135 -0
  47. hermes_pubky-0.1.0/tests/test_outbox.py +174 -0
  48. hermes_pubky-0.1.0/tests/test_prompt.py +133 -0
  49. hermes_pubky-0.1.0/tests/test_provider.py +348 -0
  50. hermes_pubky-0.1.0/tests/test_schema.py +179 -0
  51. hermes_pubky-0.1.0/tests/test_store.py +246 -0
  52. hermes_pubky-0.1.0/tests/test_sync.py +316 -0
@@ -0,0 +1,125 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ workflow_dispatch:
8
+
9
+ concurrency:
10
+ group: ci-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ env:
14
+ CARGO_TERM_COLOR: always
15
+ RUSTFLAGS: -D warnings
16
+
17
+ jobs:
18
+ rust:
19
+ name: Rust (fmt, clippy, unit tests)
20
+ runs-on: ubuntu-latest
21
+ timeout-minutes: 45
22
+ steps:
23
+ - uses: actions/checkout@v5
24
+ - uses: dtolnay/rust-toolchain@stable
25
+ with:
26
+ components: rustfmt, clippy
27
+ - uses: Swatinem/rust-cache@v2
28
+ - uses: actions/setup-python@v6
29
+ with:
30
+ python-version: "3.11"
31
+ - name: Check formatting
32
+ run: cargo fmt --all -- --check
33
+ - name: Clippy
34
+ run: cargo clippy --all-targets -- -D warnings
35
+ - name: Unit tests
36
+ run: cargo test --lib
37
+
38
+ e2e:
39
+ name: Rust e2e (Pubky v0.11 testnet)
40
+ runs-on: ubuntu-latest
41
+ timeout-minutes: 45
42
+ services:
43
+ postgres:
44
+ image: postgres:18-alpine
45
+ env:
46
+ POSTGRES_USER: test_user
47
+ POSTGRES_PASSWORD: test_pass
48
+ POSTGRES_DB: postgres
49
+ ports: ["5432:5432"]
50
+ options: >-
51
+ --health-cmd pg_isready
52
+ --health-interval 10s
53
+ --health-timeout 5s
54
+ --health-retries 5
55
+ env:
56
+ # The homeserver under test needs a real Postgres; this mirrors the
57
+ # connection string pubky-core's own CI uses.
58
+ TEST_PUBKY_CONNECTION_STRING: postgres://test_user:test_pass@localhost:5432/postgres?pubky-test=true
59
+ steps:
60
+ - uses: actions/checkout@v5
61
+ - uses: dtolnay/rust-toolchain@stable
62
+ - uses: Swatinem/rust-cache@v2
63
+ - uses: actions/setup-python@v6
64
+ with:
65
+ python-version: "3.11"
66
+ - name: End-to-end tests
67
+ # Single-threaded: the static testnet binds fixed, well-known ports.
68
+ run: cargo test --test e2e -- --ignored --test-threads=1 --nocapture
69
+
70
+ python:
71
+ name: Python ${{ matrix.python-version }}
72
+ runs-on: ubuntu-latest
73
+ timeout-minutes: 45
74
+ strategy:
75
+ fail-fast: false
76
+ matrix:
77
+ python-version: ["3.11", "3.12", "3.13"]
78
+ steps:
79
+ - uses: actions/checkout@v5
80
+ - uses: dtolnay/rust-toolchain@stable
81
+ - uses: Swatinem/rust-cache@v2
82
+ - uses: astral-sh/setup-uv@v7
83
+ - uses: actions/setup-python@v6
84
+ with:
85
+ python-version: ${{ matrix.python-version }}
86
+ - name: Install build and test tooling
87
+ run: uv pip install --system maturin pytest pyyaml
88
+ - name: Build and install the wheel
89
+ # Installing the built wheel (rather than `maturin develop`, which
90
+ # needs a virtualenv) means the tests exercise the shipped artifact.
91
+ run: |
92
+ maturin build --release --out dist
93
+ uv pip install --system --no-index --find-links dist hermes-pubky
94
+ - name: Smoke-test the installed wheel
95
+ run: python scripts/smoke_test.py
96
+ - name: Run the test suite
97
+ run: pytest -q
98
+
99
+ hermes-integration:
100
+ name: Hermes integration
101
+ runs-on: ubuntu-latest
102
+ timeout-minutes: 45
103
+ steps:
104
+ - uses: actions/checkout@v5
105
+ - uses: dtolnay/rust-toolchain@stable
106
+ - uses: Swatinem/rust-cache@v2
107
+ - uses: astral-sh/setup-uv@v7
108
+ - uses: actions/setup-python@v6
109
+ with:
110
+ python-version: "3.11"
111
+ - name: Build a wheel
112
+ run: |
113
+ uv pip install --system maturin
114
+ maturin build --release --out dist
115
+ - name: Install into a clean Hermes environment
116
+ run: |
117
+ uv venv --python 3.11 /tmp/hermes-env
118
+ uv pip install --python /tmp/hermes-env/bin/python "hermes-agent==${HERMES_VERSION}"
119
+ uv pip install --python /tmp/hermes-env/bin/python dist/*.whl
120
+ env:
121
+ HERMES_VERSION: "0.19.0"
122
+ - name: Verify discovery, injection and CLI registration
123
+ run: /tmp/hermes-env/bin/python scripts/check_hermes_integration.py
124
+ env:
125
+ HERMES_HOME: /tmp/hermes-home
@@ -0,0 +1,151 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ env:
12
+ CARGO_TERM_COLOR: always
13
+
14
+ jobs:
15
+ # macOS gets a single universal2 wheel rather than one per architecture.
16
+ # GitHub retired the last x86_64 macOS image (macos-13), so Intel wheels can
17
+ # only be produced by cross-compiling from an arm64 runner — and a universal2
18
+ # build is the version of that we can actually execute here, since the arm64
19
+ # runner loads its own slice during the smoke test.
20
+ wheels-macos:
21
+ name: Wheel (macos-universal2)
22
+ runs-on: macos-15
23
+ timeout-minutes: 45
24
+ steps:
25
+ - uses: actions/checkout@v5
26
+ - uses: actions/setup-python@v6
27
+ with:
28
+ python-version: "3.11"
29
+ - uses: dtolnay/rust-toolchain@stable
30
+ with:
31
+ targets: aarch64-apple-darwin,x86_64-apple-darwin
32
+ - uses: Swatinem/rust-cache@v2
33
+ - name: Build universal2 wheel
34
+ run: |
35
+ python -m pip install --upgrade pip maturin
36
+ maturin build --release --target universal2-apple-darwin --out dist
37
+ - name: Verify both architectures are present
38
+ run: |
39
+ python -m zipfile -e dist/*.whl /tmp/whl
40
+ lipo -archs /tmp/whl/hermes_pubky/_native.abi3.so | tee /tmp/archs
41
+ grep -q x86_64 /tmp/archs && grep -q arm64 /tmp/archs
42
+ - name: Smoke-test the wheel
43
+ run: |
44
+ python -m pip install --find-links dist --no-index hermes-pubky
45
+ python scripts/smoke_test.py
46
+ - uses: actions/upload-artifact@v4
47
+ with:
48
+ name: wheels-macos-universal2
49
+ path: dist/*.whl
50
+
51
+ wheels-linux:
52
+ name: Wheel (${{ matrix.name }})
53
+ runs-on: ${{ matrix.runner }}
54
+ timeout-minutes: 60
55
+ strategy:
56
+ fail-fast: false
57
+ matrix:
58
+ include:
59
+ - name: manylinux-x86_64
60
+ runner: ubuntu-latest
61
+ target: x86_64-unknown-linux-gnu
62
+ - name: manylinux-aarch64
63
+ runner: ubuntu-24.04-arm
64
+ target: aarch64-unknown-linux-gnu
65
+ steps:
66
+ - uses: actions/checkout@v5
67
+ - uses: actions/setup-python@v6
68
+ with:
69
+ python-version: "3.11"
70
+ - name: Build wheel
71
+ uses: PyO3/maturin-action@v1
72
+ with:
73
+ target: ${{ matrix.target }}
74
+ args: --release --out dist --compatibility manylinux2014
75
+ manylinux: auto
76
+ sccache: "true"
77
+ - name: Smoke-test the wheel
78
+ run: |
79
+ python -m pip install --upgrade pip
80
+ python -m pip install --find-links dist --no-index hermes-pubky
81
+ python scripts/smoke_test.py
82
+ - uses: actions/upload-artifact@v4
83
+ with:
84
+ name: wheels-${{ matrix.name }}
85
+ path: dist/*.whl
86
+
87
+ sdist:
88
+ name: Source distribution
89
+ runs-on: ubuntu-latest
90
+ timeout-minutes: 20
91
+ steps:
92
+ - uses: actions/checkout@v5
93
+ - uses: PyO3/maturin-action@v1
94
+ with:
95
+ command: sdist
96
+ args: --out dist
97
+ - uses: actions/upload-artifact@v4
98
+ with:
99
+ name: wheels-sdist
100
+ path: dist/*.tar.gz
101
+
102
+ publish:
103
+ name: Publish to PyPI
104
+ needs: [wheels-macos, wheels-linux, sdist]
105
+ runs-on: ubuntu-latest
106
+ timeout-minutes: 20
107
+ environment:
108
+ name: pypi
109
+ url: https://pypi.org/p/hermes-pubky
110
+ permissions:
111
+ # Trusted publishing — no API token is stored in this repository.
112
+ id-token: write
113
+ steps:
114
+ - uses: actions/download-artifact@v5
115
+ with:
116
+ pattern: wheels-*
117
+ merge-multiple: true
118
+ path: dist
119
+ - name: List artifacts
120
+ run: ls -la dist/
121
+ - name: Publish
122
+ uses: pypa/gh-action-pypi-publish@release/v1
123
+ with:
124
+ packages-dir: dist/
125
+
126
+ github-release:
127
+ name: GitHub release
128
+ needs: [publish]
129
+ runs-on: ubuntu-latest
130
+ timeout-minutes: 20
131
+ permissions:
132
+ contents: write
133
+ steps:
134
+ - uses: actions/download-artifact@v5
135
+ with:
136
+ pattern: wheels-*
137
+ merge-multiple: true
138
+ path: dist
139
+ - name: Generate checksums
140
+ run: |
141
+ cd dist
142
+ sha256sum * > SHA256SUMS
143
+ cat SHA256SUMS
144
+ - name: Attach artifacts to the release
145
+ uses: softprops/action-gh-release@v2
146
+ with:
147
+ files: |
148
+ dist/*.whl
149
+ dist/*.tar.gz
150
+ dist/SHA256SUMS
151
+ generate_release_notes: true
@@ -0,0 +1,9 @@
1
+ /target
2
+ /dist
3
+ /.venv
4
+ __pycache__/
5
+ *.py[cod]
6
+ *.so
7
+ *.egg-info/
8
+ .pytest_cache/
9
+ .DS_Store