pyrumo 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.
- pyrumo-0.1.0/.github/workflows/ci.yml +30 -0
- pyrumo-0.1.0/.github/workflows/python.yml +154 -0
- pyrumo-0.1.0/.github/workflows/release.yml +73 -0
- pyrumo-0.1.0/.gitignore +26 -0
- pyrumo-0.1.0/Cargo.lock +4972 -0
- pyrumo-0.1.0/Cargo.toml +28 -0
- pyrumo-0.1.0/LICENSE +21 -0
- pyrumo-0.1.0/PKG-INFO +100 -0
- pyrumo-0.1.0/README.md +79 -0
- pyrumo-0.1.0/examples/describe_dataframe.py +16 -0
- pyrumo-0.1.0/examples/good.csv +5 -0
- pyrumo-0.1.0/examples/results/good.csv +2 -0
- pyrumo-0.1.0/examples/sample.csv +6 -0
- pyrumo-0.1.0/examples/sample.rls +10 -0
- pyrumo-0.1.0/examples/sample.ttl +17 -0
- pyrumo-0.1.0/pyproject.toml +35 -0
- pyrumo-0.1.0/rust-toolchain.toml +2 -0
- pyrumo-0.1.0/src/lib.rs +311 -0
- pyrumo-0.1.0/src/main.rs +161 -0
- pyrumo-0.1.0/src/rules.rs +89 -0
- pyrumo-0.1.0/tests/cli.rs +53 -0
- pyrumo-0.1.0/tests/python/test_pyrumo.py +33 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master, main]
|
|
6
|
+
pull_request:
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
test:
|
|
15
|
+
name: Test (${{ matrix.os }})
|
|
16
|
+
runs-on: ${{ matrix.os }}
|
|
17
|
+
strategy:
|
|
18
|
+
fail-fast: false
|
|
19
|
+
matrix:
|
|
20
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v5
|
|
23
|
+
# Installs the nightly toolchain pinned in rust-toolchain.toml (required by nemo)
|
|
24
|
+
- name: Install Rust toolchain
|
|
25
|
+
run: rustup toolchain install
|
|
26
|
+
- uses: Swatinem/rust-cache@v2
|
|
27
|
+
- name: Test (without nemo rules)
|
|
28
|
+
run: cargo test
|
|
29
|
+
- name: Test (with nemo rules)
|
|
30
|
+
run: cargo test --features rules
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
name: Python
|
|
2
|
+
|
|
3
|
+
# Builds and tests the `pyrumo` wheels on every push/PR, and publishes them
|
|
4
|
+
# to PyPI when a GitHub release is published.
|
|
5
|
+
#
|
|
6
|
+
# Publishing uses PyPI trusted publishing (configure it at
|
|
7
|
+
# https://pypi.org/manage/account/publishing/ with workflow `python.yml` and
|
|
8
|
+
# environment `pypi`). Alternatively, add a `PYPI_API_TOKEN` repository secret
|
|
9
|
+
# and it will be used instead.
|
|
10
|
+
|
|
11
|
+
on:
|
|
12
|
+
push:
|
|
13
|
+
branches: [master, main]
|
|
14
|
+
pull_request:
|
|
15
|
+
release:
|
|
16
|
+
types: [published]
|
|
17
|
+
workflow_dispatch:
|
|
18
|
+
|
|
19
|
+
permissions:
|
|
20
|
+
contents: read
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
linux:
|
|
24
|
+
runs-on: ${{ matrix.os }}
|
|
25
|
+
strategy:
|
|
26
|
+
fail-fast: false
|
|
27
|
+
matrix:
|
|
28
|
+
include:
|
|
29
|
+
- target: x86_64
|
|
30
|
+
os: ubuntu-latest
|
|
31
|
+
- target: aarch64
|
|
32
|
+
os: ubuntu-24.04-arm
|
|
33
|
+
steps:
|
|
34
|
+
- uses: actions/checkout@v5
|
|
35
|
+
- uses: actions/setup-python@v5
|
|
36
|
+
with:
|
|
37
|
+
python-version: "3.12"
|
|
38
|
+
- name: Build wheels
|
|
39
|
+
uses: PyO3/maturin-action@v1
|
|
40
|
+
with:
|
|
41
|
+
target: ${{ matrix.target }}
|
|
42
|
+
manylinux: "2_28"
|
|
43
|
+
rust-toolchain: nightly
|
|
44
|
+
args: --release --out dist
|
|
45
|
+
sccache: "true"
|
|
46
|
+
- name: Test wheel
|
|
47
|
+
shell: bash
|
|
48
|
+
run: |
|
|
49
|
+
python -m pip install "$(ls dist/*.whl)[test]"
|
|
50
|
+
python -m pytest
|
|
51
|
+
- uses: actions/upload-artifact@v4
|
|
52
|
+
with:
|
|
53
|
+
name: wheels-linux-${{ matrix.target }}
|
|
54
|
+
path: dist
|
|
55
|
+
|
|
56
|
+
windows:
|
|
57
|
+
runs-on: windows-latest
|
|
58
|
+
steps:
|
|
59
|
+
- uses: actions/checkout@v5
|
|
60
|
+
- uses: actions/setup-python@v5
|
|
61
|
+
with:
|
|
62
|
+
python-version: "3.12"
|
|
63
|
+
- name: Build wheels
|
|
64
|
+
uses: PyO3/maturin-action@v1
|
|
65
|
+
with:
|
|
66
|
+
target: x64
|
|
67
|
+
rust-toolchain: nightly
|
|
68
|
+
args: --release --out dist
|
|
69
|
+
sccache: "true"
|
|
70
|
+
- name: Test wheel
|
|
71
|
+
shell: bash
|
|
72
|
+
run: |
|
|
73
|
+
python -m pip install "$(ls dist/*.whl)[test]"
|
|
74
|
+
python -m pytest
|
|
75
|
+
- uses: actions/upload-artifact@v4
|
|
76
|
+
with:
|
|
77
|
+
name: wheels-windows-x64
|
|
78
|
+
path: dist
|
|
79
|
+
|
|
80
|
+
macos:
|
|
81
|
+
runs-on: ${{ matrix.os }}
|
|
82
|
+
strategy:
|
|
83
|
+
fail-fast: false
|
|
84
|
+
matrix:
|
|
85
|
+
include:
|
|
86
|
+
- target: x86_64
|
|
87
|
+
os: macos-15-intel
|
|
88
|
+
- target: aarch64
|
|
89
|
+
os: macos-latest
|
|
90
|
+
steps:
|
|
91
|
+
- uses: actions/checkout@v5
|
|
92
|
+
- uses: actions/setup-python@v5
|
|
93
|
+
with:
|
|
94
|
+
python-version: "3.12"
|
|
95
|
+
- name: Build wheels
|
|
96
|
+
uses: PyO3/maturin-action@v1
|
|
97
|
+
with:
|
|
98
|
+
target: ${{ matrix.target }}
|
|
99
|
+
rust-toolchain: nightly
|
|
100
|
+
args: --release --out dist
|
|
101
|
+
sccache: "true"
|
|
102
|
+
- name: Test wheel
|
|
103
|
+
shell: bash
|
|
104
|
+
run: |
|
|
105
|
+
python -m pip install "$(ls dist/*.whl)[test]"
|
|
106
|
+
python -m pytest
|
|
107
|
+
- uses: actions/upload-artifact@v4
|
|
108
|
+
with:
|
|
109
|
+
name: wheels-macos-${{ matrix.target }}
|
|
110
|
+
path: dist
|
|
111
|
+
|
|
112
|
+
sdist:
|
|
113
|
+
runs-on: ubuntu-latest
|
|
114
|
+
steps:
|
|
115
|
+
- uses: actions/checkout@v5
|
|
116
|
+
- name: Build sdist
|
|
117
|
+
uses: PyO3/maturin-action@v1
|
|
118
|
+
with:
|
|
119
|
+
command: sdist
|
|
120
|
+
args: --out dist
|
|
121
|
+
- uses: actions/upload-artifact@v4
|
|
122
|
+
with:
|
|
123
|
+
name: wheels-sdist
|
|
124
|
+
path: dist
|
|
125
|
+
|
|
126
|
+
publish:
|
|
127
|
+
name: Publish to PyPI
|
|
128
|
+
if: github.event_name == 'release'
|
|
129
|
+
needs: [linux, windows, macos, sdist]
|
|
130
|
+
runs-on: ubuntu-latest
|
|
131
|
+
environment: pypi
|
|
132
|
+
permissions:
|
|
133
|
+
id-token: write
|
|
134
|
+
steps:
|
|
135
|
+
- uses: actions/checkout@v5
|
|
136
|
+
- name: Check release tag matches Cargo.toml version
|
|
137
|
+
run: |
|
|
138
|
+
version=$(grep -m1 '^version' Cargo.toml | sed 's/version = "\(.*\)"/\1/')
|
|
139
|
+
tag="${{ github.event.release.tag_name }}"
|
|
140
|
+
if [ "${tag#v}" != "$version" ]; then
|
|
141
|
+
echo "::error::Release tag '$tag' does not match Cargo.toml version '$version'"
|
|
142
|
+
exit 1
|
|
143
|
+
fi
|
|
144
|
+
- uses: actions/download-artifact@v4
|
|
145
|
+
with:
|
|
146
|
+
pattern: wheels-*
|
|
147
|
+
merge-multiple: true
|
|
148
|
+
path: dist
|
|
149
|
+
- run: ls -lh dist
|
|
150
|
+
- name: Publish
|
|
151
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
152
|
+
with:
|
|
153
|
+
# When this secret is not set it is empty and trusted publishing is used.
|
|
154
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
name: Binaries
|
|
2
|
+
|
|
3
|
+
# Builds the `rumo` CLI (with nemo rule support) for Linux, Windows and macOS.
|
|
4
|
+
# On a published GitHub release the archives are attached to that release;
|
|
5
|
+
# on a manual run they are only kept as workflow artifacts.
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
release:
|
|
9
|
+
types: [published]
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: write
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
build:
|
|
17
|
+
name: Build ${{ matrix.target }}
|
|
18
|
+
runs-on: ${{ matrix.os }}
|
|
19
|
+
strategy:
|
|
20
|
+
fail-fast: false
|
|
21
|
+
matrix:
|
|
22
|
+
include:
|
|
23
|
+
- target: x86_64-unknown-linux-gnu
|
|
24
|
+
os: ubuntu-latest
|
|
25
|
+
- target: aarch64-unknown-linux-gnu
|
|
26
|
+
os: ubuntu-24.04-arm
|
|
27
|
+
- target: x86_64-pc-windows-msvc
|
|
28
|
+
os: windows-latest
|
|
29
|
+
- target: x86_64-apple-darwin
|
|
30
|
+
os: macos-15-intel
|
|
31
|
+
- target: aarch64-apple-darwin
|
|
32
|
+
os: macos-latest
|
|
33
|
+
steps:
|
|
34
|
+
- uses: actions/checkout@v5
|
|
35
|
+
- name: Install Rust toolchain
|
|
36
|
+
run: rustup toolchain install
|
|
37
|
+
- uses: Swatinem/rust-cache@v2
|
|
38
|
+
with:
|
|
39
|
+
key: ${{ matrix.target }}
|
|
40
|
+
- name: Build
|
|
41
|
+
run: cargo build --release --features rules --target ${{ matrix.target }}
|
|
42
|
+
- name: Smoke test
|
|
43
|
+
shell: bash
|
|
44
|
+
run: |
|
|
45
|
+
./target/${{ matrix.target }}/release/rumo rules \
|
|
46
|
+
--rules examples/sample.rls --data examples/sample.csv --param GOOD_SCORE=90
|
|
47
|
+
- name: Package
|
|
48
|
+
id: package
|
|
49
|
+
shell: bash
|
|
50
|
+
run: |
|
|
51
|
+
version="${{ github.event.release.tag_name || github.sha }}"
|
|
52
|
+
name="rumo_${version}_${{ matrix.target }}"
|
|
53
|
+
mkdir "$name"
|
|
54
|
+
cp README.md LICENSE "$name/"
|
|
55
|
+
if [[ "${{ runner.os }}" == "Windows" ]]; then
|
|
56
|
+
cp "target/${{ matrix.target }}/release/rumo.exe" "$name/"
|
|
57
|
+
7z a "$name.zip" "$name" > /dev/null
|
|
58
|
+
echo "archive=$name.zip" >> "$GITHUB_OUTPUT"
|
|
59
|
+
else
|
|
60
|
+
cp "target/${{ matrix.target }}/release/rumo" "$name/"
|
|
61
|
+
tar czf "$name.tar.gz" "$name"
|
|
62
|
+
echo "archive=$name.tar.gz" >> "$GITHUB_OUTPUT"
|
|
63
|
+
fi
|
|
64
|
+
- uses: actions/upload-artifact@v4
|
|
65
|
+
with:
|
|
66
|
+
name: rumo-${{ matrix.target }}
|
|
67
|
+
path: ${{ steps.package.outputs.archive }}
|
|
68
|
+
- name: Attach to release
|
|
69
|
+
if: github.event_name == 'release'
|
|
70
|
+
shell: bash
|
|
71
|
+
run: gh release upload "${{ github.event.release.tag_name }}" "${{ steps.package.outputs.archive }}" --clobber
|
|
72
|
+
env:
|
|
73
|
+
GH_TOKEN: ${{ github.token }}
|
pyrumo-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Generated by Cargo
|
|
2
|
+
# will have compiled files and executables
|
|
3
|
+
debug
|
|
4
|
+
target
|
|
5
|
+
|
|
6
|
+
# These are backup files generated by rustfmt
|
|
7
|
+
**/*.rs.bk
|
|
8
|
+
|
|
9
|
+
# MSVC Windows builds of rustc generate these, which store debugging information
|
|
10
|
+
*.pdb
|
|
11
|
+
|
|
12
|
+
# Generated by cargo mutants
|
|
13
|
+
# Contains mutation testing data
|
|
14
|
+
**/mutants.out*/
|
|
15
|
+
|
|
16
|
+
# RustRover
|
|
17
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
18
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
19
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
20
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
21
|
+
#.idea/
|
|
22
|
+
|
|
23
|
+
.venv/
|
|
24
|
+
# Python
|
|
25
|
+
__pycache__/
|
|
26
|
+
*.pyc
|