Skip to content

ci: lint bindings - #127

Merged
everoddandeven merged 2 commits into
libmonero:mainfrom
everoddandeven:ci/lint-bindings
Nov 7, 2026
Merged

everoddandeven merged 2 commits into
libmonero:mainfrom
everoddandeven:ci/lint-bindings

Conversation

@everoddandeven

Copy link
Copy Markdown
Member

No description provided.

everoddandeven and others added 2 commits November 7, 2026 03:17
…yment uri functions

pybind11-stubgen finds two things in the bindings of main:

* MoneroUtils.get_payment_uri and parse_payment_uri write the default of
  network_type in their signature as <MoneroNetworkType.MAINNET: 0>, the repr
  of the enum, which is not python and what help() shows. py::arg_v gives the
  default the text MoneroNetworkType.MAINNET.
* MoneroTxConfig.set_address has no py::arg, so its parameter is called arg0
  and the function can not be called with address=.

Both fixes give a clean run of the stubgen on a small module built like this
with the pybind11 of Ubuntu 24.04, the real module is built by CI.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
pybind11-stubgen was installed by the workflows and never used. It reads the
signatures that pybind11 writes in the docstrings of the module, so what it
can not make sense of is what is wrong with the bindings: a C++ type that
leaked into a docstring, a default value that is only a repr, a name that
does not resolve. Run on the module of main it found two of them, fixed in the
previous commit.

bin/lint_bindings.py runs it with --exit-code, counts a warning as an error,
and also fails on a public function with parameters that have no name
(arg0, arg1), a py::arg missing in the binding. The special methods are not
checked, pybind11 names those of the containers it binds itself, nor the
setters of the properties. The module has one such function, the one fixed
before.

It runs in the Linux job of Tests, right after the module is built and
before the nodes are started. The bindings are the same on every platform.
stubgen is pinned, a new version can report more.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@codacy-production

codacy-production Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 2 critical · 1 medium · 1 minor

Alerts:
⚠ 4 issues (≤ 0 issues of at least minor severity)

Results:
4 new issues

Category Results
Security 1 minor
2 critical
1 medium

View in Codacy

🟢 Metrics 23 complexity · 0 duplication

Metric Results
Complexity 23
Duplication 0

View in Codacy

🟢 Coverage ∅ diff coverage · +0.04% coverage variation

Metric Results
Coverage variation ✅ +0.04% coverage variation (-1.00%)
Diff coverage ✅ ∅ diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (b654878) 13868 13250 95.54%
Head commit (2ffebc5) 13868 (+0) 13255 (+5) 95.58% (+0.04%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#127) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@everoddandeven
everoddandeven merged commit ed1e4e4 into libmonero:main Nov 7, 2026
7 checks passed
@everoddandeven
everoddandeven deleted the ci/lint-bindings branch November 7, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant