-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
2,106 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
on: | ||
push: | ||
tags: | ||
- 'accesskit_python-v*' | ||
|
||
name: Publish Python bindings | ||
|
||
env: | ||
MIN_PYTHON_VERSION: 3.9 | ||
|
||
jobs: | ||
macos-wheels: | ||
runs-on: macos-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
target: [x86_64, aarch64] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.MIN_PYTHON_VERSION }} | ||
- name: Build wheels | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
target: ${{ matrix.target }} | ||
args: --release --out dist | ||
sccache: 'true' | ||
- name: Test wheel installation | ||
if: matrix.target == 'x86_64' | ||
run: | | ||
pip install accesskit --no-index --find-links dist --force-reinstall | ||
python -c "import accesskit" | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels | ||
path: dist | ||
|
||
unix-wheels: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
target: [x86_64, x86, aarch64] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.MIN_PYTHON_VERSION }} | ||
- name: Build wheels | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
target: ${{ matrix.target }} | ||
args: --release --out dist | ||
sccache: 'true' | ||
manylinux: auto | ||
- name: Test wheel installation | ||
if: matrix.target == 'x86_64' | ||
run: | | ||
pip install accesskit --no-index --find-links dist --force-reinstall | ||
python -c "import accesskit" | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels | ||
path: dist | ||
|
||
windows-wheels: | ||
runs-on: windows-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
target: [x64, x86] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.MIN_PYTHON_VERSION }} | ||
architecture: ${{ matrix.target }} | ||
- name: Build wheels | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
target: ${{ matrix.target }} | ||
args: --release --out dist | ||
sccache: 'true' | ||
- name: Test wheel installation | ||
run: | | ||
pip install accesskit --no-index --find-links dist --force-reinstall | ||
python -c "import accesskit" | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels | ||
path: dist | ||
|
||
sdist: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build sdist | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
command: sdist | ||
args: --out dist | ||
- name: Upload sdist | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels | ||
path: dist | ||
|
||
pypi-release: | ||
name: Publish to PyPI | ||
environment: release | ||
permissions: | ||
id-token: write | ||
if: "startsWith(github.ref, 'refs/tags/')" | ||
needs: [macos-wheels, unix-wheels, windows-wheels, sdist] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: wheels | ||
- uses: PyO3/maturin-action@v1 | ||
with: | ||
command: upload | ||
args: --non-interactive --skip-existing * | ||
|
||
github-release: | ||
name: Add to GitHub release | ||
if: "startsWith(github.ref, 'refs/tags/')" | ||
needs: [macos-wheels, unix-wheels, windows-wheels, sdist] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: wheels | ||
path: dist | ||
|
||
- uses: AButler/[email protected] | ||
with: | ||
files: "dist/*" | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
release-tag: ${{ github.ref_name }} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[target.aarch64-apple-darwin] | ||
rustflags = [ | ||
"-C", "link-arg=-undefined", | ||
"-C", "link-arg=dynamic_lookup", | ||
] | ||
|
||
[target.x86_64-apple-darwin] | ||
rustflags = [ | ||
"-C", "link-arg=-undefined", | ||
"-C", "link-arg=dynamic_lookup", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[package] | ||
name = "accesskit_python" | ||
version = "0.1.0" | ||
authors = ["Arnold Loubriat <[email protected]>"] | ||
license = "MIT OR Apache-2.0" | ||
description = "Python bindings to the AccessKit library" | ||
readme = "README.md" | ||
publish = false | ||
edition = "2021" | ||
|
||
[lib] | ||
name = "accesskit" | ||
crate-type = ["cdylib"] | ||
doc = false | ||
|
||
[features] | ||
extension-module = ["pyo3/extension-module"] | ||
|
||
[dependencies] | ||
accesskit = { version = "0.12.1", path = "../../common", features = ["pyo3"] } | ||
pyo3 = { version = "0.20", features = ["abi3-py39", "multiple-pymethods"] } | ||
|
||
[target.'cfg(target_os = "windows")'.dependencies] | ||
accesskit_windows = { version = "0.15.1", path = "../../platforms/windows" } | ||
|
||
[target.'cfg(target_os = "macos")'.dependencies] | ||
accesskit_macos = { version = "0.10.1", path = "../../platforms/macos" } | ||
|
||
[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies] | ||
accesskit_unix = { version = "0.6.2", path = "../../platforms/unix" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# AccessKit | ||
|
||
These are the bindings to use AccessKit from Python. | ||
|
||
Documentation for the Rust packages can be found [here](https://docs.rs/accesskit/latest/accesskit/). | ||
|
||
An example program showing how to integrate AccessKit in a pygame application is available [here](https://github.com/AccessKit/accesskit/tree/main/bindings/python/examples/pygame). | ||
|
||
## Building from a Source Distribution | ||
|
||
If there are no wheels available for your platform, you will have to build one yourself. You will need to have Rust installed on your system, so that the native libraries can be compiled. Please visit [rustup.rs](https://rustup.rs) for instructions on how to proceed. | ||
|
||
## Building from within the repository | ||
|
||
This project uses [maturin](https://github.com/PyO3/maturin) as its build tool. If you need to manually build wheels for development purposes, it is recommended to install it inside a virtual environment. All maturin commands must be issued from this repository's root directory. |
Oops, something went wrong.