Skip to content

Commit

Permalink
Merge pull request #134 from kushaldas/next_release_path
Browse files Browse the repository at this point in the history
Updates to 0.18.1 of pyo3
  • Loading branch information
kushaldas committed Mar 24, 2023
2 parents e247124 + c588da7 commit 6c7f7fb
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 22 deletions.
26 changes: 13 additions & 13 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "johnnycanencrypt"
version = "0.12.0"
version = "0.13.1"
authors = ["Kushal Das <[email protected]>"]
edition = "2018"
description = "Python module for OpenPGP."
Expand Down Expand Up @@ -32,5 +32,5 @@ sshkeys = "0.3.2"
regex = "1"

[dependencies.pyo3]
version = "0.17.3"
version = "0.18.1"

5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

## [unreleased]

## [0.13.1] - 2023-03-24

### Fixed

- Fixed #132 available_subkeys() method.

### Added

- Updated PyO3 dependency to 0.18.1.

## [0.13.0] - 2023-01-21

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
author = 'Kushal Das'

# The short X.Y version
version = '0.13.0'
version = '0.13.1'
# The full version, including alpha/beta/rc tags
release = '0.13.0'
release = '0.13.1'


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["setuptools", "wheel", "setuptools-rust"]

[project]
name = "johnnycanencrypt"
version = "0.13.0"
version = "0.13.1"
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)",
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name="johnnycanencrypt",
version="0.13.0",
version="0.13.1",
rust_extensions=[
RustExtension("johnnycanencrypt.johnnycanencrypt", binding=Binding.PyO3)
],
Expand Down
15 changes: 12 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,10 @@ pub fn decrypt_filehandler_on_card(
let p = P::new();

let filedata = fh.call_method(_py, "read", (), None)?;
let pbytes: &PyBytes = filedata.cast_as(_py).expect("Excepted bytes");
let pbytes: &PyBytes = filedata
.as_ref(_py)
.downcast::<PyBytes>()
.expect("Excepted bytes");
let data: Vec<u8> = Vec::from(pbytes.as_bytes());

let reader = std::io::BufReader::new(&data[..]);
Expand Down Expand Up @@ -2472,7 +2475,10 @@ fn encrypt_filehandler_to_file(
armor: Option<bool>,
) -> Result<bool> {
let data = fh.call_method(_py, "read", (), None)?;
let pbytes: &PyBytes = data.cast_as(_py).expect("Excepted bytes");
let pbytes: &PyBytes = data
.as_ref(_py)
.downcast::<PyBytes>()
.expect("Excepted bytes");
let filedata: Vec<u8> = Vec::from(pbytes.as_bytes());
encrypt_bytes_to_file(publickeys, filedata, output, armor)
}
Expand Down Expand Up @@ -2891,7 +2897,10 @@ impl Johnny {
let p = P::new();

let filedata = fh.call_method(_py, "read", (), None)?;
let pbytes: &PyBytes = filedata.cast_as(_py).expect("Excepted bytes");
let pbytes: &PyBytes = filedata
.as_ref(_py)
.downcast::<PyBytes>()
.expect("Excepted bytes");
let data: Vec<u8> = Vec::from(pbytes.as_bytes());

let reader = std::io::BufReader::new(&data[..]);
Expand Down

0 comments on commit 6c7f7fb

Please sign in to comment.