Skip to content

Commit 448ae2a

Browse files
davidhewittlazka
andauthored
ci: updates for Rust 1.91, pin rumdl (#5576)
* ci: updates for Rust 1.91 * ci: fix fmt * ci: pin rumdl * fix `ruff` version inference --------- Co-authored-by: Christoph Reiter <[email protected]>
1 parent 493dd86 commit 448ae2a

File tree

7 files changed

+75
-7
lines changed

7 files changed

+75
-7
lines changed

guide/src/class/protocols.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ The given signatures should be interpreted as follows:
133133
134134
- `__getattr__(<self>, object) -> object`
135135
- `__getattribute__(<self>, object) -> object`
136+
136137
<details>
137138
<summary>Differences between `__getattr__` and `__getattribute__`</summary>
138139
As in Python, `__getattr__` is only called if the attribute is not found

noxfile.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,15 @@ def ruff(session: nox.Session):
202202
_run(session, "ruff", "check", ".")
203203

204204

205-
@nox.session(name="rumdl")
205+
@nox.session(name="rumdl", venv_backend="none")
206206
def rumdl(session: nox.Session):
207207
"""Run rumdl to check markdown formatting in the guide.
208208
209-
Can also run with uv directly, e.g. `uvx rumdl check guide`.
209+
Can also run with uv directly, e.g. `uv run rumdl check guide`.
210210
"""
211-
session.install("rumdl")
212-
_run(session, "rumdl", "check", "guide", *session.posargs)
211+
_run(
212+
session, "uv", "run", "rumdl", "check", "guide", *session.posargs, external=True
213+
)
213214

214215

215216
@nox.session(name="clippy", venv_backend="none")

pyproject.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
[project]
2+
requires-python = ">=3.7"
3+
name = "pyo3"
4+
dynamic = ["version"]
5+
6+
[tool.ruff.per-file-target-version]
7+
# experimental-inspect generates .pyi files that use positional-only `/` marker
8+
"*.pyi" = "py38"
9+
# uses `match` statement
10+
"pytests/tests/test_enums_match.py" = "py310"
11+
112
[tool.ruff.lint.extend-per-file-ignores]
213
"__init__.py" = ["F403"]
314

@@ -53,3 +64,11 @@ tables = false
5364
headings = false
5465
reflow = true
5566
reflow_mode = "sentence-per-line"
67+
68+
[tool.uv]
69+
package = false
70+
71+
[dependency-groups]
72+
dev = [
73+
"rumdl"
74+
]

tests/ui/invalid_pyfunction_argument.stderr

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,13 @@ error[E0277]: `Foo` cannot be used as a Python function argument
7070
--> tests/ui/invalid_pyfunction_argument.rs:14:59
7171
|
7272
14 | fn skip_from_py_object_without_custom_from_py_object(arg: Foo) {
73-
| ^^^ the trait `ExtractPyClassWithClone` is not implemented for `Foo`
73+
| ^^^ unsatisfied trait bound
7474
|
75+
help: the trait `ExtractPyClassWithClone` is not implemented for `Foo`
76+
--> tests/ui/invalid_pyfunction_argument.rs:11:1
77+
|
78+
11 | struct Foo;
79+
| ^^^^^^^^^^
7580
= note: implement `FromPyObject` to enable using `Foo` as a function argument
7681
= note: `Python<'py>` is also a valid argument type to pass the Python token into `#[pyfunction]`s and `#[pymethods]`
7782
= help: the following other types implement trait `PyFunctionArgument<'a, 'holder, 'py, IMPLEMENTS_FROMPYOBJECT>`:

tests/ui/invalid_pymethods.stderr

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,11 @@ error[E0277]: the trait bound `NotATypeObject: From<BoundRef<'_, '_, PyType>>` i
201201
--> tests/ui/invalid_pymethods.rs:33:45
202202
|
203203
33 | fn classmethod_wrong_first_argument(_t: NotATypeObject) -> Self {
204-
| ^^^^^^^^^^^^^^ the trait `From<BoundRef<'_, '_, PyType>>` is not implemented for `NotATypeObject`
204+
| ^^^^^^^^^^^^^^ unsatisfied trait bound
205205
|
206+
help: the trait `From<BoundRef<'_, '_, PyType>>` is not implemented for `NotATypeObject`
207+
--> tests/ui/invalid_pymethods.rs:28:1
208+
|
209+
28 | struct NotATypeObject;
210+
| ^^^^^^^^^^^^^^^^^^^^^
206211
= note: required for `BoundRef<'_, '_, PyType>` to implement `Into<NotATypeObject>`

tests/ui/missing_intopy.stderr

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@ error[E0277]: `Blah` cannot be converted to a Python object
22
--> tests/ui/missing_intopy.rs:4:14
33
|
44
4 | fn blah() -> Blah {
5-
| ^^^^ the trait `IntoPyObject<'_>` is not implemented for `Blah`
5+
| ^^^^ unsatisfied trait bound
66
|
7+
help: the trait `IntoPyObject<'_>` is not implemented for `Blah`
8+
--> tests/ui/missing_intopy.rs:1:1
9+
|
10+
1 | struct Blah;
11+
| ^^^^^^^^^^^
712
= note: `IntoPyObject` is automatically implemented by the `#[pyclass]` macro
813
= note: if you do not wish to have a corresponding Python type, implement it manually
914
= note: if you do not own `Blah` you can perform a manual conversion to one of the types in `pyo3::types::*`

uv.lock

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)