foldit-plugin-sdk 0.1.1__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 (37) hide show
  1. foldit_plugin_sdk-0.1.1/.github/workflows/ci.yml +81 -0
  2. foldit_plugin_sdk-0.1.1/.github/workflows/release.yml +120 -0
  3. foldit_plugin_sdk-0.1.1/.gitignore +1 -0
  4. foldit_plugin_sdk-0.1.1/Cargo.lock +945 -0
  5. foldit_plugin_sdk-0.1.1/Cargo.toml +92 -0
  6. foldit_plugin_sdk-0.1.1/PKG-INFO +24 -0
  7. foldit_plugin_sdk-0.1.1/README.md +9 -0
  8. foldit_plugin_sdk-0.1.1/build.rs +52 -0
  9. foldit_plugin_sdk-0.1.1/cbindgen-abi.toml +52 -0
  10. foldit_plugin_sdk-0.1.1/cbindgen.toml +7 -0
  11. foldit_plugin_sdk-0.1.1/deny.toml +32 -0
  12. foldit_plugin_sdk-0.1.1/include/foldit_plugin_abi.h +450 -0
  13. foldit_plugin_sdk-0.1.1/justfile +17 -0
  14. foldit_plugin_sdk-0.1.1/proto/plugin.proto +712 -0
  15. foldit_plugin_sdk-0.1.1/pyproject.toml +30 -0
  16. foldit_plugin_sdk-0.1.1/python/foldit_plugin_sdk/__init__.py +49 -0
  17. foldit_plugin_sdk-0.1.1/python/foldit_plugin_sdk/backend_utils.py +69 -0
  18. foldit_plugin_sdk-0.1.1/python/foldit_plugin_sdk/cache_utils.py +154 -0
  19. foldit_plugin_sdk-0.1.1/python/foldit_plugin_sdk/checkpoint_utils.py +151 -0
  20. foldit_plugin_sdk-0.1.1/python/foldit_plugin_sdk/confidence_utils.py +115 -0
  21. foldit_plugin_sdk-0.1.1/python/foldit_plugin_sdk/device_utils.py +71 -0
  22. foldit_plugin_sdk-0.1.1/python/foldit_plugin_sdk/logging_config.py +100 -0
  23. foldit_plugin_sdk-0.1.1/python/foldit_plugin_sdk/multiprocessing_utils.py +117 -0
  24. foldit_plugin_sdk-0.1.1/python/foldit_plugin_sdk/path_utils.py +152 -0
  25. foldit_plugin_sdk-0.1.1/python/foldit_plugin_sdk/plugin_interface.py +330 -0
  26. foldit_plugin_sdk-0.1.1/python/foldit_plugin_sdk/proto/__init__.py +2 -0
  27. foldit_plugin_sdk-0.1.1/python/foldit_plugin_sdk/proto/plugin_pb2.py +189 -0
  28. foldit_plugin_sdk-0.1.1/python/foldit_plugin_sdk/quantization_utils.py +146 -0
  29. foldit_plugin_sdk-0.1.1/python/foldit_plugin_sdk/validation_utils.py +109 -0
  30. foldit_plugin_sdk-0.1.1/python/foldit_plugin_sdk/weights.py +254 -0
  31. foldit_plugin_sdk-0.1.1/src/abi.rs +406 -0
  32. foldit_plugin_sdk-0.1.1/src/decode.rs +136 -0
  33. foldit_plugin_sdk-0.1.1/src/error.rs +26 -0
  34. foldit_plugin_sdk-0.1.1/src/lib.rs +47 -0
  35. foldit_plugin_sdk-0.1.1/src/plugin.rs +194 -0
  36. foldit_plugin_sdk-0.1.1/src/protocol.rs +170 -0
  37. foldit_plugin_sdk-0.1.1/src/python.rs +389 -0
@@ -0,0 +1,81 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, dev]
6
+ pull_request:
7
+
8
+ env:
9
+ CARGO_TERM_COLOR: always
10
+
11
+ jobs:
12
+ check:
13
+ name: Format, Clippy, Test, Docs
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - name: Install stable toolchain
19
+ uses: dtolnay/rust-toolchain@stable
20
+
21
+ - name: Install nightly toolchain (for rustfmt)
22
+ uses: dtolnay/rust-toolchain@nightly
23
+ with:
24
+ components: rustfmt
25
+
26
+ - name: Cache cargo registry & build
27
+ uses: Swatinem/rust-cache@v2
28
+
29
+ - name: Format check
30
+ run: cargo +nightly fmt --check
31
+
32
+ - name: Clippy
33
+ run: cargo +stable clippy --all-targets --all-features -- -D warnings
34
+
35
+ - name: Test
36
+ # Default features only: the `extension-module` feature makes pyo3 omit
37
+ # the libpython link, so a standalone test binary fails to resolve Py*
38
+ # symbols. Python bindings are exercised by the `python` job below.
39
+ run: cargo +stable test
40
+
41
+ - name: Rustdoc
42
+ env:
43
+ RUSTDOCFLAGS: "-D warnings"
44
+ run: cargo +stable doc --no-deps --document-private-items
45
+
46
+ python:
47
+ name: Python binding tests
48
+ runs-on: ubuntu-latest
49
+ steps:
50
+ - uses: actions/checkout@v4
51
+ - uses: dtolnay/rust-toolchain@stable
52
+ - uses: actions/setup-python@v5
53
+ with:
54
+ python-version: "3.12"
55
+ - uses: Swatinem/rust-cache@v2
56
+ - name: Test (with embedded interpreter)
57
+ # setup-python provides a shared libpython; pyo3 links it (no
58
+ # extension-module), and auto-initialize boots an interpreter for the
59
+ # in-process tests. PYO3_PYTHON pins the interpreter explicitly.
60
+ run: PYO3_PYTHON=$(which python) cargo +stable test --features python,pyo3/auto-initialize
61
+
62
+ deny:
63
+ name: Dependency audit
64
+ runs-on: ubuntu-latest
65
+ steps:
66
+ - uses: actions/checkout@v4
67
+ - uses: EmbarkStudios/cargo-deny-action@v2
68
+
69
+ publish-check:
70
+ name: Publish dry-run
71
+ runs-on: ubuntu-latest
72
+ steps:
73
+ - uses: actions/checkout@v4
74
+
75
+ - uses: dtolnay/rust-toolchain@stable
76
+
77
+ - name: Cache cargo registry & build
78
+ uses: Swatinem/rust-cache@v2
79
+
80
+ - name: cargo publish --dry-run
81
+ run: cargo publish --dry-run
@@ -0,0 +1,120 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags: ["v[0-9]+.[0-9]+.[0-9]+"]
6
+
7
+ permissions:
8
+ contents: write
9
+ id-token: write
10
+
11
+ env:
12
+ CARGO_TERM_COLOR: always
13
+
14
+ jobs:
15
+ guard:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ with:
20
+ fetch-depth: 0
21
+ - name: Verify tag points to a commit on main
22
+ run: |
23
+ git fetch origin main
24
+ if ! git merge-base --is-ancestor "${GITHUB_SHA}" origin/main; then
25
+ echo "::error::Tag ${GITHUB_REF_NAME} (${GITHUB_SHA}) is not an ancestor of origin/main. Refusing to release."
26
+ exit 1
27
+ fi
28
+ - name: Verify tag matches Cargo.toml version
29
+ run: |
30
+ version=$(grep -m1 '^version' Cargo.toml | sed -E 's/.*"([^"]+)".*/\1/')
31
+ expected="v${version}"
32
+ if [ "${GITHUB_REF_NAME}" != "${expected}" ]; then
33
+ echo "::error::Tag ${GITHUB_REF_NAME} does not match Cargo.toml version (${expected})."
34
+ exit 1
35
+ fi
36
+
37
+ crates-io:
38
+ needs: guard
39
+ runs-on: ubuntu-latest
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+ - uses: dtolnay/rust-toolchain@stable
43
+ - uses: Swatinem/rust-cache@v2
44
+ - name: Publish to crates.io
45
+ run: cargo publish || echo "crates.io publish skipped (already exists?)"
46
+ env:
47
+ CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
48
+
49
+ wheels:
50
+ needs: guard
51
+ strategy:
52
+ fail-fast: false
53
+ matrix:
54
+ include:
55
+ - os: ubuntu-latest
56
+ target: x86_64-unknown-linux-gnu
57
+ manylinux: auto
58
+ - os: macos-14
59
+ target: aarch64-apple-darwin
60
+ manylinux: auto
61
+ - os: windows-latest
62
+ target: x86_64-pc-windows-msvc
63
+ manylinux: auto
64
+ runs-on: ${{ matrix.os }}
65
+ steps:
66
+ - uses: actions/checkout@v4
67
+
68
+ - name: Build wheel
69
+ uses: PyO3/maturin-action@v1
70
+ with:
71
+ target: ${{ matrix.target }}
72
+ manylinux: ${{ matrix.manylinux }}
73
+ command: build
74
+ args: --release --features python
75
+
76
+ - name: Upload wheel artifact
77
+ uses: actions/upload-artifact@v4
78
+ with:
79
+ name: wheel-${{ matrix.target }}
80
+ path: target/wheels/*.whl
81
+
82
+ sdist:
83
+ needs: guard
84
+ runs-on: ubuntu-latest
85
+ steps:
86
+ - uses: actions/checkout@v4
87
+ - name: Build sdist
88
+ uses: PyO3/maturin-action@v1
89
+ with:
90
+ command: sdist
91
+ - name: Upload sdist artifact
92
+ uses: actions/upload-artifact@v4
93
+ with:
94
+ name: sdist
95
+ path: target/wheels/*.tar.gz
96
+
97
+ pypi:
98
+ needs: [wheels, sdist]
99
+ runs-on: ubuntu-latest
100
+ steps:
101
+ - name: Download all artifacts
102
+ uses: actions/download-artifact@v4
103
+ with:
104
+ path: dist
105
+ merge-multiple: true
106
+
107
+ - name: Publish to PyPI
108
+ uses: pypa/gh-action-pypi-publish@release/v1
109
+ with:
110
+ packages-dir: dist/
111
+
112
+ github-release:
113
+ needs: [crates-io, pypi]
114
+ runs-on: ubuntu-latest
115
+ steps:
116
+ - uses: actions/checkout@v4
117
+ - name: Create GitHub release
118
+ run: gh release create ${{ github.ref_name }} --generate-notes
119
+ env:
120
+ GH_TOKEN: ${{ github.token }}
@@ -0,0 +1 @@
1
+ /target