Skip to content

Commit c7027df

Browse files
DanielePalaiaDanielePalaia
andauthored
Setup poetry project, checkers and simple testing action (#3)
* setup poetry project, checkers and simple testing action * adding basic test * refactor action --------- Co-authored-by: DanielePalaia <daniele985@@gmail.com>
1 parent a2e18e2 commit c7027df

File tree

10 files changed

+588
-2
lines changed

10 files changed

+588
-2
lines changed

.github/workflows/build-test.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Test against a RabbitMQ broker
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types:
9+
- opened
10+
- synchronize
11+
12+
jobs:
13+
ci:
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
python-version: [3.9]
18+
os: [ubuntu-22.04]
19+
runs-on: ${{ matrix.os }}
20+
services:
21+
rabbitmq-server:
22+
image: rabbitmq:4.0.3-management
23+
ports:
24+
- 5672:5672
25+
- 15672:15672
26+
steps:
27+
- uses: actions/checkout@v2
28+
- uses: actions/setup-python@v2
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
- name: Install and configure Poetry
32+
uses: snok/install-poetry@v1
33+
with:
34+
version: 1.4.2
35+
virtualenvs-create: true
36+
virtualenvs-in-project: false
37+
- name: Enable RabbitMQ Plugins
38+
run: docker exec ${{ job.services.rabbitmq-server.id }} rabbitmq-plugins enable rabbitmq_stream rabbitmq_stream_management rabbitmq_amqp1_0
39+
- name: poetry install
40+
run: poetry install --no-root
41+
- name: isort check-only
42+
run: poetry run isort --check-only .
43+
- name: black check
44+
run: poetry run black --check .
45+
- name: flake8
46+
run: poetry run flake8 --exclude=venv,local_tests,docs/examples --max-line-length=120 --ignore=E203,W503
47+
- name: mypy
48+
run: |
49+
poetry run mypy .
50+
- name: poetry run pytest
51+
run: poetry run pytest

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.idea/
2+
.vscode/
3+
.vim/
4+
5+
venv/
6+
dist/
7+
__pycache__/
8+
.coverage
9+
.mypy_cache/
10+
.pytest_cache/
11+
.pytype/
12+
*.pyc
13+
.env*
14+
15+
local*
16+
.githooks/
17+
.venv/

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1-
# rabbitmq-amqp-python-client
2-
Python RabbitMQ client for AMQP 1.0 protocol
1+
# RabbitMQ AMQP 1.0 Python Client
2+
3+
This library is in early stages of development. It is meant to be used with RabbitMQ 4.0.
4+
5+
## How to Run
6+
7+
## Getting Started
8+
9+

poetry.lock

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

pyproject.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[tool.poetry]
2+
name = "rabbitmq-amqp-python-client"
3+
version = "0.1.0"
4+
description = "Python RabbitMQ client for AMQP 1.0 protocol"
5+
authors = ["RabbitMQ team"]
6+
license = "Apache-2.0 license"
7+
readme = "README.md"
8+
9+
[tool.poetry.dependencies]
10+
python = "^3.9"
11+
python-qpid-proton = "^0.39.0"
12+
13+
[tool.poetry.dev-dependencies]
14+
flake8 = "^7.1.1"
15+
isort = "^5.9.3"
16+
mypy = "^0.910"
17+
pytest = "^7.4.0"
18+
black = "^23.12.1"
19+
python-qpid-proton = "^0.39.0"
20+
21+
[build-system]
22+
requires = ["poetry-core"]
23+
build-backend = "poetry.core.masonry.api"

rabbitmq_amqp_python_client/__init__.py

Whitespace-only changes.

rabbitmq_amqp_python_client/py.typed

Whitespace-only changes.

setup.cfg

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[isort]
2+
multi_line_output = 3
3+
line_length = 60
4+
include_trailing_comma = True
5+
skip = venv
6+
7+
8+
[flake8]
9+
exclude = .git, venv
10+
max-line-length = 120
11+
12+
[mypy]
13+
python_version = 3.9
14+
strict = True
15+
ignore_missing_imports = True
16+
17+
[mypy-tests.*]
18+
ignore_errors = True
19+
ignore_missing_imports = True

tests/__init__.py

Whitespace-only changes.

tests/test_connection.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from proton.utils import BlockingConnection
2+
3+
4+
# Temporary this will be replaced by our connection Deal when we start the implementation
5+
# For the moment we just need a test to run poetry run pytest without failing
6+
def test_connection() -> None:
7+
BlockingConnection("amqp://guest:guest@localhost:5672/")

0 commit comments

Comments
 (0)