clypso-chat 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.
@@ -0,0 +1,164 @@
1
+ # Tests on Linux, macOS and Windows; every release wheel and the sdist; on a v* tag, a GitHub Release and PyPI.
2
+ # Run by hand with "testpypi" to publish the same files to TestPyPI first. Publishing is PyPI Trusted Publishing (no tokens):
3
+ # see README → Releasing for the one-time setup.
4
+ name: CI
5
+
6
+ on:
7
+ push:
8
+ branches: [main]
9
+ tags: ["v*"]
10
+ pull_request:
11
+ workflow_dispatch:
12
+ inputs:
13
+ publish:
14
+ description: "Publish the built files to"
15
+ type: choice
16
+ options: [nowhere, testpypi]
17
+ default: nowhere
18
+
19
+ permissions:
20
+ contents: read
21
+
22
+ concurrency:
23
+ group: ${{ github.workflow }}-${{ github.ref }}
24
+ cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') }}
25
+
26
+ jobs:
27
+ rust:
28
+ runs-on: ubuntu-latest
29
+ steps:
30
+ - uses: actions/checkout@v5
31
+ - uses: dtolnay/rust-toolchain@stable
32
+ - uses: Swatinem/rust-cache@v2
33
+ - run: cargo test --release
34
+
35
+ python:
36
+ name: test (${{ matrix.os }}, py${{ matrix.python }})
37
+ runs-on: ${{ matrix.os }}
38
+ strategy:
39
+ fail-fast: false
40
+ matrix:
41
+ include:
42
+ - { os: ubuntu-latest, python: "3.10" }
43
+ - { os: ubuntu-latest, python: "3.14" }
44
+ - { os: macos-latest, python: "3.12" }
45
+ - { os: windows-latest, python: "3.12" }
46
+ steps:
47
+ - uses: actions/checkout@v5
48
+ - uses: actions/setup-python@v6
49
+ with:
50
+ python-version: ${{ matrix.python }}
51
+ - uses: dtolnay/rust-toolchain@stable
52
+ - uses: Swatinem/rust-cache@v2
53
+ - name: Build and install the wheel
54
+ shell: bash
55
+ run: |
56
+ python -m pip install --upgrade pip maturin pytest numpy
57
+ maturin build --release -o dist
58
+ python -m pip install dist/*.whl
59
+ - name: Test the installed wheel (not the source tree)
60
+ shell: bash
61
+ run: |
62
+ python -c "import clypso_chat, sys; assert 'site-packages' in clypso_chat.__file__, clypso_chat.__file__"
63
+ python -m pytest -q
64
+
65
+ wheels:
66
+ name: wheel (${{ matrix.target }})
67
+ runs-on: ${{ matrix.os }}
68
+ strategy:
69
+ fail-fast: false
70
+ matrix:
71
+ include:
72
+ - { os: ubuntu-latest, target: x86_64, manylinux: "2014" }
73
+ - { os: ubuntu-latest, target: aarch64, manylinux: "2_28" } # ring needs a newer cross gcc than 2014 has
74
+ - { os: macos-latest, target: aarch64-apple-darwin }
75
+ - { os: macos-latest, target: x86_64-apple-darwin }
76
+ - { os: windows-latest, target: x64 }
77
+ steps:
78
+ - uses: actions/checkout@v5
79
+ - uses: actions/setup-python@v6
80
+ with:
81
+ python-version: "3.12"
82
+ - uses: PyO3/maturin-action@v1
83
+ with:
84
+ target: ${{ matrix.target }}
85
+ manylinux: ${{ matrix.manylinux || 'auto' }}
86
+ args: --release --out dist
87
+ - uses: actions/upload-artifact@v4
88
+ with:
89
+ name: wheel-${{ matrix.target }}
90
+ path: dist/*.whl
91
+ if-no-files-found: error
92
+
93
+ sdist:
94
+ runs-on: ubuntu-latest
95
+ steps:
96
+ - uses: actions/checkout@v5
97
+ - uses: PyO3/maturin-action@v1
98
+ with:
99
+ command: sdist
100
+ args: --out dist
101
+ - uses: actions/upload-artifact@v4
102
+ with:
103
+ name: sdist
104
+ path: dist/*.tar.gz
105
+ if-no-files-found: error
106
+
107
+ check:
108
+ needs: [rust, python, wheels, sdist]
109
+ runs-on: ubuntu-latest
110
+ steps:
111
+ - uses: actions/checkout@v5
112
+ - uses: actions/download-artifact@v4
113
+ with:
114
+ path: dist
115
+ merge-multiple: true
116
+ - name: Metadata, and versions that agree with each other (and with the tag)
117
+ run: |
118
+ ls -l dist
119
+ pipx run twine check --strict dist/*
120
+ cargo_v=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)
121
+ py_v=$(sed -n 's/^version = "\(.*\)"/\1/p' pyproject.toml | head -1)
122
+ echo "Cargo.toml $cargo_v, pyproject.toml $py_v"
123
+ test "$cargo_v" = "$py_v"
124
+ if [[ "$GITHUB_REF" == refs/tags/v* ]]; then test "${GITHUB_REF#refs/tags/v}" = "$py_v"; fi
125
+ test "$(ls dist/*.whl | wc -l)" = 5 && test "$(ls dist/*.tar.gz | wc -l)" = 1
126
+ - uses: actions/upload-artifact@v4
127
+ with:
128
+ name: dist
129
+ path: dist/
130
+
131
+ release:
132
+ if: startsWith(github.ref, 'refs/tags/v')
133
+ needs: check
134
+ runs-on: ubuntu-latest
135
+ environment: pypi
136
+ permissions:
137
+ contents: write
138
+ id-token: write
139
+ steps:
140
+ - uses: actions/download-artifact@v4
141
+ with:
142
+ name: dist
143
+ path: dist
144
+ - name: GitHub Release with the files
145
+ env:
146
+ GH_TOKEN: ${{ github.token }}
147
+ run: gh release create "$GITHUB_REF_NAME" dist/* --repo "$GITHUB_REPOSITORY" --title "$GITHUB_REF_NAME" --generate-notes
148
+ - uses: pypa/gh-action-pypi-publish@release/v1
149
+
150
+ testpypi:
151
+ if: github.event_name == 'workflow_dispatch' && inputs.publish == 'testpypi'
152
+ needs: check
153
+ runs-on: ubuntu-latest
154
+ environment: testpypi
155
+ permissions:
156
+ id-token: write
157
+ steps:
158
+ - uses: actions/download-artifact@v4
159
+ with:
160
+ name: dist
161
+ path: dist
162
+ - uses: pypa/gh-action-pypi-publish@release/v1
163
+ with:
164
+ repository-url: https://test.pypi.org/legacy/
@@ -0,0 +1,6 @@
1
+ /target/
2
+ /.venv/
3
+ /dist/
4
+ __pycache__/
5
+ *.so
6
+ .pytest_cache/