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.19.1 #3288

Merged
merged 59 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
720893a
update PR template to detail state of licensing
davidhewitt Jun 2, 2023
4f5ee5f
Add `PyAny::lookup_special`
jakelishman May 31, 2023
8c11575
Fix `abi3` conversion of `__complex__` classes
jakelishman May 26, 2023
c035d31
Add abi3 + num_bigint conversion
youknowone Jun 2, 2023
955d686
remove copyright headers from source files
davidhewitt Jun 2, 2023
f28c280
run cargo check instead of clippy for MSRV in CI
davidhewitt Jun 4, 2023
d18e659
Drop usage of rustversion from xtask.
adamreichold Jun 5, 2023
96d026b
Remove sleeps between publishing as cargo will do that itself by now.
adamreichold Jun 5, 2023
0c541a6
Add Nox session to build docs providing a replace for doc xtask subco…
adamreichold Jun 5, 2023
da01669
Drop the xtask helper as it is superseded by Nox.
adamreichold Jun 5, 2023
8e42115
Add docs session to Nox's default session to more closely mirror the CI.
adamreichold Jun 5, 2023
b0279a7
add github merge queue support
davidhewitt Jun 4, 2023
1315c16
fix usage for paths-filter in merge_group
davidhewitt Jun 6, 2023
2dc5520
ci: add pypy3.10-nightly
davidhewitt Jun 7, 2023
29d303d
readme: add media June 2023
davidhewitt Jun 7, 2023
e545689
ci: enable full builds with a label
davidhewitt Jun 7, 2023
f0b0d26
ci: fail ffi-check on pypy failures
davidhewitt Jun 8, 2023
0cd1a52
fix pypy 3.10 ffi definitions
davidhewitt Jun 8, 2023
a96d7e7
ci: remove bors configuration
davidhewitt Jun 8, 2023
3983de7
ci: pool can be dirty from other threads
davidhewitt Jun 11, 2023
91a0166
Add `IpAddr` <-> `ipaddress.IPv(4/6)Address` conversion
mhils Jun 1, 2023
f775ca9
ci: add Python 3.12-dev jobs
davidhewitt Nov 22, 2022
098df7b
ci: allow failures in 3.12 builds for now
davidhewitt Jun 8, 2023
a38f923
ci: allow failure on 3.7 and pypy nightly
davidhewitt Jun 12, 2023
196c3df
rename examples package to fix dependabot
davidhewitt Jun 12, 2023
906a85c
Update bindgen requirement from 0.63.0 to 0.65.1
dependabot[bot] Jun 13, 2023
796b848
Add `PyFrozenSetBuilder`
adriangb Jun 13, 2023
6c86afe
bump maturin version in example files
davidhewitt Jun 14, 2023
8f01440
Extend guide section on classes regarding free functions
adamreichold Jun 15, 2023
605262f
Improve `PyModule::from_code` examples
lucatrv Jun 16, 2023
9ccca9f
Drop reference pool's dirty flag is the additional cost does not outw…
adamreichold Jun 17, 2023
e14961a
We already carefully handle re-entrancy for OWNED_OBJECTS, so let's a…
adamreichold Jun 17, 2023
bf2a193
Keep the dynamic borrow checking enabled for debug builds.
adamreichold Jun 18, 2023
44f308f
Add PyErr_GetRaisedException(), PyErr_SetRaisedException() to FFI
ijl Jun 16, 2023
2934db1
Replace unreachable! with empty enum match
mejrs Jun 19, 2023
4c232cb
Use `value` as argument name
mejrs Jun 19, 2023
6d79007
Update hashbrown requirement from >= 0.9, < 0.14 to >= 0.9, < 0.15
dependabot[bot] Jun 19, 2023
94a4744
Add changelog entry for bumping hashbrown dependency.
adamreichold Jun 20, 2023
cd5724c
Give a better error message for Python in traverse
mejrs Jun 19, 2023
7f0a983
Add Python::with_pool as a safer alternative to Python::new_pool.
adamreichold Jun 21, 2023
ae27b3b
Mark Python::with_pool as safe on stable.
adamreichold Jun 21, 2023
839c9a0
get all badges through shields.io
davidhewitt Jun 21, 2023
511003b
add http headers to help search engines index the docs
davidhewitt Jun 21, 2023
5da4305
add `PyDict::get_item_with_error` for PyPy
davidhewitt Jun 25, 2023
fbfa09f
refactor `PyDict::get_item[_with_error]` implementations
davidhewitt Jun 25, 2023
60e55bb
Our PR template still referenced the removed xtask infrastructure.
adamreichold Jun 25, 2023
c66f289
Add conversions between Rust Path/PathBuf and Python str / pathlib.Path
lucatrv Jun 25, 2023
1cc563e
Extended range of supported versions of `indexmap` optional dependenc…
adamreichold Jun 26, 2023
32587ec
stop suppressing unrelated exceptions in `PyAny::hasattr`
davidhewitt Jun 25, 2023
cd33b1c
move pyo3-ffi-check into its own workspace
davidhewitt Jun 26, 2023
0ba07db
use _run_cargo helper in noxfile
davidhewitt Jun 27, 2023
710a2dc
Fix typos and add punctuation recommended by grammarly in Class.md
CallMeMSL Jun 28, 2023
efea50b
clarify ownership of opt_to_pyobj helper function
davidhewitt Jun 28, 2023
1812274
Apparently, PySet_Add does not steal a reference, hence we should not…
adamreichold Jul 2, 2023
9f9be35
Allow `#[new]` to return existing instances
alex Jul 2, 2023
9151c96
support PyPy 3.10
davidhewitt Jul 3, 2023
5fb41a4
fixup minimal package versions for msrv
davidhewitt Jul 3, 2023
7b2d627
workaround msrv lint issue
davidhewitt Jul 3, 2023
dfe04e9
release: 0.19.1
davidhewitt Jul 3, 2023
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
3 changes: 0 additions & 3 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[alias]
xtask = "run --package xtask --"

[target.'cfg(feature = "cargo-clippy")']
rustflags = [
# TODO: remove these allows once msrv increased from 1.48
Expand Down
7 changes: 0 additions & 7 deletions .github/bors.toml

This file was deleted.

10 changes: 7 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
Thank you for contributing to pyo3!
Thank you for contributing to PyO3!

By submitting these contributions you agree for them to be licensed under PyO3's [Apache-2.0 license](https://github.com/PyO3/pyo3#license).

PyO3 is currently undergoing a relicensing process to match Rust's dual-license under `Apache-2.0` and `MIT` licenses. While that process is ongoing, if you are a first-time contributor please add your agreement as a comment in [#3108](https://github.com/PyO3/pyo3/pull/3108).

Please consider adding the following to your pull request:
- an entry for this PR in newsfragments - see [https://pyo3.rs/main/contributing.html#documenting-changes]
- docs to all new functions and / or detail in the guide
- tests for all new or changed functions

PyO3's CI pipeline will check your pull request. To run its tests
locally, you can run ```cargo xtask ci```. See its documentation
[here](https://github.com/PyO3/pyo3/tree/main/xtask#readme).
locally, you can run ```nox```. See ```nox --list-sessions```
for a list of supported actions.
11 changes: 7 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ on:

jobs:
build:
continue-on-error: ${{ contains(fromJSON('["3.7", "3.12-dev", "pypy3.7", "pypy3.10"]'), inputs.python-version) }}
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -122,9 +123,11 @@ jobs:

- uses: dorny/paths-filter@v2
# pypy 3.7 and 3.8 are not PEP 3123 compliant so fail checks here
if: ${{ inputs.rust == 'stable' && inputs.python-version != 'pypy-3.7' && inputs.python-version != 'pypy-3.8' }}
if: ${{ inputs.rust == 'stable' && inputs.python-version != 'pypy3.7' && inputs.python-version != 'pypy3.8' }}
id: ffi-changes
with:
base: ${{ github.event.pull_request.base.ref || github.event.merge_group.base_ref }}
ref: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }}
filters: |
changed:
- 'pyo3-ffi/**'
Expand All @@ -133,10 +136,10 @@ jobs:
- '.github/workflows/build.yml'

- name: Run pyo3-ffi-check
# pypy 3.7 and 3.8 are not PEP 3123 compliant so fail checks here, nor
# is pypy 3.9 on windows
if: ${{ steps.ffi-changes.outputs.changed == 'true' && inputs.rust == 'stable' && inputs.python-version != 'pypy3.7' && inputs.python-version != 'pypy3.8' && !(inputs.python-version == 'pypy3.9' && contains(inputs.os, 'windows')) }}
run: nox -s ffi-check
# Allow failure on PyPy for now
continue-on-error: ${{ startsWith(inputs.python-version, 'pypy') }}
if: ${{ steps.ffi-changes.outputs.changed == 'true' && inputs.rust == 'stable' && inputs.python-version != 'pypy-3.7' && inputs.python-version != 'pypy-3.8' }}


- name: Test cross compilation
Expand Down
58 changes: 36 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ on:
push:
branches:
- main
# for bors r+
- staging
# for bors try
- trying
pull_request:
merge_group:
types: [checks_requested]
workflow_dispatch:

concurrency:
Expand All @@ -34,6 +32,32 @@ jobs:
- name: Check rust formatting (rustfmt)
run: nox -s fmt-rust

check-msrv:
needs: [fmt]
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.48.0
targets: x86_64-unknown-linux-gnu
components: clippy,rust-src
- uses: actions/setup-python@v4
with:
architecture: "x64"
- uses: Swatinem/rust-cache@v2
with:
key: check-msrv-1.48.0
continue-on-error: true
- run: python -m pip install --upgrade pip && pip install nox
- name: Prepare minimal package versions
run: nox -s set-minimal-package-versions
- run: nox -s check-all

env:
CARGO_BUILD_TARGET: x86_64-unknown-linux-gnu

clippy:
needs: [fmt]
runs-on: ${{ matrix.platform.os }}
Expand Down Expand Up @@ -80,16 +104,6 @@ jobs:
rust-target: "i686-pc-windows-msvc",
},
]
include:
- rust: 1.48.0
python-version: "3.11"
platform:
{
os: "ubuntu-latest",
python-architecture: "x64",
rust-target: "x86_64-unknown-linux-gnu",
}
msrv: "MSRV"
name: clippy/${{ matrix.platform.rust-target }}/${{ matrix.rust }}
steps:
- uses: actions/checkout@v3
Expand All @@ -106,15 +120,12 @@ jobs:
key: clippy-${{ matrix.platform.rust-target }}-${{ matrix.platform.os }}-${{ matrix.rust }}
continue-on-error: true
- run: python -m pip install --upgrade pip && pip install nox
- if: matrix.msrv == 'MSRV'
name: Prepare minimal package versions (MSRV only)
run: nox -s set-minimal-package-versions
- run: nox -s clippy-all
env:
CARGO_BUILD_TARGET: ${{ matrix.platform.rust-target }}

build-pr:
if: github.event_name == 'pull_request'
if: ${{ !contains(github.event.pull_request.labels.*.name, 'CI-build-full') && github.event_name == 'pull_request' }}
name: python${{ matrix.python-version }}-${{ matrix.platform.python-architecture }} ${{ matrix.platform.os }} rust-${{ matrix.rust }}
needs: [fmt]
uses: ./.github/workflows/build.yml
Expand Down Expand Up @@ -158,7 +169,7 @@ jobs:
}
]
build-full:
if: ${{ github.event_name != 'pull_request' && github.ref != 'refs/heads/main' }}
if: ${{ contains(github.event.pull_request.labels.*.name, 'CI-build-full') || (github.event_name != 'pull_request' && github.ref != 'refs/heads/main') }}
name: python${{ matrix.python-version }}-${{ matrix.platform.python-architecture }} ${{ matrix.platform.os }} rust-${{ matrix.rust }}
needs: [fmt]
uses: ./.github/workflows/build.yml
Expand All @@ -183,9 +194,11 @@ jobs:
"3.9",
"3.10",
"3.11",
"pypy-3.7",
"pypy-3.8",
"pypy-3.9"
"3.12-dev",
"pypy3.7",
"pypy3.8",
"pypy3.9",
"pypy3.10",
]
platform:
[
Expand Down Expand Up @@ -353,6 +366,7 @@ jobs:
conclusion:
needs:
- fmt
- check-msrv
- clippy
- build-pr
- build-full
Expand Down
32 changes: 28 additions & 4 deletions .netlify/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,45 @@ mv pyo3-gh-pages netlify_build
## Configure netlify _redirects file

# Add redirect for each documented version
set +x # these loops get very spammy and fill the deploy log

for d in netlify_build/v*; do
version="${d/netlify_build\/v/}"
echo "/v$version/doc/* https://docs.rs/pyo3/$version/:splat" >> netlify_build/_redirects
if [ $version != $PYO3_VERSION ]; then
# for old versions, mark the files in the latest version as the canonical URL
for file in $(find $d -type f); do
file_path="${file/$d\//}"
# remove index.html and/or .html suffix to match the page URL on the
# final netlfiy site
url_path="$file_path"
if [[ $file_path == index.html ]]; then
url_path=""
elif [[ $file_path == *.html ]]; then
url_path="${file_path%.html}"
fi
echo "/v$version/$url_path" >> netlify_build/_headers
if test -f "netlify_build/v$PYO3_VERSION/$file_path"; then
echo " Link: <https://pyo3.rs/v$PYO3_VERSION/$url_path>; rel=\"canonical\"" >> netlify_build/_headers
else
# this file doesn't exist in the latest guide, don't index it
echo " X-Robots-Tag: noindex" >> netlify_build/_headers
fi
done
fi
done

# Add latest redirect
echo "/latest/* /v${PYO3_VERSION}/:splat" >> netlify_build/_redirects
echo "/latest/* /v${PYO3_VERSION}/:splat 302" >> netlify_build/_redirects

## Add landing page redirect
if [ "${CONTEXT}" == "deploy-preview" ]; then
echo "/ /main/" >> netlify_build/_redirects
else
echo "/ /v${PYO3_VERSION}/" >> netlify_build/_redirects
echo "/ /v${PYO3_VERSION}/ 302" >> netlify_build/_redirects
fi

set -x
## Generate towncrier release notes

pip install towncrier
Expand All @@ -53,15 +77,15 @@ mv target/guide netlify_build/main/

## Build public docs

cargo xtask doc
nox -s docs
mv target/doc netlify_build/main/doc/

echo "<meta http-equiv=refresh content=0;url=pyo3/>" > netlify_build/main/doc/index.html

## Build internal docs

echo "<div class='internal-banner' style='position:fixed; z-index: 99999; color:red;border:3px solid red;margin-left: auto; margin-right: auto; width: 430px;left:0;right: 0;'><div style='display: flex; align-items: center; justify-content: center;'> ⚠️ Internal Docs ⚠️ Not Public API 👉 <a href='https://pyo3.rs/main/doc/pyo3/index.html' style='color:red;text-decoration:underline;'>Official Docs Here</a></div></div>" > netlify_build/banner.html
RUSTDOCFLAGS="--html-before-content netlify_build/banner.html" cargo xtask doc --internal
RUSTDOCFLAGS="--html-before-content netlify_build/banner.html" nox -s docs -- nightly internal
rm netlify_build/banner.html

mkdir -p netlify_build/internal
Expand Down
28 changes: 27 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,31 @@ To see unreleased changes, please see the [CHANGELOG on the main branch guide](h

<!-- towncrier release notes start -->

## [0.19.1] - 2023-07-03

### Packaging

- Extend range of supported versions of `hashbrown` optional dependency to include version 0.14 [#3258](https://github.com/PyO3/pyo3/pull/3258)
- Extend range of supported versions of `indexmap` optional dependency to include version 2. [#3277](https://github.com/PyO3/pyo3/pull/3277)
- Support PyPy 3.10. [#3289](https://github.com/PyO3/pyo3/pull/3289)

### Added

- Add `pyo3::types::PyFrozenSetBuilder` to allow building a `PyFrozenSet` item by item. [#3156](https://github.com/PyO3/pyo3/pull/3156)
- Add support for converting to and from Python's `ipaddress.IPv4Address`/`ipaddress.IPv6Address` and `std::net::IpAddr`. [#3197](https://github.com/PyO3/pyo3/pull/3197)
- Add support for `num-bigint` feature in combination with `abi3`. [#3198](https://github.com/PyO3/pyo3/pull/3198)
- Add `PyErr_GetRaisedException()`, `PyErr_SetRaisedException()` to FFI definitions for Python 3.12 and later. [#3248](https://github.com/PyO3/pyo3/pull/3248)
- Add `Python::with_pool` which is a safer but more limited alternative to `Python::new_pool`. [#3263](https://github.com/PyO3/pyo3/pull/3263)
- Add `PyDict::get_item_with_error` on PyPy. [#3270](https://github.com/PyO3/pyo3/pull/3270)
- Allow `#[new]` methods may to return `Py<Self>` in order to return existing instances. [#3287](https://github.com/PyO3/pyo3/pull/3287)

### Fixed

- Fix conversion of classes implementing `__complex__` to `Complex` when using `abi3` or PyPy. [#3185](https://github.com/PyO3/pyo3/pull/3185)
- Stop suppressing unrelated exceptions in `PyAny::hasattr`. [#3271](https://github.com/PyO3/pyo3/pull/3271)
- Fix memory leak when creating `PySet` or `PyFrozenSet` or returning types converted into these internally, e.g. `HashSet` or `BTreeSet`. [#3286](https://github.com/PyO3/pyo3/pull/3286)


## [0.19.0] - 2023-05-31

### Packaging
Expand Down Expand Up @@ -1478,7 +1503,8 @@ Yanked

- Initial release

[Unreleased]: https://github.com/pyo3/pyo3/compare/v0.19.0...HEAD
[Unreleased]: https://github.com/pyo3/pyo3/compare/v0.19.1...HEAD
[0.19.1]: https://github.com/pyo3/pyo3/compare/v0.19.0...v0.19.1
[0.19.0]: https://github.com/pyo3/pyo3/compare/v0.18.3...v0.19.0
[0.18.3]: https://github.com/pyo3/pyo3/compare/v0.18.2...v0.18.3
[0.18.2]: https://github.com/pyo3/pyo3/compare/v0.18.1...v0.18.2
Expand Down
15 changes: 6 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pyo3"
version = "0.19.0"
version = "0.19.1"
description = "Bindings to Python interpreter"
authors = ["PyO3 Project and Contributors <https://github.com/PyO3>"]
readme = "README.md"
Expand All @@ -20,10 +20,10 @@ parking_lot = ">= 0.11, < 0.13"
memoffset = "0.9"

# ffi bindings to the python interpreter, split into a separate crate so they can be used independently
pyo3-ffi = { path = "pyo3-ffi", version = "=0.19.0" }
pyo3-ffi = { path = "pyo3-ffi", version = "=0.19.1" }

# support crates for macros feature
pyo3-macros = { path = "pyo3-macros", version = "=0.19.0", optional = true }
pyo3-macros = { path = "pyo3-macros", version = "=0.19.1", optional = true }
indoc = { version = "1.0.3", optional = true }
unindent = { version = "0.1.4", optional = true }

Expand All @@ -34,8 +34,8 @@ inventory = { version = "0.3.0", optional = true }
anyhow = { version = "1.0", optional = true }
chrono = { version = "0.4", default-features = false, optional = true }
eyre = { version = ">= 0.4, < 0.7", optional = true }
hashbrown = { version = ">= 0.9, < 0.14", optional = true }
indexmap = { version = "1.6", optional = true }
hashbrown = { version = ">= 0.9, < 0.15", optional = true }
indexmap = { version = ">= 1.6, < 3", optional = true }
num-bigint = { version = "0.4", optional = true }
num-complex = { version = ">= 0.2, < 0.5", optional = true }
rust_decimal = { version = "1.0.0", default-features = false, optional = true }
Expand All @@ -58,7 +58,7 @@ rust_decimal = { version = "1.8.0", features = ["std"] }
widestring = "0.5.1"

[build-dependencies]
pyo3-build-config = { path = "pyo3-build-config", version = "0.19.0", features = ["resolve-config"] }
pyo3-build-config = { path = "pyo3-build-config", version = "0.19.1", features = ["resolve-config"] }

[features]
default = ["macros"]
Expand Down Expand Up @@ -176,14 +176,11 @@ harness = false
[workspace]
members = [
"pyo3-ffi",
"pyo3-ffi-check",
"pyo3-ffi-check/macro",
"pyo3-build-config",
"pyo3-macros",
"pyo3-macros-backend",
"pytests",
"examples",
"xtask"
]

[package.metadata.docs.rs]
Expand Down
10 changes: 6 additions & 4 deletions Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ There are some specific areas of focus where help is currently needed for the do
You can build the docs (including all features) with

```shell
cargo xtask doc --open
nox -s docs -- open
```

#### Doctests
Expand Down Expand Up @@ -95,8 +95,10 @@ Tests run with all supported Python versions with the latest stable Rust compile
If you are adding a new feature, you should add it to the `full` feature in our *Cargo.toml** so that it is tested in CI.

You can run these tests yourself with
```cargo xtask ci```
See [its documentation](https://github.com/PyO3/pyo3/tree/main/xtask#readme) for more commands you can run.
```nox```
and
```nox -l```
lists further commands you can run.

### Documenting changes

Expand Down Expand Up @@ -145,7 +147,7 @@ You can view what code is and isn't covered by PyO3's tests. We aim to have 100%

- First, generate a `lcov.info` file with
```shell
cargo xtask coverage
nox -s coverage
```
You can install an IDE plugin to view the coverage. For example, if you use VSCode:
- Add the [coverage-gutters](https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters) plugin.
Expand Down
Loading