Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: 0.14.3 #1796

Merged
merged 32 commits into from
Aug 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a212be8
Fixed broken link in async-await.md
Aug 9, 2021
3a3706e
guide: don't bother doctesting async guide
davidhewitt Aug 10, 2021
5a5a3af
changelog: fix missing PR number
davidhewitt Aug 11, 2021
74f4bfa
guide: allow using newer gh-actions-pages version
davidhewitt Aug 11, 2021
aef1637
Add documentation to call async python from rust
sansyrox Jun 13, 2021
4f4a718
ci: pin bitflags for MSRV job
davidhewitt Aug 11, 2021
62812f3
ffi: cleanup pystate
davidhewitt Aug 12, 2021
a162563
ffi: fix PyPy symbols for `cpython/pystate.rs`
davidhewitt Aug 13, 2021
b87a08a
examples: make `word-count` example comparison fairer
Aug 13, 2021
b0fed29
ffi: fix PyStatus._type
indygreg Aug 14, 2021
08f1068
Update CHANGELOG.md
davidhewitt Aug 14, 2021
a783a8d
macros: raise AttributeError on property deletion requests
indygreg Aug 11, 2021
1741a03
Update CHANGELOG.md
davidhewitt Aug 14, 2021
90acff4
ffi: define some cpython/unicodeobject bindings
indygreg Aug 10, 2021
1510855
ffi: move limited API unicode symbols to cpython/unicodeobject.rs
indygreg Aug 11, 2021
62181cc
ffi: PyPy and Python 3.10 attributes for unicodeobject
davidhewitt Aug 14, 2021
f2ebe82
string: enable use of PyUnicode_AsUTF8AndSize on all Python versions
indygreg Aug 14, 2021
dd156cf
Expand supported num-complex versions
mtreinish Aug 16, 2021
b48f4c9
Update Cargo.toml
mtreinish Aug 16, 2021
3bdcbfa
test macro hygiene for pyclass
mejrs Aug 16, 2021
f50a7a8
use macro to shadow
mejrs Aug 17, 2021
b4f1633
fix extends param
mejrs Aug 17, 2021
99e7fe8
remove shadowing
mejrs Aug 17, 2021
a85f3b4
fully disambiguate types
mejrs Aug 17, 2021
bbee0b2
Fix memory leak when calling Python from Rust
pschafhalter Aug 17, 2021
4fdd4ad
Edit changelog
pschafhalter Aug 17, 2021
b8e932b
Update changelog
pschafhalter Aug 18, 2021
8177535
Py_CompileString decref (#1810)
Ptrskay3 Aug 18, 2021
81fd23c
Use 'crate::' to refer to pyo3
tiran Aug 18, 2021
ee155ae
string: implement API to access raw string data
indygreg Aug 10, 2021
19ca9e7
build: document InterpreterConfig fields
indygreg Aug 14, 2021
5e53c4d
release: 0.14.3
davidhewitt Aug 15, 2021
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ jobs:
run: |
cargo update -p indexmap --precise 1.6.2
cargo update -p hashbrown:0.11.2 --precise 0.9.1
cargo update -p bitflags --precise 1.2.1

- name: Build docs
run: cargo doc --no-deps --no-default-features --features "${{ steps.settings.outputs.all_additive_features }}"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/guide.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:

- name: Deploy
if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'release' }}
uses: peaceiris/actions-gh-pages@v3.7.0-8
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./gh-pages-build/
Expand All @@ -71,7 +71,7 @@ jobs:
ln -sfT $TAG_NAME public/latest

- name: Deploy
uses: peaceiris/actions-gh-pages@v3.7.0-8
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public/
Expand Down
21 changes: 19 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,29 @@ PyO3 versions, please see the [migration guide](https://pyo3.rs/latest/migration
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [0.14.3] - 2021-08-22

### Added

- Add `PyString::data()` to access the raw bytes stored in a Python string. [#1794](https://github.com/PyO3/pyo3/issues/1794)

### Fixed

- Raise `AttributeError` to avoid panic when calling `del` on a `#[setter]` defined class property. [#1779](https://github.com/PyO3/pyo3/issues/1779)
- Restrict FFI definitions `PyGILState_Check` and `Py_tracefunc` to the unlimited API. [#1787](https://github.com/PyO3/pyo3/pull/1787)
- Add missing `_type` field to `PyStatus` struct definition. [#1791](https://github.com/PyO3/pyo3/pull/1791)
- Reduce lower bound `num-complex` optional dependency to support interop with `rust-numpy` and `ndarray` when building with the MSRV of 1.41 [#1799](https://github.com/PyO3/pyo3/pull/1799)
- Fix memory leak in `Python::run_code`. [#1806](https://github.com/PyO3/pyo3/pull/1806)
- Fix memory leak in `PyModule::from_code`. [#1810](https://github.com/PyO3/pyo3/pull/1810)
- Remove use of `pyo3::` in `pyo3::types::datetime` which broke builds using `-Z avoid-dev-deps` [#1811](https://github.com/PyO3/pyo3/issues/1811)

## [0.14.2] - 2021-08-09

### Added

- Add `indexmap` feature to add `ToPyObject`, `IntoPy` and `FromPyObject` implementations for `indexmap::IndexMap`. [#1728](https://github.com/PyO3/pyo3/pull/1728)
- Add `pyo3_build_config::add_extension_module_link_args()` to use in build scripts to set linker arguments (for macOS). [#1755](https://github.com/PyO3/pyo3/pull/1755)
- Add `Python::with_gil_unchecked()` unsafe variation of `Python::with_gil()` to allow obtaining a `Python` in scenarios where `Python::with_gil()` would fail.
- Add `Python::with_gil_unchecked()` unsafe variation of `Python::with_gil()` to allow obtaining a `Python` in scenarios where `Python::with_gil()` would fail. [#1769](https://github.com/PyO3/pyo3/pull/1769)

### Changed

Expand Down Expand Up @@ -880,7 +896,8 @@ Yanked

- Initial release

[unreleased]: https://github.com/pyo3/pyo3/compare/v0.14.1...HEAD
[unreleased]: https://github.com/pyo3/pyo3/compare/v0.14.3...HEAD
[0.14.3]: https://github.com/pyo3/pyo3/compare/v0.14.2...v0.14.3
[0.14.2]: https://github.com/pyo3/pyo3/compare/v0.14.1...v0.14.2
[0.14.1]: https://github.com/pyo3/pyo3/compare/v0.14.0...v0.14.1
[0.14.0]: https://github.com/pyo3/pyo3/compare/v0.13.2...v0.14.0
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pyo3"
version = "0.14.2"
version = "0.14.3"
description = "Bindings to Python interpreter"
authors = ["PyO3 Project and Contributors <https://github.com/PyO3>"]
readme = "README.md"
Expand All @@ -21,10 +21,10 @@ inventory = { version = "0.1.4", optional = true }
libc = "0.2.62"
parking_lot = "0.11.0"
num-bigint = { version = "0.4", optional = true }
num-complex = { version = "0.4", optional = true }
num-complex = { version = ">= 0.2, < 0.5", optional = true }
# must stay at 0.1.x for Rust 1.41 compatibility
paste = { version = "0.1.18", optional = true }
pyo3-macros = { path = "pyo3-macros", version = "=0.14.2", optional = true }
pyo3-macros = { path = "pyo3-macros", version = "=0.14.3", optional = true }
unindent = { version = "0.1.4", optional = true }
hashbrown = { version = ">= 0.9, < 0.12", optional = true }
indexmap = { version = ">= 1.6, < 1.8", optional = true }
Expand All @@ -42,7 +42,7 @@ pyo3 = { path = ".", default-features = false, features = ["macros", "auto-initi
serde_json = "1.0.61"

[build-dependencies]
pyo3-build-config = { path = "pyo3-build-config", version = "0.14.2" }
pyo3-build-config = { path = "pyo3-build-config", version = "0.14.3" }

[features]
default = ["macros"]
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ name = "string_sum"
crate-type = ["cdylib"]

[dependencies.pyo3]
version = "0.14.2"
version = "0.14.3"
features = ["extension-module"]
```

Expand Down Expand Up @@ -108,7 +108,7 @@ Start a new project with `cargo new` and add `pyo3` to the `Cargo.toml` like th

```toml
[dependencies.pyo3]
version = "0.14.2"
version = "0.14.3"
features = ["auto-initialize"]
```

Expand Down
24 changes: 2 additions & 22 deletions examples/word-count/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Source adopted from
// https://github.com/tildeio/helix-website/blob/master/crates/word_count/src/lib.rs

use pyo3::prelude::*;
use rayon::prelude::*;

Expand All @@ -24,28 +21,11 @@ fn search_sequential_allow_threads(py: Python, contents: &str, needle: &str) ->
py.allow_threads(|| search_sequential(contents, needle))
}

fn matches(word: &str, needle: &str) -> bool {
let mut needle = needle.chars();
for ch in word.chars().skip_while(|ch| !ch.is_alphabetic()) {
match needle.next() {
None => {
return !ch.is_alphabetic();
}
Some(expect) => {
if ch.to_lowercase().next() != Some(expect) {
return false;
}
}
}
}
needle.next().is_none()
}

/// Count the occurences of needle in line, case insensitive
/// Count the occurrences of needle in line, case insensitive
fn count_line(line: &str, needle: &str) -> usize {
let mut total = 0;
for word in line.split(' ') {
if matches(word, needle) {
if word == needle {
total += 1;
}
}
Expand Down
1 change: 0 additions & 1 deletion examples/word-count/tests/test_word_count.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from concurrent.futures import ThreadPoolExecutor

import pytest

import word_count


Expand Down
7 changes: 3 additions & 4 deletions examples/word-count/word_count/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
]


def search_py(contents, needle):
def search_py(contents: str, needle: str) -> int:
total = 0
for line in contents.split():
words = line.split(" ")
for word in words:
for line in contents.splitlines():
for word in line.split(" "):
if word == needle:
total += 1
return total
4 changes: 4 additions & 0 deletions guide/src/class.md
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,10 @@ impl MyClass {

In this case, the property `number` is defined and available from Python code as `self.number`.

Attributes defined by `#[setter]` or `#[pyo3(set)]` will always raise `AttributeError` on `del`
operations. Support for defining custom `del` behavior is tracked in
[#1778](https://github.com/PyO3/pyo3/issues/1778).

## Instance methods

To define a Python compatible method, an `impl` block for your struct has to be annotated with the
Expand Down
Loading