Skip to content

Commit

Permalink
Merge pull request #24 from sandhose/quenting/wider-pyo3-range
Browse files Browse the repository at this point in the history
Make the pyo3 dependency accept older versions
  • Loading branch information
vorner authored Jan 31, 2023
2 parents f5683a1 + a44d223 commit 783ab18
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 3 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,40 @@ jobs:
- name: Build & test
run: cargo test --all-features

test-minimal-versions:
name: Build with the minimal supported versions
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
# MSRV as set in Cargo.toml
toolchain: 1.48.0
default: true
profile: minimal

- name: Install Python
uses: actions/setup-python@v2
with:
python-version: "3.7"
architecture: x64

- name: Restore cache
uses: Swatinem/rust-cache@v1

- name: Install the minimal versions of dependencies
env:
# `-Z minimal-versions` is unstable, so we set
# `RUSTC_BOOTSTRAP=1` to be able to use it on stable
RUSTC_BOOTSTRAP: "1"
run: cargo update -Z minimal-versions

- name: Build & test
run: cargo test --all-features

rustfmt:
name: Check formatting
runs-on: ubuntu-latest
Expand Down
11 changes: 8 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,19 @@ keywords = ["pyo3", "python", "logging"]
categories = ["development-tools::debugging"]
edition = "2018"
license = "Apache-2.0/MIT"
rust-version = "1.48.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
arc-swap = "~1"
# It's OK to ask for std on log, because pyo3 needs it too.
log = { version = "~0.4", default-features = false, features = ["std"] }
pyo3 = { version = "~0.18", default-features = false, features = ["macros"] }
log = { version = "~0.4.4", default-features = false, features = ["std"] }
pyo3 = { version = ">=0.14, <0.19", default-features = false }

[dev-dependencies]
pyo3 = { version = "0.18", features = ["auto-initialize"] }
pyo3 = { version = ">=0.14, <0.19", default-features = false, features = ["auto-initialize", "macros"] }

# `pyo3-macros` is lying about the minimal version for its `syn` dependency.
# Because we're testing with `-Zminimal-versions`, we need to explicitly set it here.
syn = "~1.0.13"

0 comments on commit 783ab18

Please sign in to comment.