meigen-bot 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.
- meigen_bot-0.1.0/.github/workflows/ci.yml +74 -0
- meigen_bot-0.1.0/.github/workflows/publish.yml +45 -0
- meigen_bot-0.1.0/.gitignore +12 -0
- meigen_bot-0.1.0/Cargo.lock +2183 -0
- meigen_bot-0.1.0/Cargo.toml +42 -0
- meigen_bot-0.1.0/LICENSE +21 -0
- meigen_bot-0.1.0/PKG-INFO +276 -0
- meigen_bot-0.1.0/README.md +256 -0
- meigen_bot-0.1.0/VALIDATION.md +49 -0
- meigen_bot-0.1.0/pyproject.toml +31 -0
- meigen_bot-0.1.0/python/meigen_bot/__init__.py +5 -0
- meigen_bot-0.1.0/src/bot.rs +204 -0
- meigen_bot-0.1.0/src/commands.rs +341 -0
- meigen_bot-0.1.0/src/config.rs +38 -0
- meigen_bot-0.1.0/src/cooldown.rs +50 -0
- meigen_bot-0.1.0/src/database.rs +274 -0
- meigen_bot-0.1.0/src/detector.rs +267 -0
- meigen_bot-0.1.0/src/lib.rs +9 -0
- meigen_bot-0.1.0/src/python.rs +94 -0
- meigen_bot-0.1.0/src/scoring.rs +51 -0
- meigen_bot-0.1.0/tests/cooldown_tests.rs +16 -0
- meigen_bot-0.1.0/tests/database_tests.rs +135 -0
- meigen_bot-0.1.0/tests/detector_tests.rs +50 -0
- meigen_bot-0.1.0/tests/fixtures/messages.json +534 -0
- meigen_bot-0.1.0/tests/python_smoke.py +52 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
name: CI and wheels
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [main]
|
|
5
|
+
pull_request:
|
|
6
|
+
workflow_call:
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
jobs:
|
|
11
|
+
quality:
|
|
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
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
19
|
+
with:
|
|
20
|
+
components: rustfmt, clippy
|
|
21
|
+
- uses: Swatinem/rust-cache@v2
|
|
22
|
+
- run: cargo fmt --check
|
|
23
|
+
- run: cargo check --locked --features python
|
|
24
|
+
- run: cargo clippy --locked --all-targets --features python -- -D warnings
|
|
25
|
+
- run: cargo test --locked
|
|
26
|
+
wheels:
|
|
27
|
+
needs: quality
|
|
28
|
+
strategy:
|
|
29
|
+
fail-fast: false
|
|
30
|
+
matrix:
|
|
31
|
+
python: ['3.10', '3.11', '3.12', '3.13']
|
|
32
|
+
platform:
|
|
33
|
+
- {os: ubuntu-24.04, target: x86_64}
|
|
34
|
+
- {os: ubuntu-24.04-arm, target: aarch64}
|
|
35
|
+
- {os: windows-latest, target: x86_64}
|
|
36
|
+
- {os: macos-15-intel, target: x86_64}
|
|
37
|
+
- {os: macos-15, target: aarch64}
|
|
38
|
+
runs-on: ${{ matrix.platform.os }}
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/checkout@v4
|
|
41
|
+
- uses: actions/setup-python@v5
|
|
42
|
+
with:
|
|
43
|
+
python-version: ${{ matrix.python }}
|
|
44
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
45
|
+
- uses: PyO3/maturin-action@v1
|
|
46
|
+
with:
|
|
47
|
+
target: ${{ matrix.platform.target }}
|
|
48
|
+
args: --release --locked --out dist -i ${{ runner.os == 'Linux' && format('python{0}', matrix.python) || 'python' }}
|
|
49
|
+
manylinux: auto
|
|
50
|
+
- name: Install matching wheel and smoke-test the real extension
|
|
51
|
+
shell: bash
|
|
52
|
+
run: |
|
|
53
|
+
python -m pip install --no-index --find-links dist meigen-bot
|
|
54
|
+
python tests/python_smoke.py
|
|
55
|
+
- uses: actions/upload-artifact@v4
|
|
56
|
+
with:
|
|
57
|
+
name: meigen-${{ matrix.platform.os }}-${{ matrix.python }}
|
|
58
|
+
path: dist/*.whl
|
|
59
|
+
if-no-files-found: error
|
|
60
|
+
sdist:
|
|
61
|
+
needs: quality
|
|
62
|
+
runs-on: ubuntu-latest
|
|
63
|
+
steps:
|
|
64
|
+
- uses: actions/checkout@v4
|
|
65
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
66
|
+
- uses: PyO3/maturin-action@v1
|
|
67
|
+
with:
|
|
68
|
+
command: sdist
|
|
69
|
+
args: --out dist
|
|
70
|
+
- uses: actions/upload-artifact@v4
|
|
71
|
+
with:
|
|
72
|
+
name: meigen-sdist
|
|
73
|
+
path: dist/*.tar.gz
|
|
74
|
+
if-no-files-found: error
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
name: Publish PyPI
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
tags: ['v*']
|
|
5
|
+
permissions:
|
|
6
|
+
contents: read
|
|
7
|
+
jobs:
|
|
8
|
+
version:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
- uses: actions/setup-python@v5
|
|
13
|
+
with:
|
|
14
|
+
python-version: '3.12'
|
|
15
|
+
- name: Verify tag equals Cargo package version
|
|
16
|
+
env:
|
|
17
|
+
RELEASE_TAG: ${{ github.ref_name }}
|
|
18
|
+
run: |
|
|
19
|
+
python - <<'PYCODE'
|
|
20
|
+
import os, tomllib
|
|
21
|
+
with open('Cargo.toml', 'rb') as f:
|
|
22
|
+
version = tomllib.load(f)['package']['version']
|
|
23
|
+
assert os.environ['RELEASE_TAG'] == 'v' + version
|
|
24
|
+
PYCODE
|
|
25
|
+
build:
|
|
26
|
+
needs: version
|
|
27
|
+
uses: ./.github/workflows/ci.yml
|
|
28
|
+
publish:
|
|
29
|
+
needs: build
|
|
30
|
+
runs-on: ubuntu-latest
|
|
31
|
+
environment:
|
|
32
|
+
name: pypi
|
|
33
|
+
url: https://pypi.org/p/meigen-bot
|
|
34
|
+
permissions:
|
|
35
|
+
id-token: write
|
|
36
|
+
contents: read
|
|
37
|
+
steps:
|
|
38
|
+
- uses: actions/download-artifact@v4
|
|
39
|
+
with:
|
|
40
|
+
pattern: meigen-*
|
|
41
|
+
merge-multiple: true
|
|
42
|
+
path: dist
|
|
43
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
44
|
+
with:
|
|
45
|
+
packages-dir: dist
|