`pyo3_linter` needs updates following updates to `pyo3` and `pyo3_stub_gen`
@asaites is already working on this.
Since Jul 17, 2026.
Assessment
This issue has not been assessed yet.
Description
Since we updated pyo3 and pyo3_stub_gen, there are some rust code changes that the linter needs to learn about.
As an aside, pyo3_stub_gen now catches some of the issues that the linter does, and produces better stubs that enable stubgen to catch some additional issues that we previously needed to rely on the linter to pick up. It may be possible to remove some of those checks, reducing the amount of code we're maintaining for this purpose.
#[stubgen(skip)]
Right now, methods which are marked #[stubgen(skip)] result in an error akin to the following:
ERROR:pyo3_linter:We're probably missing this annotation: program/mod.rs Line(num=263, text='#[gen_stub(skip)]')
Correctly, the linter recognizes that it probably should know something about that annotation, but presently, it doesn't. Likely the right solution is to simply ignore it (within #[pymethod] blocks) and just assume that the method is annotated via another macro, or is intentionally omitted from the stubs.
Main Module Naming
The updated version of pyo3_stub_gen has better understanding now of the module structure, which in practice means we need to adjust the module = quil.$name annotations to module = quil._quil.$name. This was probably what should have been the case, but would have required explicit re-exports for each module. Now, pyo3_stub_gen generates those re-exports for us (which also means we've got correct __all__ in the stubs -- yay!). In any case, the linter had explicit handling for this work-around, but (once the rust code is updated), it won't be necessary (nor correct).
Multiple annotations in #[cfg_attr(...)]
With the newer version of pyo3 it sometimes makes sense to include additional derives on a #[pyclass]. When that's wrapped in a cfg_attr, the linter currently gets confused:
ERROR:pyo3_linter:We're probably missing this annotation: instruction/qubit.rs Line(num=10, text='#[cfg_attr( feature = "python", pyo3::pyclass(module = "quil._quil.instructions", eq, frozen, hash, ord, skip_from_py_object), derive(pyo3::FromPyObject), )]'
This should just be an update to the regex that captures these. As an educated guess, it may simply be that it doesn't account for the trailing comma.
- Dominant language
- Rust
- Stars
- 10
- Forks
- 2
- Avg merge
- 15h 56m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rigetti/rigetti-pyo3
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
rigetti/rigetti-pyo3#96 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
rigetti/rigetti-pyo3#73 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
rigetti/rigetti-pyo3#72 · 3 comments ·
-
`create_init_submodule!` should have some support for feature-gated items.May be free again @asaites claimed this 141 days ago, and no pull request is open. Open
rigetti/rigetti-pyo3#63 · 1 assignee ·
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
rigetti/rigetti-pyo3#59 ·
All issues in rigetti/rigetti-pyo3
Similar issues
-
chat compiler P1
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
HerringtonDarkholme/hd-lang#2793 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
security-advisory
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
MinBZK/regelrecht#2173 ·
-
ci
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
jonathanong/no-mistakes#5804 ·
-
triage: failed
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
oxc-project/tsrs#1277 · 1 comment ·
Maintainers usually reply within 1 day