embroider 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.
- embroider-0.1.0/.github/workflows/ci.yml +30 -0
- embroider-0.1.0/.github/workflows/release.yml +131 -0
- embroider-0.1.0/.gitignore +6 -0
- embroider-0.1.0/Cargo.lock +3972 -0
- embroider-0.1.0/Cargo.toml +34 -0
- embroider-0.1.0/LICENSE-APACHE +202 -0
- embroider-0.1.0/LICENSE-MIT +18 -0
- embroider-0.1.0/PKG-INFO +177 -0
- embroider-0.1.0/README.md +166 -0
- embroider-0.1.0/pyproject.toml +15 -0
- embroider-0.1.0/scripts/check_packaging.py +61 -0
- embroider-0.1.0/src/acquire.rs +67 -0
- embroider-0.1.0/src/diag.rs +25 -0
- embroider-0.1.0/src/error.rs +14 -0
- embroider-0.1.0/src/jina.rs +507 -0
- embroider-0.1.0/src/lib.rs +195 -0
- embroider-0.1.0/src/policy.rs +108 -0
- embroider-0.1.0/src/probe.rs +15 -0
- embroider-0.1.0/src/providers.rs +121 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, dev]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
rust:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v5
|
|
13
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
14
|
+
# Pure unit tests — no ORT dylib, no network, no Python linking.
|
|
15
|
+
- run: cargo test --locked
|
|
16
|
+
# Default build stays Python-free (bobine-pattern enforcement).
|
|
17
|
+
- run: cargo check --locked
|
|
18
|
+
# The wheel path (pyo3 bindings) must still compile.
|
|
19
|
+
- run: cargo check --locked --features extension-module
|
|
20
|
+
|
|
21
|
+
packaging:
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v5
|
|
25
|
+
- uses: actions/setup-python@v6
|
|
26
|
+
with:
|
|
27
|
+
python-version: "3.13"
|
|
28
|
+
# Versions lock-step + readme/license metadata — fails CI before any
|
|
29
|
+
# tag can (the OKFgraph test_packaging.py lesson).
|
|
30
|
+
- run: python scripts/check_packaging.py
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Release workflow — dual publish on version tags.
|
|
2
|
+
#
|
|
3
|
+
# Tag `vX.Y.Z` on **main** triggers:
|
|
4
|
+
# 1. crates.io — pure-Rust crate `embroider` (default features, no pyo3)
|
|
5
|
+
# 2. PyPI — Python wheel package `embroider` via maturin
|
|
6
|
+
# (extension-module)
|
|
7
|
+
#
|
|
8
|
+
# Required secrets / configuration:
|
|
9
|
+
# - secrets.CARGO_REGISTRY_TOKEN → crates.io API token
|
|
10
|
+
# - PyPI trusted publisher configured for this workflow + environment `pypi`
|
|
11
|
+
# (Project: embroider · Workflow: release.yml · Environment: pypi)
|
|
12
|
+
|
|
13
|
+
name: Release
|
|
14
|
+
|
|
15
|
+
on:
|
|
16
|
+
push:
|
|
17
|
+
tags: ["v*"]
|
|
18
|
+
workflow_dispatch:
|
|
19
|
+
|
|
20
|
+
permissions:
|
|
21
|
+
contents: read
|
|
22
|
+
|
|
23
|
+
jobs:
|
|
24
|
+
# ------------------------------------------------------------------
|
|
25
|
+
# 1. crates.io — Rust library (no Python bindings)
|
|
26
|
+
# ------------------------------------------------------------------
|
|
27
|
+
crates-io:
|
|
28
|
+
runs-on: ubuntu-22.04
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/checkout@v6
|
|
31
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
32
|
+
- name: Tag matches Cargo.toml version
|
|
33
|
+
run: |
|
|
34
|
+
tag="${GITHUB_REF_NAME#v}"
|
|
35
|
+
ver=$(grep -m1 '^version' Cargo.toml | sed 's/.*"\(.*\)"/\1/')
|
|
36
|
+
test "$tag" = "$ver" || { echo "tag v$tag != Cargo.toml $ver"; exit 1; }
|
|
37
|
+
- name: Python and Cargo versions in lock-step
|
|
38
|
+
run: |
|
|
39
|
+
cver=$(grep -m1 '^version' Cargo.toml | sed 's/.*"\(.*\)"/\1/')
|
|
40
|
+
pver=$(grep -m1 '^version' pyproject.toml | sed 's/.*"\(.*\)"/\1/')
|
|
41
|
+
test "$cver" = "$pver" || { echo "Cargo.toml $cver != pyproject.toml $pver"; exit 1; }
|
|
42
|
+
- name: Verify default build is Python-free
|
|
43
|
+
run: cargo check --locked
|
|
44
|
+
- name: Run unit tests (pure — no ORT dylib, no network)
|
|
45
|
+
run: cargo test --locked --lib
|
|
46
|
+
- name: Publish to crates.io
|
|
47
|
+
# Tags publish; manual dispatch is a dry-run (check + test only).
|
|
48
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
49
|
+
run: cargo publish --locked
|
|
50
|
+
env:
|
|
51
|
+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
|
52
|
+
|
|
53
|
+
# ------------------------------------------------------------------
|
|
54
|
+
# 2. PyPI — Python wheel matrix via maturin (trusted publishing)
|
|
55
|
+
# ------------------------------------------------------------------
|
|
56
|
+
pypi:
|
|
57
|
+
# ubuntu + windows x86_64, macOS arm64 (native runners — no cross builds).
|
|
58
|
+
# No Intel mac (deprecated runners), no other exotic targets.
|
|
59
|
+
strategy:
|
|
60
|
+
fail-fast: false
|
|
61
|
+
matrix:
|
|
62
|
+
platform:
|
|
63
|
+
- runner: ubuntu-22.04
|
|
64
|
+
target: x86_64
|
|
65
|
+
- runner: windows-latest
|
|
66
|
+
target: x64
|
|
67
|
+
- runner: macos-latest
|
|
68
|
+
target: aarch64
|
|
69
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
70
|
+
permissions:
|
|
71
|
+
id-token: write # PyPI trusted publishing
|
|
72
|
+
steps:
|
|
73
|
+
- uses: actions/checkout@v6
|
|
74
|
+
|
|
75
|
+
- name: Build wheel (sdist on linux x86_64 too)
|
|
76
|
+
uses: PyO3/maturin-action@v1
|
|
77
|
+
with:
|
|
78
|
+
target: ${{ matrix.platform.target }}
|
|
79
|
+
args: --release --out dist --locked --features extension-module
|
|
80
|
+
# 2_28, not auto: auto resolves to CentOS 7-based manylinux2014
|
|
81
|
+
# (OpenSSL 1.0.2 < openssl-sys minimum 1.1.0). Ignored on win/mac.
|
|
82
|
+
manylinux: ${{ matrix.platform.manylinux || '2_28' }}
|
|
83
|
+
sccache: true
|
|
84
|
+
# Linux wheels build in a manylinux container: ort-sys build-deps
|
|
85
|
+
# on ureq/native-tls → openssl-sys needs headers there (no-op on
|
|
86
|
+
# windows/macos runners).
|
|
87
|
+
before-script-linux: yum install -y openssl-devel
|
|
88
|
+
|
|
89
|
+
- name: Upload wheels
|
|
90
|
+
uses: actions/upload-artifact@v6
|
|
91
|
+
with:
|
|
92
|
+
name: wheels-${{ matrix.platform.runner }}-${{ matrix.platform.target }}
|
|
93
|
+
path: dist
|
|
94
|
+
|
|
95
|
+
# ------------------------------------------------------------------
|
|
96
|
+
# 3. sdist + PyPI upload (single verified copy — no merge-multiple)
|
|
97
|
+
# ------------------------------------------------------------------
|
|
98
|
+
pypi-publish:
|
|
99
|
+
needs: [pypi]
|
|
100
|
+
runs-on: ubuntu-22.04
|
|
101
|
+
environment: pypi
|
|
102
|
+
permissions:
|
|
103
|
+
id-token: write
|
|
104
|
+
steps:
|
|
105
|
+
- uses: actions/checkout@v6
|
|
106
|
+
|
|
107
|
+
- name: Build sdist
|
|
108
|
+
uses: PyO3/maturin-action@v1
|
|
109
|
+
with:
|
|
110
|
+
command: sdist
|
|
111
|
+
args: --out dist
|
|
112
|
+
|
|
113
|
+
- name: Download wheels (per-artifact dirs — never merge-multiple,
|
|
114
|
+
# see bobine release postmortem: identical paths across artifacts
|
|
115
|
+
# corrupt the merged zip)
|
|
116
|
+
uses: actions/download-artifact@v6
|
|
117
|
+
with:
|
|
118
|
+
pattern: wheels-*
|
|
119
|
+
path: dist
|
|
120
|
+
|
|
121
|
+
- name: Flatten wheel directories (drop emptied artifact dirs —
|
|
122
|
+
# the publisher rejects any non-distribution entry in dist/)
|
|
123
|
+
run: |
|
|
124
|
+
find dist -name '*.whl' -exec mv {} dist/ \;
|
|
125
|
+
find dist -mindepth 1 -type d -empty -delete
|
|
126
|
+
ls -la dist/
|
|
127
|
+
|
|
128
|
+
- name: Publish to PyPI
|
|
129
|
+
# Tags publish; manual dispatch stops after building wheels.
|
|
130
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
131
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|