lplearn 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.
- lplearn-0.1.0/.github/workflows/pages.yml +64 -0
- lplearn-0.1.0/.github/workflows/release.yml +159 -0
- lplearn-0.1.0/.github/workflows/testpypi.yml +176 -0
- lplearn-0.1.0/.github/workflows/wheel.yml +47 -0
- lplearn-0.1.0/.gitignore +9 -0
- lplearn-0.1.0/Cargo.lock +107 -0
- lplearn-0.1.0/Cargo.toml +15 -0
- lplearn-0.1.0/LICENSE +674 -0
- lplearn-0.1.0/PKG-INFO +34 -0
- lplearn-0.1.0/README.md +22 -0
- lplearn-0.1.0/build.rs +19 -0
- lplearn-0.1.0/docs/WEB_SOURCE.md +5 -0
- lplearn-0.1.0/docs/python-rust-bridge.md +46 -0
- lplearn-0.1.0/lplearn.data/scripts/lplearn +4 -0
- lplearn-0.1.0/lplearn.data/scripts/lplearn.cmd +11 -0
- lplearn-0.1.0/pdf/full-paper.pdf +0 -0
- lplearn-0.1.0/pyproject.toml +21 -0
- lplearn-0.1.0/python/lplearn/__init__.py +5 -0
- lplearn-0.1.0/python/lplearn/__main__.py +5 -0
- lplearn-0.1.0/python/lplearn/backend.py +59 -0
- lplearn-0.1.0/python/lplearn/cli.py +25 -0
- lplearn-0.1.0/src/main.rs +40 -0
- lplearn-0.1.0/tests/fixtures/ping.json +4 -0
- lplearn-0.1.0/tests/test_bridge.py +68 -0
- lplearn-0.1.0/web/README.md +97 -0
- lplearn-0.1.0/web/index.html +14 -0
- lplearn-0.1.0/web/package-lock.json +2229 -0
- lplearn-0.1.0/web/package.json +28 -0
- lplearn-0.1.0/web/src/App.tsx +113 -0
- lplearn-0.1.0/web/src/components/LaneView.tsx +174 -0
- lplearn-0.1.0/web/src/components/PiePlot.tsx +123 -0
- lplearn-0.1.0/web/src/components/PlazaStage.tsx +414 -0
- lplearn-0.1.0/web/src/components/Scrolly.tsx +69 -0
- lplearn-0.1.0/web/src/components/TeX.tsx +11 -0
- lplearn-0.1.0/web/src/components/art.tsx +201 -0
- lplearn-0.1.0/web/src/components/charts.tsx +164 -0
- lplearn-0.1.0/web/src/components/controls.tsx +101 -0
- lplearn-0.1.0/web/src/data/model.json +1 -0
- lplearn-0.1.0/web/src/data/reference.json +1 -0
- lplearn-0.1.0/web/src/engine/data.ts +99 -0
- lplearn-0.1.0/web/src/engine/dp.ts +89 -0
- lplearn-0.1.0/web/src/engine/engine.test.ts +130 -0
- lplearn-0.1.0/web/src/engine/fluid.ts +116 -0
- lplearn-0.1.0/web/src/engine/gda.ts +151 -0
- lplearn-0.1.0/web/src/engine/model.ts +139 -0
- lplearn-0.1.0/web/src/engine/policy.ts +51 -0
- lplearn-0.1.0/web/src/engine/rng.ts +38 -0
- lplearn-0.1.0/web/src/engine/sim.ts +296 -0
- lplearn-0.1.0/web/src/hooks/useGda.ts +63 -0
- lplearn-0.1.0/web/src/main.tsx +11 -0
- lplearn-0.1.0/web/src/sections/Hero.tsx +32 -0
- lplearn-0.1.0/web/src/sections/Playground.tsx +213 -0
- lplearn-0.1.0/web/src/sections/booth.tsx +499 -0
- lplearn-0.1.0/web/src/sections/coordinator.tsx +433 -0
- lplearn-0.1.0/web/src/sections/planning.tsx +187 -0
- lplearn-0.1.0/web/src/sections/plaza.tsx +160 -0
- lplearn-0.1.0/web/src/sections/results.tsx +141 -0
- lplearn-0.1.0/web/src/styles.css +1185 -0
- lplearn-0.1.0/web/src/workers/gda.worker.ts +60 -0
- lplearn-0.1.0/web/tsconfig.json +19 -0
- lplearn-0.1.0/web/vite.config.ts +14 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
name: Web explainer (GitHub Pages)
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
paths:
|
|
7
|
+
- 'web/**'
|
|
8
|
+
- 'docs/WEB_SOURCE.md'
|
|
9
|
+
- 'LICENSE'
|
|
10
|
+
- '.github/workflows/pages.yml'
|
|
11
|
+
pull_request:
|
|
12
|
+
paths:
|
|
13
|
+
- 'web/**'
|
|
14
|
+
- 'docs/WEB_SOURCE.md'
|
|
15
|
+
- 'LICENSE'
|
|
16
|
+
- '.github/workflows/pages.yml'
|
|
17
|
+
workflow_dispatch:
|
|
18
|
+
|
|
19
|
+
permissions:
|
|
20
|
+
contents: read
|
|
21
|
+
|
|
22
|
+
concurrency:
|
|
23
|
+
group: pages-${{ github.event_name == 'pull_request' && github.ref || 'deploy' }}
|
|
24
|
+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
25
|
+
|
|
26
|
+
jobs:
|
|
27
|
+
build:
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/checkout@v4
|
|
31
|
+
- uses: actions/setup-node@v4
|
|
32
|
+
with:
|
|
33
|
+
node-version: 24
|
|
34
|
+
cache: npm
|
|
35
|
+
cache-dependency-path: web/package-lock.json
|
|
36
|
+
- name: Install dependencies
|
|
37
|
+
run: npm ci
|
|
38
|
+
working-directory: web
|
|
39
|
+
- name: Test browser model
|
|
40
|
+
run: npm test
|
|
41
|
+
working-directory: web
|
|
42
|
+
- name: Build static site
|
|
43
|
+
run: npm run build
|
|
44
|
+
working-directory: web
|
|
45
|
+
- name: Upload Pages artifact
|
|
46
|
+
if: github.event_name != 'pull_request'
|
|
47
|
+
uses: actions/upload-pages-artifact@v3
|
|
48
|
+
with:
|
|
49
|
+
path: web/dist
|
|
50
|
+
|
|
51
|
+
deploy:
|
|
52
|
+
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
|
|
53
|
+
needs: build
|
|
54
|
+
runs-on: ubuntu-latest
|
|
55
|
+
permissions:
|
|
56
|
+
pages: write
|
|
57
|
+
id-token: write
|
|
58
|
+
environment:
|
|
59
|
+
name: github-pages
|
|
60
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
61
|
+
steps:
|
|
62
|
+
- name: Deploy to GitHub Pages
|
|
63
|
+
id: deployment
|
|
64
|
+
uses: actions/deploy-pages@v4
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
name: Versioned release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ['v*']
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
validate-tag:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- uses: actions/setup-python@v5
|
|
16
|
+
with:
|
|
17
|
+
python-version: '3.12'
|
|
18
|
+
- name: Match tag and package versions
|
|
19
|
+
run: |
|
|
20
|
+
python - <<'PY'
|
|
21
|
+
import os
|
|
22
|
+
import tomllib
|
|
23
|
+
from pathlib import Path
|
|
24
|
+
|
|
25
|
+
tag = os.environ["GITHUB_REF_NAME"]
|
|
26
|
+
if not tag.startswith("v"):
|
|
27
|
+
raise SystemExit(f"Expected a v-prefixed tag, got {tag!r}")
|
|
28
|
+
release = tag[1:]
|
|
29
|
+
project = tomllib.loads(Path("pyproject.toml").read_text())
|
|
30
|
+
cargo = tomllib.loads(Path("Cargo.toml").read_text())
|
|
31
|
+
python_version = project["project"]["version"]
|
|
32
|
+
rust_version = cargo["package"]["version"]
|
|
33
|
+
if python_version != release or rust_version != release:
|
|
34
|
+
raise SystemExit(
|
|
35
|
+
f"tag={release}, pyproject={python_version}, "
|
|
36
|
+
f"Cargo={rust_version}"
|
|
37
|
+
)
|
|
38
|
+
print(f"Release version verified: {release}")
|
|
39
|
+
PY
|
|
40
|
+
|
|
41
|
+
wheels:
|
|
42
|
+
needs: validate-tag
|
|
43
|
+
strategy:
|
|
44
|
+
fail-fast: false
|
|
45
|
+
matrix:
|
|
46
|
+
os: [ubuntu-latest, macos-15, windows-latest]
|
|
47
|
+
runs-on: ${{ matrix.os }}
|
|
48
|
+
defaults:
|
|
49
|
+
run:
|
|
50
|
+
shell: bash
|
|
51
|
+
steps:
|
|
52
|
+
- uses: actions/checkout@v4
|
|
53
|
+
- uses: actions/setup-python@v5
|
|
54
|
+
with:
|
|
55
|
+
python-version: '3.12'
|
|
56
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
57
|
+
- run: python -m pip install 'maturin>=1.9,<2'
|
|
58
|
+
- run: maturin build --release --out dist
|
|
59
|
+
- run: python -m pip install --no-index dist/*.whl
|
|
60
|
+
- run: python -m unittest discover -s tests -v
|
|
61
|
+
- run: python -m lplearn backend ping
|
|
62
|
+
- if: runner.os != 'Windows'
|
|
63
|
+
run: lplearn backend ping
|
|
64
|
+
- if: runner.os == 'Windows'
|
|
65
|
+
shell: cmd
|
|
66
|
+
run: lplearn.cmd backend ping
|
|
67
|
+
- uses: actions/upload-artifact@v4
|
|
68
|
+
with:
|
|
69
|
+
name: dist-${{ matrix.os }}
|
|
70
|
+
path: dist/*.whl
|
|
71
|
+
if-no-files-found: error
|
|
72
|
+
|
|
73
|
+
sdist:
|
|
74
|
+
needs: validate-tag
|
|
75
|
+
runs-on: ubuntu-latest
|
|
76
|
+
steps:
|
|
77
|
+
- uses: actions/checkout@v4
|
|
78
|
+
- uses: actions/setup-python@v5
|
|
79
|
+
with:
|
|
80
|
+
python-version: '3.12'
|
|
81
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
82
|
+
- run: python -m pip install build
|
|
83
|
+
- run: python -m build --sdist
|
|
84
|
+
- run: python -m pip install --force-reinstall dist/*.tar.gz
|
|
85
|
+
- run: python -m unittest discover -s tests -v
|
|
86
|
+
- run: python -m lplearn backend ping
|
|
87
|
+
- run: python -m pip check
|
|
88
|
+
- uses: actions/upload-artifact@v4
|
|
89
|
+
with:
|
|
90
|
+
name: dist-sdist
|
|
91
|
+
path: dist/*.tar.gz
|
|
92
|
+
if-no-files-found: error
|
|
93
|
+
|
|
94
|
+
publish-pypi:
|
|
95
|
+
needs: [wheels, sdist]
|
|
96
|
+
runs-on: ubuntu-latest
|
|
97
|
+
environment:
|
|
98
|
+
name: pypi
|
|
99
|
+
url: https://pypi.org/project/lplearn/
|
|
100
|
+
permissions:
|
|
101
|
+
id-token: write
|
|
102
|
+
steps:
|
|
103
|
+
- uses: actions/download-artifact@v4
|
|
104
|
+
with:
|
|
105
|
+
pattern: dist-*
|
|
106
|
+
path: dist
|
|
107
|
+
merge-multiple: true
|
|
108
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
109
|
+
|
|
110
|
+
verify-pypi:
|
|
111
|
+
needs: publish-pypi
|
|
112
|
+
strategy:
|
|
113
|
+
fail-fast: false
|
|
114
|
+
matrix:
|
|
115
|
+
os: [ubuntu-latest, macos-15, windows-latest]
|
|
116
|
+
runs-on: ${{ matrix.os }}
|
|
117
|
+
defaults:
|
|
118
|
+
run:
|
|
119
|
+
shell: bash
|
|
120
|
+
steps:
|
|
121
|
+
- uses: actions/setup-python@v5
|
|
122
|
+
with:
|
|
123
|
+
python-version: '3.12'
|
|
124
|
+
- name: Install and exercise the published wheel
|
|
125
|
+
run: |
|
|
126
|
+
version="${GITHUB_REF_NAME#v}"
|
|
127
|
+
for attempt in {1..12}; do
|
|
128
|
+
if python -m pip install "lplearn==$version"; then
|
|
129
|
+
break
|
|
130
|
+
fi
|
|
131
|
+
if [ "$attempt" -eq 12 ]; then
|
|
132
|
+
exit 1
|
|
133
|
+
fi
|
|
134
|
+
sleep 10
|
|
135
|
+
done
|
|
136
|
+
python -m lplearn backend ping
|
|
137
|
+
- if: runner.os != 'Windows'
|
|
138
|
+
run: lplearn backend ping
|
|
139
|
+
- if: runner.os == 'Windows'
|
|
140
|
+
shell: cmd
|
|
141
|
+
run: lplearn.cmd backend ping
|
|
142
|
+
|
|
143
|
+
github-release:
|
|
144
|
+
needs: verify-pypi
|
|
145
|
+
runs-on: ubuntu-latest
|
|
146
|
+
permissions:
|
|
147
|
+
contents: write
|
|
148
|
+
steps:
|
|
149
|
+
- uses: actions/download-artifact@v4
|
|
150
|
+
with:
|
|
151
|
+
pattern: dist-*
|
|
152
|
+
path: dist
|
|
153
|
+
merge-multiple: true
|
|
154
|
+
- name: Create GitHub Release with the published artifacts
|
|
155
|
+
env:
|
|
156
|
+
GH_TOKEN: ${{ github.token }}
|
|
157
|
+
run: >-
|
|
158
|
+
gh release create "$GITHUB_REF_NAME" dist/* --repo
|
|
159
|
+
"$GITHUB_REPOSITORY" --verify-tag --generate-notes
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
name: TestPyPI rehearsal
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
paths:
|
|
6
|
+
- .github/workflows/testpypi.yml
|
|
7
|
+
- Cargo.toml
|
|
8
|
+
- build.rs
|
|
9
|
+
- pyproject.toml
|
|
10
|
+
- python/**
|
|
11
|
+
- src/**
|
|
12
|
+
- tests/**
|
|
13
|
+
workflow_dispatch:
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
concurrency:
|
|
19
|
+
group: testpypi-rehearsal-${{ github.ref }}
|
|
20
|
+
cancel-in-progress: false
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
validate:
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
outputs:
|
|
26
|
+
version: ${{ steps.metadata.outputs.version }}
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@v4
|
|
29
|
+
- uses: actions/setup-python@v5
|
|
30
|
+
with:
|
|
31
|
+
python-version: '3.12'
|
|
32
|
+
- name: Require main and matching package versions
|
|
33
|
+
id: metadata
|
|
34
|
+
run: |
|
|
35
|
+
python - <<'PY'
|
|
36
|
+
import os
|
|
37
|
+
import tomllib
|
|
38
|
+
from pathlib import Path
|
|
39
|
+
|
|
40
|
+
if (
|
|
41
|
+
os.environ["GITHUB_EVENT_NAME"] == "workflow_dispatch"
|
|
42
|
+
and os.environ["GITHUB_REF"] != "refs/heads/main"
|
|
43
|
+
):
|
|
44
|
+
raise SystemExit("TestPyPI rehearsal must run from main")
|
|
45
|
+
|
|
46
|
+
project = tomllib.loads(Path("pyproject.toml").read_text())
|
|
47
|
+
cargo = tomllib.loads(Path("Cargo.toml").read_text())
|
|
48
|
+
python_version = project["project"]["version"]
|
|
49
|
+
rust_version = cargo["package"]["version"]
|
|
50
|
+
if python_version != rust_version:
|
|
51
|
+
raise SystemExit(
|
|
52
|
+
f"pyproject={python_version}, Cargo={rust_version}"
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
with open(os.environ["GITHUB_OUTPUT"], "a") as output:
|
|
56
|
+
output.write(f"version={python_version}\n")
|
|
57
|
+
print(f"TestPyPI rehearsal version: {python_version}")
|
|
58
|
+
PY
|
|
59
|
+
|
|
60
|
+
wheels:
|
|
61
|
+
needs: validate
|
|
62
|
+
strategy:
|
|
63
|
+
fail-fast: false
|
|
64
|
+
matrix:
|
|
65
|
+
os: [ubuntu-latest, macos-15, windows-latest]
|
|
66
|
+
runs-on: ${{ matrix.os }}
|
|
67
|
+
defaults:
|
|
68
|
+
run:
|
|
69
|
+
shell: bash
|
|
70
|
+
steps:
|
|
71
|
+
- uses: actions/checkout@v4
|
|
72
|
+
- uses: actions/setup-python@v5
|
|
73
|
+
with:
|
|
74
|
+
python-version: '3.12'
|
|
75
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
76
|
+
- run: python -m pip install 'maturin>=1.9,<2'
|
|
77
|
+
- run: maturin build --release --out dist
|
|
78
|
+
- run: python -m pip install --no-index dist/*.whl
|
|
79
|
+
- name: Test installed wheel and Python entry point
|
|
80
|
+
run: |
|
|
81
|
+
python -m unittest discover -s tests -v
|
|
82
|
+
python -m lplearn backend ping
|
|
83
|
+
- if: runner.os != 'Windows'
|
|
84
|
+
run: lplearn backend ping
|
|
85
|
+
- if: runner.os == 'Windows'
|
|
86
|
+
shell: cmd
|
|
87
|
+
run: lplearn.cmd backend ping
|
|
88
|
+
- uses: actions/upload-artifact@v4
|
|
89
|
+
with:
|
|
90
|
+
name: dist-${{ matrix.os }}
|
|
91
|
+
path: dist/*.whl
|
|
92
|
+
if-no-files-found: error
|
|
93
|
+
|
|
94
|
+
sdist:
|
|
95
|
+
needs: validate
|
|
96
|
+
runs-on: ubuntu-latest
|
|
97
|
+
steps:
|
|
98
|
+
- uses: actions/checkout@v4
|
|
99
|
+
- uses: actions/setup-python@v5
|
|
100
|
+
with:
|
|
101
|
+
python-version: '3.12'
|
|
102
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
103
|
+
- run: python -m pip install 'maturin>=1.9,<2' 'build>=1,<2'
|
|
104
|
+
- run: python -m build --sdist --outdir dist
|
|
105
|
+
- run: python -m pip install --force-reinstall dist/*.tar.gz
|
|
106
|
+
- name: Test installed source distribution
|
|
107
|
+
run: |
|
|
108
|
+
python -m unittest discover -s tests -v
|
|
109
|
+
python -m lplearn backend ping
|
|
110
|
+
python -m pip check
|
|
111
|
+
- run: lplearn backend ping
|
|
112
|
+
- uses: actions/upload-artifact@v4
|
|
113
|
+
with:
|
|
114
|
+
name: dist-sdist
|
|
115
|
+
path: dist/*.tar.gz
|
|
116
|
+
if-no-files-found: error
|
|
117
|
+
|
|
118
|
+
publish-testpypi:
|
|
119
|
+
if: github.event_name == 'workflow_dispatch'
|
|
120
|
+
needs: [validate, wheels, sdist]
|
|
121
|
+
runs-on: ubuntu-latest
|
|
122
|
+
environment:
|
|
123
|
+
name: testpypi
|
|
124
|
+
url: https://test.pypi.org/project/lplearn/
|
|
125
|
+
permissions:
|
|
126
|
+
id-token: write
|
|
127
|
+
steps:
|
|
128
|
+
- uses: actions/download-artifact@v4
|
|
129
|
+
with:
|
|
130
|
+
pattern: dist-*
|
|
131
|
+
path: dist
|
|
132
|
+
merge-multiple: true
|
|
133
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
134
|
+
with:
|
|
135
|
+
repository-url: https://test.pypi.org/legacy/
|
|
136
|
+
# The post-rename rehearsal reuses the existing 0.1.0 files.
|
|
137
|
+
skip-existing: true
|
|
138
|
+
|
|
139
|
+
verify-testpypi:
|
|
140
|
+
if: github.event_name == 'workflow_dispatch'
|
|
141
|
+
needs: [validate, publish-testpypi]
|
|
142
|
+
strategy:
|
|
143
|
+
fail-fast: false
|
|
144
|
+
matrix:
|
|
145
|
+
os: [ubuntu-latest, macos-15, windows-latest]
|
|
146
|
+
runs-on: ${{ matrix.os }}
|
|
147
|
+
defaults:
|
|
148
|
+
run:
|
|
149
|
+
shell: bash
|
|
150
|
+
steps:
|
|
151
|
+
- uses: actions/setup-python@v5
|
|
152
|
+
with:
|
|
153
|
+
python-version: '3.12'
|
|
154
|
+
- name: Install and exercise the uploaded TestPyPI wheel
|
|
155
|
+
env:
|
|
156
|
+
PACKAGE_VERSION: ${{ needs.validate.outputs.version }}
|
|
157
|
+
run: |
|
|
158
|
+
for attempt in {1..12}; do
|
|
159
|
+
if python -m pip install \
|
|
160
|
+
--index-url https://test.pypi.org/simple/ \
|
|
161
|
+
--no-deps --only-binary=:all: \
|
|
162
|
+
"lplearn==$PACKAGE_VERSION"; then
|
|
163
|
+
break
|
|
164
|
+
fi
|
|
165
|
+
if [ "$attempt" -eq 12 ]; then
|
|
166
|
+
exit 1
|
|
167
|
+
fi
|
|
168
|
+
sleep 10
|
|
169
|
+
done
|
|
170
|
+
python -m lplearn backend ping
|
|
171
|
+
python -m pip check
|
|
172
|
+
- if: runner.os != 'Windows'
|
|
173
|
+
run: lplearn backend ping
|
|
174
|
+
- if: runner.os == 'Windows'
|
|
175
|
+
shell: cmd
|
|
176
|
+
run: lplearn.cmd backend ping
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Wheel bridge
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
wheel:
|
|
7
|
+
strategy:
|
|
8
|
+
fail-fast: false
|
|
9
|
+
matrix:
|
|
10
|
+
os: [ubuntu-latest, macos-15, windows-latest]
|
|
11
|
+
runs-on: ${{ matrix.os }}
|
|
12
|
+
defaults:
|
|
13
|
+
run:
|
|
14
|
+
shell: bash
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
- uses: actions/setup-python@v5
|
|
18
|
+
with:
|
|
19
|
+
python-version: '3.12'
|
|
20
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
21
|
+
- run: python -m pip install 'maturin>=1.9,<2'
|
|
22
|
+
- run: maturin build --release --out dist
|
|
23
|
+
- run: python -m pip install --no-index dist/*.whl
|
|
24
|
+
- name: Test installed wheel
|
|
25
|
+
run: |
|
|
26
|
+
python -m unittest discover -s tests -v
|
|
27
|
+
python -m lplearn backend ping
|
|
28
|
+
- if: runner.os != 'Windows'
|
|
29
|
+
run: lplearn backend ping
|
|
30
|
+
- if: runner.os == 'Windows'
|
|
31
|
+
shell: cmd
|
|
32
|
+
run: lplearn.cmd backend ping
|
|
33
|
+
- name: Build and install the source distribution
|
|
34
|
+
run: |
|
|
35
|
+
python -m pip install 'build>=1,<2'
|
|
36
|
+
python -m build --sdist --outdir dist
|
|
37
|
+
python -m pip install --force-reinstall dist/*.tar.gz
|
|
38
|
+
- name: Test installed source distribution
|
|
39
|
+
run: |
|
|
40
|
+
python -m unittest discover -s tests -v
|
|
41
|
+
python -m lplearn backend ping
|
|
42
|
+
python -m pip check
|
|
43
|
+
- if: runner.os != 'Windows'
|
|
44
|
+
run: lplearn backend ping
|
|
45
|
+
- if: runner.os == 'Windows'
|
|
46
|
+
shell: cmd
|
|
47
|
+
run: lplearn.cmd backend ping
|
lplearn-0.1.0/.gitignore
ADDED
lplearn-0.1.0/Cargo.lock
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "itoa"
|
|
7
|
+
version = "1.0.18"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
|
|
10
|
+
|
|
11
|
+
[[package]]
|
|
12
|
+
name = "lplearn"
|
|
13
|
+
version = "0.1.0"
|
|
14
|
+
dependencies = [
|
|
15
|
+
"serde",
|
|
16
|
+
"serde_json",
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
[[package]]
|
|
20
|
+
name = "memchr"
|
|
21
|
+
version = "2.8.3"
|
|
22
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
23
|
+
checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
|
24
|
+
|
|
25
|
+
[[package]]
|
|
26
|
+
name = "proc-macro2"
|
|
27
|
+
version = "1.0.107"
|
|
28
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
29
|
+
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
|
|
30
|
+
dependencies = [
|
|
31
|
+
"unicode-ident",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[[package]]
|
|
35
|
+
name = "quote"
|
|
36
|
+
version = "1.0.47"
|
|
37
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
38
|
+
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
|
|
39
|
+
dependencies = [
|
|
40
|
+
"proc-macro2",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
[[package]]
|
|
44
|
+
name = "serde"
|
|
45
|
+
version = "1.0.229"
|
|
46
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
47
|
+
checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
|
|
48
|
+
dependencies = [
|
|
49
|
+
"serde_core",
|
|
50
|
+
"serde_derive",
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
[[package]]
|
|
54
|
+
name = "serde_core"
|
|
55
|
+
version = "1.0.229"
|
|
56
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
57
|
+
checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
|
|
58
|
+
dependencies = [
|
|
59
|
+
"serde_derive",
|
|
60
|
+
]
|
|
61
|
+
|
|
62
|
+
[[package]]
|
|
63
|
+
name = "serde_derive"
|
|
64
|
+
version = "1.0.229"
|
|
65
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
66
|
+
checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
|
|
67
|
+
dependencies = [
|
|
68
|
+
"proc-macro2",
|
|
69
|
+
"quote",
|
|
70
|
+
"syn",
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
[[package]]
|
|
74
|
+
name = "serde_json"
|
|
75
|
+
version = "1.0.154"
|
|
76
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
77
|
+
checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"
|
|
78
|
+
dependencies = [
|
|
79
|
+
"itoa",
|
|
80
|
+
"memchr",
|
|
81
|
+
"serde",
|
|
82
|
+
"serde_core",
|
|
83
|
+
"zmij",
|
|
84
|
+
]
|
|
85
|
+
|
|
86
|
+
[[package]]
|
|
87
|
+
name = "syn"
|
|
88
|
+
version = "3.0.9"
|
|
89
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
90
|
+
checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
|
|
91
|
+
dependencies = [
|
|
92
|
+
"proc-macro2",
|
|
93
|
+
"quote",
|
|
94
|
+
"unicode-ident",
|
|
95
|
+
]
|
|
96
|
+
|
|
97
|
+
[[package]]
|
|
98
|
+
name = "unicode-ident"
|
|
99
|
+
version = "1.0.27"
|
|
100
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
101
|
+
checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
|
|
102
|
+
|
|
103
|
+
[[package]]
|
|
104
|
+
name = "zmij"
|
|
105
|
+
version = "1.0.23"
|
|
106
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
107
|
+
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
|
lplearn-0.1.0/Cargo.toml
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "lplearn"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
license = "GPL-3.0-or-later"
|
|
6
|
+
build = "build.rs"
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
|
|
9
|
+
[[bin]]
|
|
10
|
+
name = "lplearn-native"
|
|
11
|
+
path = "src/main.rs"
|
|
12
|
+
|
|
13
|
+
[dependencies]
|
|
14
|
+
serde = { version = "1", features = ["derive"] }
|
|
15
|
+
serde_json = "1"
|