sismatic 0.1.2__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.
- sismatic-0.1.2/.cargo/config.toml +9 -0
- sismatic-0.1.2/.envrc +24 -0
- sismatic-0.1.2/.github/actions/nix/action.yml +23 -0
- sismatic-0.1.2/.github/workflows/pipeline.yml +186 -0
- sismatic-0.1.2/.gitignore +5 -0
- sismatic-0.1.2/Cargo.lock +2448 -0
- sismatic-0.1.2/Cargo.toml +38 -0
- sismatic-0.1.2/LICENSE +8 -0
- sismatic-0.1.2/PKG-INFO +110 -0
- sismatic-0.1.2/README.md +97 -0
- sismatic-0.1.2/deny.toml +238 -0
- sismatic-0.1.2/flake.lock +81 -0
- sismatic-0.1.2/flake.nix +474 -0
- sismatic-0.1.2/pyproject.toml +28 -0
- sismatic-0.1.2/rust-toolchain.toml +6 -0
- sismatic-0.1.2/src/devices/config.rs +377 -0
- sismatic-0.1.2/src/devices/connector/fake.rs +52 -0
- sismatic-0.1.2/src/devices/connector.rs +47 -0
- sismatic-0.1.2/src/devices/controller.rs +200 -0
- sismatic-0.1.2/src/devices/device.rs +259 -0
- sismatic-0.1.2/src/devices/registry.rs +162 -0
- sismatic-0.1.2/src/devices/transport/fake.rs +181 -0
- sismatic-0.1.2/src/devices/transport/ssh.rs +105 -0
- sismatic-0.1.2/src/devices/transport.rs +49 -0
- sismatic-0.1.2/src/devices.rs +6 -0
- sismatic-0.1.2/src/lib.rs +5 -0
- sismatic-0.1.2/src/protocol/control_chars.rs +29 -0
- sismatic-0.1.2/src/protocol/instructions/commands.rs +79 -0
- sismatic-0.1.2/src/protocol/instructions/query.rs +285 -0
- sismatic-0.1.2/src/protocol/instructions/register.rs +155 -0
- sismatic-0.1.2/src/protocol/instructions.rs +80 -0
- sismatic-0.1.2/src/protocol/payload_helpers.rs +21 -0
- sismatic-0.1.2/src/protocol/states.rs +36 -0
- sismatic-0.1.2/src/protocol.rs +280 -0
- sismatic-0.1.2/src/python_binding.rs +120 -0
- sismatic-0.1.2/tests/real_ssh.rs +65 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Building the pyo3 `extension-module` cdylib resolves CPython symbols at load
|
|
2
|
+
# time, so the linker must be told to leave them undefined. maturin sets this
|
|
3
|
+
# automatically; this config lets a plain `cargo build --features python` link
|
|
4
|
+
# too. It is harmless for the default (no-python) builds and the test binaries.
|
|
5
|
+
[target.aarch64-apple-darwin]
|
|
6
|
+
rustflags = ["-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup"]
|
|
7
|
+
|
|
8
|
+
[target.x86_64-apple-darwin]
|
|
9
|
+
rustflags = ["-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup"]
|
sismatic-0.1.2/.envrc
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#------------------------------------------------------------------------------#
|
|
2
|
+
# Flake Prerequisites #
|
|
3
|
+
# (idempotent) #
|
|
4
|
+
#------------------------------------------------------------------------------#
|
|
5
|
+
# Day-0 Steps (Ensure the following)
|
|
6
|
+
[ -f Cargo.toml ] || cargo init .; git ls-files --error-unmatch Cargo.toml >/dev/null 2>&1 || git add Cargo.toml
|
|
7
|
+
[ -f Cargo.lock ] || cargo generate-lockfile; git ls-files --error-unmatch Cargo.lock </dev/null 2>&1 || git add Cargo.lock
|
|
8
|
+
|
|
9
|
+
git ls-files --error-unmatch .envrc || git add .envrc
|
|
10
|
+
git ls-files --error-unmatch flake.nix || git add flake.nix
|
|
11
|
+
git ls-files --error-unmatch rust-toolchain.toml || git add rust-toolchain.toml
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# .gitignore contains result and result-* as Nix will output build artifacts there.
|
|
15
|
+
|
|
16
|
+
# (optional) for direnv flake activation (does not create subprocess) devShell
|
|
17
|
+
use flake
|
|
18
|
+
|
|
19
|
+
#------------------------------------------------------------------------------#
|
|
20
|
+
# Post-flake activation setup #
|
|
21
|
+
#------------------------------------------------------------------------------#
|
|
22
|
+
|
|
23
|
+
git ls-files --error-unmatch flake.lock || git add flake.lock
|
|
24
|
+
git ls-files --error-unmatch deny.toml || {cargo deny init && git add deny.toml}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: Nix setup
|
|
2
|
+
description: >
|
|
3
|
+
Install Nix with flakes enabled and restore the shared Nix store cache.
|
|
4
|
+
The cache key is scoped by OS *and* arch so the two macOS runners
|
|
5
|
+
(Intel macos-13 / Apple-silicon macos-14) don't clobber each other.
|
|
6
|
+
|
|
7
|
+
runs:
|
|
8
|
+
using: composite
|
|
9
|
+
steps:
|
|
10
|
+
- uses: cachix/install-nix-action@v31
|
|
11
|
+
with:
|
|
12
|
+
extra_nix_config: |
|
|
13
|
+
experimental-features = nix-command flakes
|
|
14
|
+
|
|
15
|
+
- uses: nix-community/cache-nix-action@v6
|
|
16
|
+
with:
|
|
17
|
+
primary-key: nix-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/*.nix', '**/flake.lock', '**/Cargo.lock') }}
|
|
18
|
+
restore-prefixes-first-match: nix-${{ runner.os }}-${{ runner.arch }}-
|
|
19
|
+
gc-max-store-size-linux: 1G
|
|
20
|
+
purge: true
|
|
21
|
+
purge-prefixes: nix-${{ runner.os }}-${{ runner.arch }}-
|
|
22
|
+
purge-created: 0
|
|
23
|
+
purge-primary-key: never
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
name: Build & Release
|
|
2
|
+
|
|
3
|
+
# Every step below is defined in flake.nix and runs identically on a laptop:
|
|
4
|
+
# nix flake check # fmt, clippy, tests, audit, deny, coverage
|
|
5
|
+
# nix build .# # the crate
|
|
6
|
+
# nix build .#wheel # hermetic (nixpkgs-linked) wheel
|
|
7
|
+
# nix run .#build-wheel # portable wheel (manylinux_2_28 via zig on Linux)
|
|
8
|
+
# nix run .#build-sdist # source distribution
|
|
9
|
+
# This workflow is only a dispatcher: it installs Nix (./.github/actions/nix)
|
|
10
|
+
# and invokes those outputs. No build logic lives here.
|
|
11
|
+
|
|
12
|
+
on:
|
|
13
|
+
pull_request:
|
|
14
|
+
push:
|
|
15
|
+
branches: [main]
|
|
16
|
+
tags: ["v*"]
|
|
17
|
+
workflow_dispatch:
|
|
18
|
+
|
|
19
|
+
permissions:
|
|
20
|
+
contents: read
|
|
21
|
+
|
|
22
|
+
# Supersede in-flight PR runs on a new push; never cancel main/tag builds
|
|
23
|
+
# (those may be producing a release).
|
|
24
|
+
concurrency:
|
|
25
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
26
|
+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
27
|
+
|
|
28
|
+
jobs:
|
|
29
|
+
# nix flake check + the crate build — the whole validation suite, all from
|
|
30
|
+
# the flake. Uses default features, so aws-lc-sys is not compiled here.
|
|
31
|
+
checks:
|
|
32
|
+
name: Checks + crate
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
timeout-minutes: 45
|
|
35
|
+
steps:
|
|
36
|
+
- uses: actions/checkout@v4
|
|
37
|
+
- uses: ./.github/actions/nix
|
|
38
|
+
|
|
39
|
+
- name: nix flake check
|
|
40
|
+
run: nix flake check --print-build-logs
|
|
41
|
+
|
|
42
|
+
- name: Build crate
|
|
43
|
+
run: nix build .# --out-link result-crate --print-build-logs
|
|
44
|
+
|
|
45
|
+
- name: Stage crate
|
|
46
|
+
run: |
|
|
47
|
+
mkdir -p out/crate
|
|
48
|
+
cp -Lr result-crate/. out/crate/
|
|
49
|
+
- uses: actions/upload-artifact@v4
|
|
50
|
+
with:
|
|
51
|
+
name: crate
|
|
52
|
+
path: out/crate/**
|
|
53
|
+
if-no-files-found: error
|
|
54
|
+
|
|
55
|
+
# Portable wheels: one native runner per platform, each running the same
|
|
56
|
+
# `nix run .#build-wheel`. The cargo cache below keeps repeat runs from
|
|
57
|
+
# recompiling aws-lc-sys (pulled in by russh) from scratch.
|
|
58
|
+
wheels:
|
|
59
|
+
name: Wheel ${{ matrix.runner }}
|
|
60
|
+
runs-on: ${{ matrix.runner }}
|
|
61
|
+
timeout-minutes: 30
|
|
62
|
+
strategy:
|
|
63
|
+
fail-fast: false
|
|
64
|
+
matrix:
|
|
65
|
+
# ubuntu = x86_64 linux, macos-15-intel = x86_64 macOS,
|
|
66
|
+
# macos-14 = aarch64 macOS.
|
|
67
|
+
runner: [ubuntu-latest, macos-15-intel, macos-14]
|
|
68
|
+
steps:
|
|
69
|
+
- uses: actions/checkout@v4
|
|
70
|
+
- uses: ./.github/actions/nix
|
|
71
|
+
|
|
72
|
+
# Nix caches the toolchain/maturin/zig/cmake; this caches the *cargo*
|
|
73
|
+
# build (crates + target/), so aws-lc-sys is only compiled once per
|
|
74
|
+
# platform+lockfile. Keyed by runner (not runner.os) to keep the two
|
|
75
|
+
# macOS archs separate.
|
|
76
|
+
- name: Cache cargo build
|
|
77
|
+
uses: actions/cache@v4
|
|
78
|
+
with:
|
|
79
|
+
path: |
|
|
80
|
+
~/.cargo/registry/index
|
|
81
|
+
~/.cargo/registry/cache
|
|
82
|
+
~/.cargo/git/db
|
|
83
|
+
target
|
|
84
|
+
key: wheel-cargo-${{ matrix.runner }}-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
|
|
85
|
+
restore-keys: |
|
|
86
|
+
wheel-cargo-${{ matrix.runner }}-
|
|
87
|
+
|
|
88
|
+
- name: Build portable wheel
|
|
89
|
+
run: nix run .#build-wheel
|
|
90
|
+
|
|
91
|
+
- uses: actions/upload-artifact@v4
|
|
92
|
+
with:
|
|
93
|
+
name: wheel-${{ matrix.runner }}
|
|
94
|
+
path: dist/*.whl
|
|
95
|
+
if-no-files-found: error
|
|
96
|
+
|
|
97
|
+
sdist:
|
|
98
|
+
name: Source distribution
|
|
99
|
+
runs-on: ubuntu-latest
|
|
100
|
+
timeout-minutes: 15
|
|
101
|
+
steps:
|
|
102
|
+
- uses: actions/checkout@v4
|
|
103
|
+
- uses: ./.github/actions/nix
|
|
104
|
+
|
|
105
|
+
- name: Build sdist
|
|
106
|
+
run: nix run .#build-sdist
|
|
107
|
+
|
|
108
|
+
- uses: actions/upload-artifact@v4
|
|
109
|
+
with:
|
|
110
|
+
name: sdist
|
|
111
|
+
path: dist/*.tar.gz
|
|
112
|
+
if-no-files-found: error
|
|
113
|
+
|
|
114
|
+
# On a v* tag, gather every artifact and attach it to a GitHub Release.
|
|
115
|
+
release:
|
|
116
|
+
name: GitHub Release
|
|
117
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
118
|
+
needs: [checks, wheels, sdist]
|
|
119
|
+
runs-on: ubuntu-latest
|
|
120
|
+
timeout-minutes: 10
|
|
121
|
+
permissions:
|
|
122
|
+
contents: write
|
|
123
|
+
steps:
|
|
124
|
+
- uses: actions/download-artifact@v4
|
|
125
|
+
with:
|
|
126
|
+
path: artifacts
|
|
127
|
+
|
|
128
|
+
- name: Collect release files
|
|
129
|
+
run: |
|
|
130
|
+
mkdir -p release
|
|
131
|
+
find artifacts -type f \( -name '*.whl' -o -name '*.tar.gz' \) \
|
|
132
|
+
-exec cp -n {} release/ \;
|
|
133
|
+
if [ -d artifacts/crate ]; then
|
|
134
|
+
tar -czf "release/sismatic-crate-${GITHUB_REF_NAME}.tar.gz" \
|
|
135
|
+
-C artifacts/crate .
|
|
136
|
+
fi
|
|
137
|
+
ls -l release
|
|
138
|
+
|
|
139
|
+
- uses: softprops/action-gh-release@v2
|
|
140
|
+
with:
|
|
141
|
+
files: release/*
|
|
142
|
+
generate_release_notes: true
|
|
143
|
+
|
|
144
|
+
# On a v* tag, ship the built wheels + sdist to PyPI. Inlined here rather than
|
|
145
|
+
# split into a reusable workflow: PyPI's PEP 740 attestation records this file
|
|
146
|
+
# (the top-level workflow_ref) as its Build Config URI, so publishing from a
|
|
147
|
+
# reusable workflow makes that identity disagree with the OIDC
|
|
148
|
+
# job_workflow_ref and PyPI rejects the upload. Keeping it inline means both
|
|
149
|
+
# the OIDC auth and the attestation resolve to pipeline.yml — configure
|
|
150
|
+
# sismatic's PyPI Trusted Publisher to this file (pipeline.yml) and the `pypi`
|
|
151
|
+
# environment below.
|
|
152
|
+
publish-pypi:
|
|
153
|
+
name: Publish to PyPI
|
|
154
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
155
|
+
needs: [checks, wheels, sdist]
|
|
156
|
+
runs-on: ubuntu-latest
|
|
157
|
+
timeout-minutes: 15
|
|
158
|
+
environment:
|
|
159
|
+
name: pypi
|
|
160
|
+
url: https://pypi.org/project/sismatic/
|
|
161
|
+
permissions:
|
|
162
|
+
# Required for Trusted Publishing (OIDC) and PEP 740 attestations.
|
|
163
|
+
id-token: write
|
|
164
|
+
steps:
|
|
165
|
+
# Wheels + sdist were uploaded earlier in this same run, so no run-id is
|
|
166
|
+
# needed — download-artifact pulls them straight from the current run.
|
|
167
|
+
- name: Download pipeline artifacts
|
|
168
|
+
uses: actions/download-artifact@v4
|
|
169
|
+
with:
|
|
170
|
+
path: artifacts
|
|
171
|
+
|
|
172
|
+
# Gather only the Python distributions. The pipeline also uploads a crate
|
|
173
|
+
# tarball (sismatic-crate-*.tar.gz), which is not a PyPI artifact.
|
|
174
|
+
- name: Collect wheels + sdist
|
|
175
|
+
run: |
|
|
176
|
+
mkdir -p dist
|
|
177
|
+
find artifacts \( -name '*.whl' -o -name '*.tar.gz' \) \
|
|
178
|
+
-not -name '*crate*' -exec cp -n {} dist/ \;
|
|
179
|
+
echo "Files to publish:"
|
|
180
|
+
ls -l dist
|
|
181
|
+
|
|
182
|
+
- name: Publish to PyPI
|
|
183
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
184
|
+
with:
|
|
185
|
+
packages-dir: dist
|
|
186
|
+
print-hash: true
|