Skip to content

Fix CI: examples import + missing async provenance tool - #8

Merged
Scottcjn merged 1 commit into
mainfrom
fix-ci-examples-import-and-async-provenance
Jul 6, 2026
Merged

Fix CI: examples import + missing async provenance tool#8
Scottcjn merged 1 commit into
mainfrom
fix-ci-examples-import-and-async-provenance

Conversation

@Scottcjn

@Scottcjn Scottcjn commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

CI on main has been failing for two independent reasons:

  1. tests/test_examples.py imports the top-level examples package, but examples/ is deliberately not part of the installed distribution (it's a runnable demo, not library code). In a clean pip install -e ".[test]" environment like CI's, the repo root is never on sys.path, so the import fails with ModuleNotFoundError: No module named 'examples'. This happened to pass on my own machine only because my shell sets an empty PYTHONPATH entry that puts cwd on the path — not something CI has. Fixed by adding pythonpath = ["."] under [tool.pytest.ini_options] in pyproject.toml, so pytest puts the repo root on sys.path itself, independent of the environment.
  2. test_async_tools_match_sync_tool_names failed because get_rustchain_tools (sync) got a rustchain_provenance tool when RIP-0310 support was added (commit 2406aa6), but get_async_rustchain_tools (async) never did — the async client didn't even have a provenance() method. Fixed by adding beacon_agents(), beacon_contracts() and provenance() to AsyncRustChainClient (async twins of the existing sync client methods) plus a matching _AsyncProvenanceTool, so the async tool surface actually mirrors the sync one, as the docstring already claimed.

Test plan

  • Reproduced both failures locally in a clean venv with PYTHONPATH unset, matching CI's pip install -e ".[test]" + pytest -q exactly.
  • After the fix, pytest -q passes with 33/33 on Python 3.11 and 3.12 in clean venvs.
  • No tests were skipped or deleted; the fix addresses the actual root causes (a packaging/sys.path gap and a genuinely missing async method).

CI on main was failing for two independent reasons.

1. tests/test_examples.py imports the top-level examples package, but
examples/ is intentionally not part of the installed distribution (it's
a runnable demo, not library code). In a clean pip install -e ".[test]"
env like CI's, the repo root is never on sys.path, so the import fails
with ModuleNotFoundError. This happened to work on my machine only
because my shell has an empty PYTHONPATH entry that puts cwd on the
path. Fixed by adding pythonpath = ["."] under [tool.pytest.ini_options]
in pyproject.toml, so pytest puts the repo root on sys.path itself
regardless of the environment it runs in.

2. test_async_tools_match_sync_tool_names failed because the sync tools
(get_rustchain_tools) got a rustchain_provenance tool when RIP-0310
support was added, but the async tools (get_async_rustchain_tools)
never did - the async client didn't even have a provenance() method.
Fixed by adding beacon_agents(), beacon_contracts() and provenance() to
AsyncRustChainClient (async twins of the sync client methods) and a
matching _AsyncProvenanceTool, so the async tool surface actually
mirrors the sync one like the docstring already claimed.

Verified locally with pytest -q in a clean venv (PYTHONPATH unset) on
Python 3.11 and 3.12, matching the CI workflow exactly: 33 passed.

Signed-off-by: Scott <scottbphone12@gmail.com>
@Scottcjn
Scottcjn merged commit d0dd518 into main Jul 6, 2026
6 checks passed
@Scottcjn
Scottcjn deleted the fix-ci-examples-import-and-async-provenance branch July 6, 2026 18:41
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.

2 participants