Skip to content

Commit

Permalink
ci: fix nightly build (#4517)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt authored Sep 3, 2024
1 parent 454529d commit d0faf53
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions pyo3-build-config/src/impl_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1059,8 +1059,9 @@ impl FromStr for BuildFlag {
}
}

/// A list of python interpreter compile-time preprocessor defines that
/// we will pick up and pass to rustc via `--cfg=py_sys_config={varname}`;
/// A list of python interpreter compile-time preprocessor defines.
///
/// PyO3 will pick these up and pass to rustc via `--cfg=py_sys_config={varname}`;
/// this allows using them conditional cfg attributes in the .rs files, so
///
/// ```rust
Expand Down
2 changes: 1 addition & 1 deletion pyo3-macros-backend/src/pymethod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ pub fn impl_py_getter_def(
}

/// Split an argument of pyo3::Python from the front of the arg list, if present
fn split_off_python_arg<'a>(args: &'a [FnArg<'a>]) -> (Option<&PyArg<'_>>, &[FnArg<'_>]) {
fn split_off_python_arg<'a, 'b>(args: &'a [FnArg<'b>]) -> (Option<&'a PyArg<'b>>, &'a [FnArg<'b>]) {
match args {
[FnArg::Py(py), args @ ..] => (Some(py), args),
args => (None, args),
Expand Down
8 changes: 4 additions & 4 deletions src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@
///
/// [`Python::version`]: crate::marker::Python::version
#[derive(Debug)]
pub struct PythonVersionInfo<'py> {
pub struct PythonVersionInfo<'a> {
/// Python major version (e.g. `3`).
pub major: u8,
/// Python minor version (e.g. `11`).
pub minor: u8,
/// Python patch version (e.g. `0`).
pub patch: u8,
/// Python version suffix, if applicable (e.g. `a0`).
pub suffix: Option<&'py str>,
pub suffix: Option<&'a str>,
}

impl<'py> PythonVersionInfo<'py> {
impl<'a> PythonVersionInfo<'a> {
/// Parses a hard-coded Python interpreter version string (e.g. 3.9.0a4+).
pub(crate) fn from_str(version_number_str: &'py str) -> Result<Self, &str> {
pub(crate) fn from_str(version_number_str: &'a str) -> Result<PythonVersionInfo<'a>, &'a str> {
fn split_and_parse_number(version_part: &str) -> (u8, Option<&str>) {
match version_part.find(|c: char| !c.is_ascii_digit()) {
None => (version_part.parse().unwrap(), None),
Expand Down

0 comments on commit d0faf53

Please sign in to comment.