Bump MSRV to 1.56

This commit is contained in:
Adam Reichold 2023-06-04 10:29:24 +02:00 committed by David Hewitt
parent 6b85130078
commit 5738edfdd4
14 changed files with 22 additions and 24 deletions

View File

@ -3,10 +3,6 @@ xtask = "run --package xtask --"
[target.'cfg(feature = "cargo-clippy")'] [target.'cfg(feature = "cargo-clippy")']
rustflags = [ rustflags = [
# TODO: remove these allows once msrv increased from 1.48
"-Aclippy::iter_kv_map",
"-Aclippy::needless_borrow",
"-Aclippy::uninlined_format_args",
# Lints to enforce in CI # Lints to enforce in CI
"-Dclippy::checked_conversions", "-Dclippy::checked_conversions",
"-Dclippy::dbg_macro", "-Dclippy::dbg_macro",
@ -15,7 +11,6 @@ rustflags = [
"-Dclippy::filter_map_next", "-Dclippy::filter_map_next",
"-Dclippy::flat_map_option", "-Dclippy::flat_map_option",
"-Dclippy::let_unit_value", "-Dclippy::let_unit_value",
"-Dclippy::manual_assert",
"-Dclippy::manual_ok_or", "-Dclippy::manual_ok_or",
"-Dclippy::todo", "-Dclippy::todo",
"-Dclippy::unnecessary_wraps", "-Dclippy::unnecessary_wraps",

View File

@ -201,7 +201,3 @@ jobs:
# TODO: this is a hack to workaround compile_error! warnings about auto-initialize on PyPy # TODO: this is a hack to workaround compile_error! warnings about auto-initialize on PyPy
# Once cargo's `resolver = "2"` is stable (~ MSRV Rust 1.52), remove this. # Once cargo's `resolver = "2"` is stable (~ MSRV Rust 1.52), remove this.
PYO3_CI: 1 PYO3_CI: 1
# This is a hack to make CARGO_PRIMARY_PACKAGE always set even for the
# msrv job. MSRV is currently 1.48, but CARGO_PRIMARY_PACKAGE only came in
# 1.49.
CARGO_PRIMARY_PACKAGE: 1

View File

@ -81,7 +81,7 @@ jobs:
}, },
] ]
include: include:
- rust: 1.48.0 - rust: 1.56.0
python-version: "3.11" python-version: "3.11"
platform: platform:
{ {
@ -207,7 +207,7 @@ jobs:
] ]
include: include:
# Test minimal supported Rust version # Test minimal supported Rust version
- rust: 1.48.0 - rust: 1.56.0
python-version: "3.11" python-version: "3.11"
platform: platform:
{ {

View File

@ -12,6 +12,7 @@ categories = ["api-bindings", "development-tools::ffi"]
license = "Apache-2.0" license = "Apache-2.0"
exclude = ["/.gitignore", ".cargo/config", "/codecov.yml", "/Makefile", "/pyproject.toml", "/noxfile.py", "/.github", "/tests/test_compile_error.rs", "/tests/ui"] exclude = ["/.gitignore", ".cargo/config", "/codecov.yml", "/Makefile", "/pyproject.toml", "/noxfile.py", "/.github", "/tests/test_compile_error.rs", "/tests/ui"]
edition = "2018" edition = "2018"
rust-version = "1.56"
[dependencies] [dependencies]
cfg-if = "1.0" cfg-if = "1.0"

View File

@ -4,7 +4,7 @@
[![benchmark](https://github.com/PyO3/pyo3/actions/workflows/bench.yml/badge.svg)](https://pyo3.rs/dev/bench/) [![benchmark](https://github.com/PyO3/pyo3/actions/workflows/bench.yml/badge.svg)](https://pyo3.rs/dev/bench/)
[![codecov](https://codecov.io/gh/PyO3/pyo3/branch/main/graph/badge.svg)](https://codecov.io/gh/PyO3/pyo3) [![codecov](https://codecov.io/gh/PyO3/pyo3/branch/main/graph/badge.svg)](https://codecov.io/gh/PyO3/pyo3)
[![crates.io](https://img.shields.io/crates/v/pyo3)](https://crates.io/crates/pyo3) [![crates.io](https://img.shields.io/crates/v/pyo3)](https://crates.io/crates/pyo3)
[![minimum rustc 1.48](https://img.shields.io/badge/rustc-1.48+-blue.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html) [![minimum rustc 1.56](https://img.shields.io/badge/rustc-1.56+-blue.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html)
[![dev chat](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/PyO3/Lobby) [![dev chat](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/PyO3/Lobby)
[![contributing notes](https://img.shields.io/badge/contribute-on%20github-Green)](https://github.com/PyO3/pyo3/blob/main/Contributing.md) [![contributing notes](https://img.shields.io/badge/contribute-on%20github-Green)](https://github.com/PyO3/pyo3/blob/main/Contributing.md)
@ -18,7 +18,7 @@
PyO3 supports the following software versions: PyO3 supports the following software versions:
- Python 3.7 and up (CPython and PyPy) - Python 3.7 and up (CPython and PyPy)
- Rust 1.48 and up - Rust 1.56 and up
You can use PyO3 to write a native Python module in Rust, or to embed Python in a Rust binary. The following sections explain each of these in turn. You can use PyO3 to write a native Python module in Rust, or to embed Python in a Rust binary. The following sections explain each of these in turn.

View File

@ -10,5 +10,3 @@ classifiers = [
"Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy", "Programming Language :: Python :: Implementation :: PyPy",
] ]

View File

@ -4,7 +4,7 @@ To get started using PyO3 you will need three things: a Rust toolchain, a Python
## Rust ## Rust
First, make sure you have Rust installed on your system. If you haven't already done so, try following the instructions [here](https://www.rust-lang.org/tools/install). PyO3 runs on both the `stable` and `nightly` versions so you can choose whichever one fits you best. The minimum required Rust version is 1.48. First, make sure you have Rust installed on your system. If you haven't already done so, try following the instructions [here](https://www.rust-lang.org/tools/install). PyO3 runs on both the `stable` and `nightly` versions so you can choose whichever one fits you best. The minimum required Rust version is 1.56.
If you can run `rustc --version` and the version is new enough you're good to go! If you can run `rustc --version` and the version is new enough you're good to go!

View File

@ -3,6 +3,12 @@
This guide can help you upgrade code through breaking changes from one PyO3 version to the next. This guide can help you upgrade code through breaking changes from one PyO3 version to the next.
For a detailed list of all changes, see the [CHANGELOG](changelog.md). For a detailed list of all changes, see the [CHANGELOG](changelog.md).
## from 0.19.* to 0.20
### Drop support for older technologies
PyO3 0.20 has increased minimum Rust version to 1.56. This enables use of newer language features and simplifies maintenance of the project.
## from 0.18.* to 0.19 ## from 0.18.* to 0.19
### Access to `Python` inside `__traverse__` implementations are now forbidden ### Access to `Python` inside `__traverse__` implementations are now forbidden

View File

@ -0,0 +1 @@
Update MSRV to Rust 1.56.

View File

@ -14,7 +14,7 @@ Manual][capi] for up-to-date documentation.
PyO3 supports the following software versions: PyO3 supports the following software versions:
- Python 3.7 and up (CPython and PyPy) - Python 3.7 and up (CPython and PyPy)
- Rust 1.48 and up - Rust 1.56 and up
# Example: Building Python Native modules # Example: Building Python Native modules

View File

@ -51,7 +51,7 @@
//! //!
//! PyO3 supports the following software versions: //! PyO3 supports the following software versions:
//! - Python 3.7 and up (CPython and PyPy) //! - Python 3.7 and up (CPython and PyPy)
//! - Rust 1.48 and up //! - Rust 1.56 and up
//! //!
//! # Example: Building Python Native modules //! # Example: Building Python Native modules
//! //!

View File

@ -27,10 +27,11 @@ pub struct Signature {
impl Parse for Signature { impl Parse for Signature {
fn parse(input: ParseStream<'_>) -> syn::Result<Self> { fn parse(input: ParseStream<'_>) -> syn::Result<Self> {
let content; let content;
Ok(Signature { let paren_token = syn::parenthesized!(content in input);
paren_token: syn::parenthesized!(content in input),
items: content.parse_terminated(SignatureItem::parse)?, let items = content.parse_terminated(SignatureItem::parse)?;
})
Ok(Signature { paren_token, items })
} }
} }

View File

@ -122,7 +122,7 @@
//! //!
//! PyO3 supports the following software versions: //! PyO3 supports the following software versions:
//! - Python 3.7 and up (CPython and PyPy) //! - Python 3.7 and up (CPython and PyPy)
//! - Rust 1.48 and up //! - Rust 1.56 and up
//! //!
//! # Example: Building a native Python module //! # Example: Building a native Python module
//! //!

View File

@ -5,7 +5,7 @@ use std::process::{Command, Output};
use std::time::Instant; use std::time::Instant;
use structopt::StructOpt; use structopt::StructOpt;
pub const MSRV: &str = "1.48"; pub const MSRV: &str = "1.56";
#[derive(StructOpt)] #[derive(StructOpt)]
pub enum Subcommand { pub enum Subcommand {