Skip to content

Add minimal CI pipeline#11

Merged
odesenfans merged 6 commits into
mainfrom
ci-pipeline
May 18, 2026
Merged

Add minimal CI pipeline#11
odesenfans merged 6 commits into
mainfrom
ci-pipeline

Conversation

@odesenfans
Copy link
Copy Markdown
Collaborator

Summary

  • Add .github/workflows/ci.yml running on push to main and on every PR. Lints with flake8, runs pytest against RabbitMQ + two alephim/p2p-service:0.1.5 containers (via tests/docker-compose.yml), and builds the wheel/sdist.
  • Pin the p2p-service image in tests/docker-compose.yml from :latest to :0.1.5 so local and CI runs use the same binary.
  • Fix test_dial_self to expect DialFailedException, matching the service's actual contract (self-dial returns HTTP 404, indistinguishable from any other unreachable peer).
  • Clean up pre-existing flake8 violations across src/ and tests/ so the new lint gate is green on first run.
  • Move flake8 and build into the testing extras so local dev and CI use the same tooling declaration.

Test plan

  • Workflow run on this PR completes green end-to-end.
  • `Wait for p2p-services to be ready` step completes in well under 60s.
  • `dist` artifact is produced and contains a `.whl` and a `.tar.gz`.

🤖 Generated with Claude Code

odesenfans and others added 6 commits May 18, 2026 21:13
Replace `alephim/p2p-service:latest` with `alephim/p2p-service:0.1.5`
in both service definitions so CI runs against a known-good, immutable
image rather than a floating tag that can change between runs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The p2p-service returns HTTP 404 for self-dial (the same status it uses
for any unreachable peer), with no discriminating information in the
response. The client therefore raises DialFailedException, not
DialWrongPeerException. Align the test with the service's actual
contract.
- Replace `from defaults import *` with explicit imports in
  client.py and tests/utils.py to satisfy F403/F405.
- Drop `f` prefix on f-strings without placeholders (F541).
- Break long lines to keep max_line_length = 88 (E501).
- Add missing blank lines before class definitions (E302).
- Ignore F401 in __init__.py since the unused imports there are
  intentional public-API re-exports.
Runs flake8, then pytest against rabbitmq + two alephim/p2p-service:0.1.5
containers spun up via tests/docker-compose.yml, then builds the package
and uploads the dist/ artifact. Triggers on push to main and on every PR.
- Make cancel-in-progress conditional on branch so back-to-back pushes
  to main don't cancel each other's runs (PR branches still cancel).
- Move flake8 and build into the testing extras so local devs running
  pip install -e '.[testing]' get the same tooling CI uses.
Add inline comments explaining (a) why F401 is suppressed for
__init__.py — flake8 cannot see public-API re-exports used by
external callers — and (b) why cancel-in-progress is conditional
on the branch — stale PR runs should be cancelled; pushes to main
should not.
@odesenfans odesenfans merged commit 3ec87d9 into main May 18, 2026
1 check passed
@odesenfans odesenfans deleted the ci-pipeline branch May 18, 2026 22:00
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