Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions .github/workflows/python-package.yml

This file was deleted.

111 changes: 111 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Build and Publish Wheels

on:
pull_request:
push:
branches: [main]
tags: ["v*"]
release:
types: [published]
workflow_dispatch:

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
- os: windows-latest
- os: macos-14
- os: macos-15

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Build wheels
uses: pypa/cibuildwheel@v2.22.0
env:
CIBW_BUILD_VERBOSITY: "1"
CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*"
CIBW_SKIP: "*-musllinux_* pp* cp38-macosx_arm64"
CIBW_ARCHS_LINUX: "x86_64"
CIBW_ARCHS_WINDOWS: "AMD64"
CIBW_ARCHS_MACOS: "auto64"
CIBW_TEST_COMMAND: "python -c \"import seal; print(seal.__version__)\""
CIBW_BEFORE_BUILD: >
python -m pip install --upgrade pip cmake &&
cmake -S SEAL -B SEAL/build -DSEAL_USE_MSGSL=OFF -DSEAL_USE_ZLIB=OFF -DSEAL_USE_ZSTD=OFF &&
cmake --build SEAL/build --config Release &&
python -c "import glob; print('SEAL libs:', glob.glob('SEAL/build/**/*.lib', recursive=True)[:50])"

- name: Upload wheel artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: wheelhouse/*.whl

build_sdist:
name: Build sdist
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install build tools
run: python -m pip install --upgrade pip build cmake

- name: Build SEAL static libs
run: |
cmake -S SEAL -B SEAL/build -DSEAL_USE_MSGSL=OFF -DSEAL_USE_ZLIB=OFF -DSEAL_USE_ZSTD=OFF
cmake --build SEAL/build --config Release

- name: Build source distribution
run: python -m build --sdist

- name: Upload sdist artifact
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz

publish_pypi:
name: Publish to PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
permissions:
id-token: write
steps:
- name: Download wheel artifacts
uses: actions/download-artifact@v4
with:
path: dist
pattern: wheels-*
merge-multiple: true

- name: Download sdist artifact
uses: actions/download-artifact@v4
with:
path: dist
name: sdist

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ build
temp
.idea
*.bin
dist
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include README.md
include LICENSE
include seal.pyi
include py.typed
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ This is a python binding for the Microsoft SEAL library.
## Contents

* [Build](#build)
* [Typing](#typing)
* [Note](#note)
* [Serialize](#serialize)
* [Other](#other)
* [FAQ](#faq)
* [Release](#release)



Expand Down Expand Up @@ -163,6 +165,26 @@ This is a python binding for the Microsoft SEAL library.
2. Edit `extra_objects` in setup.py to `*.dylib` or else.


## Typing

This project now ships `seal.pyi` and `py.typed` for Python type checking (PEP 561).

After build/install, editors such as Pylance/Pyright/mypy can use these hints for autocomplete and static analysis.


## Release

Use `RELEASE.md` for the full PyPI release checklist.

Quick commands:

```bash
python3 setup.py sdist bdist_wheel
python3 -m twine check dist/*
python3 -m twine upload dist/*
```



## Contributing

Expand Down
46 changes: 46 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Release to PyPI

## 1. Build prerequisites

```bash
python3 -m pip install --upgrade pip build twine
git submodule update --init --recursive
cmake -S SEAL -B SEAL/build -DSEAL_USE_MSGSL=OFF -DSEAL_USE_ZLIB=OFF -DSEAL_USE_ZSTD=OFF
cmake --build SEAL/build
```

## 2. Build wheel and sdist

```bash
python3 setup.py sdist bdist_wheel
```

## 3. Validate artifacts

```bash
python3 -m twine check dist/*
```

## 4. Upload to TestPyPI (recommended first)

```bash
python3 -m twine upload --repository testpypi dist/*
```

## 5. Upload to PyPI

```bash
python3 -m twine upload dist/*
```

## 6. Post-upload smoke test

```bash
python3 -m venv /tmp/seal-publish-test
source /tmp/seal-publish-test/bin/activate
python -m pip install seal-python
python - <<'PY'
import seal
print("seal version:", seal.__version__)
PY
```
1 change: 1 addition & 0 deletions py.typed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading