From bda87d5a7fbb83a945ab1e5436889afd3383e0c2 Mon Sep 17 00:00:00 2001 From: shiro Date: Tue, 21 Nov 2023 16:16:55 +0900 Subject: [PATCH] Try to make tests work in CI --- .github/workflows/CI.yml | 8 ++++++-- Cargo.lock | 2 +- Cargo.toml | 5 +++-- examples/hello_world.py | 2 +- test.sh | 2 +- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 6debe89..aaf18be 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -34,6 +34,12 @@ jobs: python-version: 3.9 architecture: x64 + - uses: dtolnay/rust-toolchain@nightly + - name: Setup test dependencies + run: sudo apt-get install -y libxkbcommon-dev && python -m venv .env && source .env/bin/activate && pip install maturin + - name: Test + run: source .env/bin/activate && ./test.sh + - name: Build wheels uses: PyO3/maturin-action@v1 with: @@ -43,8 +49,6 @@ jobs: sccache: 'true' manylinux: auto before-script-linux: "./ci/prepare-ci.sh" - - name: foo - run: ls -la dist - 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/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