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
14 changes: 5 additions & 9 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ jobs:
- beta
- nightly
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"

runs-on: ${{ matrix.os }}

Expand All @@ -44,7 +45,6 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64

- name: Restore cache
uses: Swatinem/rust-cache@v2
Expand All @@ -60,18 +60,14 @@ jobs:
uses: actions/checkout@v4

- name: Install Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
# MSRV as set in Cargo.toml
toolchain: 1.56.0
default: true
profile: minimal
toolchain: "1.63"

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

- name: Restore cache
uses: Swatinem/rust-cache@v2
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ keywords = ["pyo3", "python", "logging"]
categories = ["development-tools::debugging"]
edition = "2018"
license = "Apache-2.0 OR MIT"
rust-version = "1.56.0"
rust-version = "1.63"

# 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.4", default-features = false, features = ["std"] }
pyo3 = { version = ">=0.23, <0.25", default-features = false }
pyo3 = { version = ">=0.23, <0.26", default-features = false }

[dev-dependencies]
pyo3 = { version = ">=0.23, <0.25", default-features = false, features = ["auto-initialize", "macros"] }
pyo3 = { version = ">=0.23, <0.26", 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.
Expand Down
8 changes: 2 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ impl ResetHandle {
/// What the [`Logger`] can cache.
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
#[non_exhaustive]
#[derive(Default)]
pub enum Caching {
/// Disables caching.
///
Expand All @@ -234,15 +235,10 @@ pub enum Caching {
/// Therefore, once a `Logger` has been cached, it is possible to decide on the Rust side if a
/// message would get logged or not. If the message is not to be logged, no Python code is
/// called and the GIL doesn't have to be acquired.
#[default]
LoggersAndLevels,
}

impl Default for Caching {
fn default() -> Self {
Caching::LoggersAndLevels
}
}

#[derive(Debug)]
struct CacheEntry {
filter: LevelFilter,
Expand Down
Loading