rslsqp 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,80 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ env:
10
+ CARGO_TERM_COLOR: always
11
+
12
+ jobs:
13
+ lint-rust:
14
+ name: Lint Rust
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v6
18
+
19
+ - uses: dtolnay/rust-toolchain@stable
20
+ with:
21
+ components: rustfmt, clippy
22
+
23
+ - uses: Swatinem/rust-cache@v2
24
+
25
+ - name: Check formatting
26
+ run: cargo fmt -- --check
27
+
28
+ - name: Clippy
29
+ run: cargo clippy -- -D warnings
30
+
31
+ test-rust:
32
+ name: Test Rust
33
+ runs-on: ubuntu-latest
34
+ steps:
35
+ - uses: actions/checkout@v6
36
+
37
+ - uses: dtolnay/rust-toolchain@stable
38
+
39
+ - uses: Swatinem/rust-cache@v2
40
+
41
+ - name: Run tests
42
+ run: cargo test
43
+
44
+ lint-python:
45
+ name: Lint Python
46
+ runs-on: ubuntu-latest
47
+ steps:
48
+ - uses: actions/checkout@v6
49
+
50
+ - uses: astral-sh/setup-uv@v7
51
+
52
+ - name: Check formatting
53
+ run: uv run ruff format --check src/rslsqp
54
+
55
+ - name: Lint
56
+ run: uv run ruff check src/rslsqp
57
+
58
+ - name: Type-check
59
+ run: uv run ty check src/rslsqp
60
+
61
+ test-python:
62
+ name: Test Python (${{ matrix.os }})
63
+ runs-on: ${{ matrix.os }}
64
+ strategy:
65
+ fail-fast: false
66
+ matrix:
67
+ os: [ubuntu-latest, macos-latest, windows-latest]
68
+ steps:
69
+ - uses: actions/checkout@v6
70
+
71
+ - uses: dtolnay/rust-toolchain@stable
72
+
73
+ - uses: Swatinem/rust-cache@v2
74
+
75
+ - uses: astral-sh/setup-uv@v7
76
+
77
+ - name: Build and test
78
+ run: |
79
+ uv run maturin develop
80
+ uv run pytest
@@ -0,0 +1,225 @@
1
+ name: Release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ version:
7
+ description: 'New version number to release (e.g., 0.2.0)'
8
+ required: true
9
+ type: string
10
+
11
+ permissions:
12
+ contents: write # Required for pushing commits, creating tags, and creating GitHub releases
13
+
14
+ jobs:
15
+ prepare-release:
16
+ name: Prepare Release & Git Tag
17
+ runs-on: ubuntu-latest
18
+ outputs:
19
+ version: ${{ steps.bump.outputs.version }}
20
+ steps:
21
+ - name: Checkout repository
22
+ uses: actions/checkout@v6
23
+ with:
24
+ fetch-depth: 0
25
+
26
+ - name: Set up Python
27
+ uses: actions/setup-python@v6
28
+ with:
29
+ python-version: '3.12'
30
+
31
+ - name: Bump version in configuration files
32
+ id: bump
33
+ run: |
34
+ python -c "
35
+ import re
36
+ version = '${{ inputs.version }}'
37
+
38
+ # 1. Update pyproject.toml
39
+ with open('pyproject.toml', 'r') as f:
40
+ content = f.read()
41
+ content = re.sub(r'(?<=^version = \")[^\"]+', version, content, count=1, flags=re.MULTILINE)
42
+ with open('pyproject.toml', 'w') as f:
43
+ f.write(content)
44
+
45
+ # 2. Update Cargo.toml
46
+ with open('Cargo.toml', 'r') as f:
47
+ content = f.read()
48
+ content = re.sub(r'(?<=^version = \")[^\"]+', version, content, count=1, flags=re.MULTILINE)
49
+ with open('Cargo.toml', 'w') as f:
50
+ f.write(content)
51
+ "
52
+ echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
53
+
54
+ - name: Commit and push changes
55
+ run: |
56
+ git config --global user.name "github-actions[bot]"
57
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
58
+ git add pyproject.toml Cargo.toml
59
+ if [ -n "$(git status --porcelain)" ]; then
60
+ git commit -m "chore: bump version to v${{ inputs.version }}"
61
+ git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git"
62
+ git push origin main
63
+ else
64
+ echo "No changes to commit (version is already set to ${{ inputs.version }})."
65
+ fi
66
+
67
+ - name: Create and push Git tag
68
+ run: |
69
+ if git rev-parse "v${{ inputs.version }}" >/dev/null 2>&1; then
70
+ echo "Tag v${{ inputs.version }} already exists. Force updating tag."
71
+ git tag -f "v${{ inputs.version }}"
72
+ git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git"
73
+ git push origin "v${{ inputs.version }}" --force
74
+ else
75
+ git tag "v${{ inputs.version }}"
76
+ git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git"
77
+ git push origin "v${{ inputs.version }}"
78
+ fi
79
+
80
+ - name: Create GitHub Release
81
+ env:
82
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83
+ run: |
84
+ gh release create "v${{ inputs.version }}" --title "v${{ inputs.version }}" --generate-notes || echo "Release already exists."
85
+
86
+ build-windows:
87
+ name: Build Wheels (Windows - x86_64)
88
+ runs-on: windows-latest
89
+ needs: prepare-release
90
+ steps:
91
+ - name: Checkout repository
92
+ uses: actions/checkout@v6
93
+ with:
94
+ ref: "v${{ needs.prepare-release.outputs.version }}"
95
+
96
+ - name: Download and extract precompiled OpenBLAS with LAPACK
97
+ run: |
98
+ curl.exe -L -o openblas.zip https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.28/OpenBLAS-0.3.28-x64.zip
99
+ Expand-Archive -Path openblas.zip -DestinationPath C:\openblas -Force
100
+ Copy-Item C:\openblas\libopenblas.lib C:\openblas\openblas.lib
101
+
102
+ - name: Build wheels using Maturin
103
+ uses: PyO3/maturin-action@v1
104
+ env:
105
+ # Tell Rust linker where to find static openblas and to link it statically
106
+ RUSTFLAGS: "-L C:\\openblas -l static=openblas"
107
+ with:
108
+ target: x86_64
109
+ args: --release --out dist --features blas
110
+ sccache: 'true'
111
+
112
+ - name: Upload wheels as artifact
113
+ uses: actions/upload-artifact@v7
114
+ with:
115
+ name: wheels-windows-x86_64
116
+ path: dist
117
+
118
+ build-linux:
119
+ name: Build Wheels (Linux - ${{ matrix.target }})
120
+ runs-on: ubuntu-latest
121
+ needs: prepare-release
122
+ strategy:
123
+ fail-fast: false
124
+ matrix:
125
+ target: [x86_64, aarch64]
126
+ steps:
127
+ - name: Checkout repository
128
+ uses: actions/checkout@v6
129
+ with:
130
+ ref: "v${{ needs.prepare-release.outputs.version }}"
131
+
132
+ - name: Set up QEMU for multi-architecture emulation
133
+ if: matrix.target == 'aarch64'
134
+ uses: docker/setup-qemu-action@v4
135
+
136
+ - name: Build wheels using Maturin (manylinux)
137
+ uses: PyO3/maturin-action@v1
138
+ with:
139
+ target: ${{ matrix.target }}
140
+ args: --release --out dist --features blas
141
+ sccache: 'true'
142
+ manylinux: auto
143
+ # Automatically install OpenBLAS package inside the manylinux build container
144
+ before-script-linux: |
145
+ if command -v yum &> /dev/null; then
146
+ yum install -y openblas-devel
147
+ elif command -v apk &> /dev/null; then
148
+ apk add openblas-dev
149
+ elif command -v apt-get &> /dev/null; then
150
+ apt-get update && apt-get install -y libopenblas-dev
151
+ fi
152
+
153
+ - name: Upload wheels as artifact
154
+ uses: actions/upload-artifact@v7
155
+ with:
156
+ name: wheels-linux-${{ matrix.target }}
157
+ path: dist
158
+
159
+ build-macos:
160
+ name: Build Wheels (macOS - ${{ matrix.target }})
161
+ runs-on: macos-latest
162
+ needs: prepare-release
163
+ strategy:
164
+ fail-fast: false
165
+ matrix:
166
+ target: [x86_64, aarch64]
167
+ steps:
168
+ - name: Checkout repository
169
+ uses: actions/checkout@v6
170
+ with:
171
+ ref: "v${{ needs.prepare-release.outputs.version }}"
172
+
173
+ - name: Build wheels using Maturin
174
+ uses: PyO3/maturin-action@v1
175
+ with:
176
+ target: ${{ matrix.target }}
177
+ args: --release --out dist --features blas
178
+ sccache: 'true'
179
+
180
+ - name: Upload wheels as artifact
181
+ uses: actions/upload-artifact@v7
182
+ with:
183
+ name: wheels-macos-${{ matrix.target }}
184
+ path: dist
185
+
186
+ build-sdist:
187
+ name: Build Source Distribution
188
+ runs-on: ubuntu-latest
189
+ needs: prepare-release
190
+ steps:
191
+ - name: Checkout repository
192
+ uses: actions/checkout@v6
193
+ with:
194
+ ref: "v${{ needs.prepare-release.outputs.version }}"
195
+
196
+ - name: Build source distribution using Maturin
197
+ uses: PyO3/maturin-action@v1
198
+ with:
199
+ command: sdist
200
+ args: --out dist
201
+
202
+ - name: Upload source distribution as artifact
203
+ uses: actions/upload-artifact@v7
204
+ with:
205
+ name: sdist
206
+ path: dist
207
+
208
+ publish:
209
+ name: Publish to PyPI
210
+ runs-on: ubuntu-latest
211
+ needs: [build-windows, build-linux, build-macos, build-sdist]
212
+ permissions:
213
+ id-token: write # Required for PyPI OIDC Trusted Publishing
214
+ steps:
215
+ - name: Download all build artifacts
216
+ uses: actions/download-artifact@v8
217
+ with:
218
+ pattern: '*'
219
+ path: dist
220
+ merge-multiple: true
221
+
222
+ - name: Publish all packages to PyPI
223
+ uses: pypa/gh-action-pypi-publish@release/v1
224
+ with:
225
+ packages-dir: dist/
@@ -0,0 +1,220 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ *.lcov
51
+ .hypothesis/
52
+ .pytest_cache/
53
+ cover/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ # Pipfile.lock
97
+
98
+ # UV
99
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
100
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
101
+ # commonly ignored for libraries.
102
+ # uv.lock
103
+
104
+ # poetry
105
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
106
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
107
+ # commonly ignored for libraries.
108
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
109
+ # poetry.lock
110
+ # poetry.toml
111
+
112
+ # pdm
113
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
114
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
115
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
116
+ # pdm.lock
117
+ # pdm.toml
118
+ .pdm-python
119
+ .pdm-build/
120
+
121
+ # pixi
122
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
123
+ # pixi.lock
124
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
125
+ # in the .venv directory. It is recommended not to include this directory in version control.
126
+ .pixi/*
127
+ !.pixi/config.toml
128
+
129
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
130
+ __pypackages__/
131
+
132
+ # Celery stuff
133
+ celerybeat-schedule*
134
+ celerybeat.pid
135
+
136
+ # Redis
137
+ *.rdb
138
+ *.aof
139
+ *.pid
140
+
141
+ # RabbitMQ
142
+ mnesia/
143
+ rabbitmq/
144
+ rabbitmq-data/
145
+
146
+ # ActiveMQ
147
+ activemq-data/
148
+
149
+ # SageMath parsed files
150
+ *.sage.py
151
+
152
+ # Environments
153
+ .env
154
+ .envrc
155
+ .venv
156
+ env/
157
+ venv/
158
+ ENV/
159
+ env.bak/
160
+ venv.bak/
161
+
162
+ # Spyder project settings
163
+ .spyderproject
164
+ .spyproject
165
+
166
+ # Rope project settings
167
+ .ropeproject
168
+
169
+ # mkdocs documentation
170
+ /site
171
+
172
+ # mypy
173
+ .mypy_cache/
174
+ .dmypy.json
175
+ dmypy.json
176
+
177
+ # Pyre type checker
178
+ .pyre/
179
+
180
+ # pytype static type analyzer
181
+ .pytype/
182
+
183
+ # Cython debug symbols
184
+ cython_debug/
185
+
186
+ # PyCharm
187
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
188
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
189
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
190
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
191
+ # .idea/
192
+
193
+ # Abstra
194
+ # Abstra is an AI-powered process automation framework.
195
+ # Ignore directories containing user credentials, local state, and settings.
196
+ # Learn more at https://abstra.io/docs
197
+ .abstra/
198
+
199
+ # Visual Studio Code
200
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
201
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
202
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
203
+ # you could uncomment the following to ignore the entire vscode folder
204
+ # .vscode/
205
+ # Temporary file for partial code execution
206
+ tempCodeRunnerFile.py
207
+
208
+ # Ruff stuff:
209
+ .ruff_cache/
210
+
211
+ # PyPI configuration file
212
+ .pypirc
213
+
214
+ # Marimo
215
+ marimo/_static/
216
+ marimo/_lsp/
217
+ __marimo__/
218
+
219
+ # Streamlit
220
+ .streamlit/secrets.toml
@@ -0,0 +1 @@
1
+ 3.12