Skip to content

Commit

Permalink
Fix running test on PyPy (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkaMaul authored Dec 11, 2024
1 parent a31282d commit 52e9b54
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- "3.11"
- "3.12"
- "3.13"
- "pypy"

runs-on: ${{ matrix.platform }}
steps:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Moved `maturin` dependency from main project dependencies to development dependencies
since it's only needed for development tasks ([88](https://github.com/trailofbits/rfc3161-client/pull/88))

### Fixed

- The project now correctly runs tests with PyPy
([89](https://github.com/trailofbits/rfc3161-client/pull/89))

## [0.1.1] - 2024-12-10

### Changed
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@ rand = "0.8.5"
cryptography-x509.workspace = true
openssl = { version = "0.10.68", features = ["vendored"] }

[build-dependencies]
pyo3-build-config = { version = "0.23.1", features = ["resolve-config"] }

[features]
extension-module = ["pyo3/extension-module"]
3 changes: 3 additions & 0 deletions rust/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
pyo3_build_config::use_pyo3_cfgs();
}
3 changes: 3 additions & 0 deletions rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,9 @@ mod _rust {
}
}

// We cannot run tests when used with PyPy because it lacks Py_Initialize
// https://github.com/pypy/pypy/issues/3836
#[cfg(not(PyPy))]
#[cfg(test)]
mod tests {
use super::OwnedTimeStampResp;
Expand Down

0 comments on commit 52e9b54

Please sign in to comment.