diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 6debe89..ea977c2 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -20,7 +20,7 @@ jobs: strategy: matrix: target: [x86_64, x86, -# aarch64, armv7, s390x, ppc64le + # aarch64, armv7, s390x, ppc64le ] steps: - uses: actions/checkout@v3 @@ -29,10 +29,18 @@ jobs: - name: Git submodule init run: git submodule sync --recursive && git submodule update --init --force; ls -la evdev-rs/evdev-sys/libevdev + # install python & rust - uses: actions/setup-python@v4 with: python-version: 3.9 architecture: x64 + - uses: dtolnay/rust-toolchain@nightly + + # run tests + - name: Setup test dependencies + run: ./ci/prepare-ci-test.sh + - name: Test + run: source .env/bin/activate && ./test.sh - name: Build wheels uses: PyO3/maturin-action@v1 @@ -42,9 +50,7 @@ jobs: rust-toolchain: nightly sccache: 'true' manylinux: auto - before-script-linux: "./ci/prepare-ci.sh" - - name: foo - run: ls -la dist + before-script-linux: "./ci/prepare-ci-container.sh" - name: Upload wheels uses: actions/upload-artifact@v3 with: diff --git a/Cargo.lock b/Cargo.lock index 155af1f..f48c886 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -735,7 +735,7 @@ dependencies = [ [[package]] name = "map2" -version = "2.0.1" +version = "2.0.2" dependencies = [ "anyhow", "arc-swap", diff --git a/Cargo.toml b/Cargo.toml index 92ddeb1..778cc4e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,8 @@ edition = "2018" [features] integration = [] +extension-module = ["pyo3/extension-module"] +default = ["extension-module"] [lib] name = "map2" @@ -36,8 +38,7 @@ xdg = "2.2.0" atty = "0.2" indoc = "1.0" futures-intrusive = "0.4.0" -#pyo3 = { version = "0.20.0", extension-module = ["extension-module"], default = ["extension-module"] } -pyo3 = { version = "0.20.0", features = ["extension-module"] } +pyo3 = { version = "0.20.0" } pyo3-asyncio = { version = "0.20.0", features = ["attributes", "tokio-runtime", "testing"] } oneshot = "0.1.2" signal-hook = "0.3.17" diff --git a/ci/prepare-ci.sh b/ci/prepare-ci-container.sh similarity index 91% rename from ci/prepare-ci.sh rename to ci/prepare-ci-container.sh index 0af97c5..e55b36e 100755 --- a/ci/prepare-ci.sh +++ b/ci/prepare-ci-container.sh @@ -2,7 +2,6 @@ set -e -#rustup default nightly yum install -y libxkbcommon-devel diff --git a/ci/prepare-ci-test.sh b/ci/prepare-ci-test.sh new file mode 100755 index 0000000..fcbe143 --- /dev/null +++ b/ci/prepare-ci-test.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +sudo apt-get install -y libxkbcommon-dev + +python -m venv .env +source .env/bin/activate +pip install maturin \ No newline at end of file diff --git a/examples/hello_world.py b/examples/hello_world.py index 8622b6b..5736a3a 100644 --- a/examples/hello_world.py +++ b/examples/hello_world.py @@ -1,7 +1,7 @@ import map2 import time -map2.default(layout = "rabbit") +map2.default() writer = map2.Writer(capabilities = {"rel": True, "buttons": True}) diff --git a/test.sh b/test.sh index bcbc6ae..83b899c 100755 --- a/test.sh +++ b/test.sh @@ -2,4 +2,4 @@ set -e -cargo test --features integration +cargo test --no-default-features --features integration