Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[run]
omit =
tests/*
servc/com/bus/rabbitmq/rpc.py
tests/*
4 changes: 2 additions & 2 deletions .github/workflows/version.yml → .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: 'Changelong'
name: 'Package Publish'
on:
- push

jobs:
version:
packagepublish:
runs-on: ubuntu-latest
steps:
- uses: https://git.yusufali.ca/actions/commit@main
Expand Down
51 changes: 49 additions & 2 deletions .github/workflows/servc.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,58 @@
name: 'Serv-C Unit Test'
on:
- push
- pull_request

jobs:
servc:
runs-on: ubuntu-latest

strategy:
matrix:
python-version:
- 3.13

services:
rabbitmq:
image: rabbitmq:3
env:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
ports:
- 5672/tcp

redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379/tcp

steps:
- if: github.server_url != 'https://github.com'
run: sleep 20s

- uses: actions/checkout@v4
with:
submodules: true

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: pip install -r requirements.txt

- name: Set Environment Variables
run: |
echo "CURRENT_PATH=$(pwd)" >> $GITHUB_ENV
echo "CACHE_URL=redis://redis" >> $GITHUB_ENV
echo "BUS_URL=amqp://guest:guest@rabbitmq" >> $GITHUB_ENV
chmod +x start.sh

- name: Run Servc Tests
uses: serv-c/docs@0.2.12
uses: serv-c/docs@0.2.14
with:
startcmd: ${{ env.CURRENT_PATH }}/start.sh
29 changes: 6 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,6 @@ jobs:
ports:
- 6379/tcp

postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432/tcp

steps:
- if: github.server_url != 'https://github.com'
run: sleep 20s
Expand All @@ -54,14 +41,11 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Lint
- name: Type check
run: |
pip install isort black flake8 coverage
isort servc
black servc
flake8 --ignore=E501,W503 servc
git status
git diff --exit-code servc
pip install mypy
pip install types-PyYAML types-simplejson types-redis
mypy servc

- name: Install dependencies
run: |
Expand All @@ -76,10 +60,9 @@ jobs:

- name: Run tests
env:
DATABASE_URL: postgres://postgres:postgres@postgres/postgres
CACHE_URL: redis://redis
BUS_URL: amqp://guest:guest@rabbitmq
run: |
coverage run --concurrency=multiprocessing -m unittest tests/*.py
coverage combine
pip install coverage
coverage run -m unittest tests/**/*.py
coverage report -m --fail-under=60
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Serv-C implmentation for Python. Documentation can be found https://docs.servc.io

[![PyPI version](https://badge.fury.io/py/servc.svg)](https://badge.fury.io/py/servc)
![Serv-C](https://git.yusufali.ca/serv-c/servc-python/actions/workflows/servc.yml/badge.svg)

## Example
Expand Down
6 changes: 2 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ services:
command: sleep infinity
environment:
CACHE_URL: redis://redis:6379/0
BUS_URL: amqp://rabbitmq:rabbitmq@rabbitmq
BUS_URL: amqp://rabbitmq:rabbitmq@rabbitmq/
links:
- rabbitmq
- redis

redis:
image: redis
container_name: redis
restart: unless-stopped
expose:
- "6379"
Expand All @@ -24,11 +23,10 @@ services:

rabbitmq:
image: rabbitmq:3-management
container_name: rabbitmq
environment:
RABBITMQ_DEFAULT_USER: rabbitmq
RABBITMQ_DEFAULT_PASS: rabbitmq
RABBITMQ_DEFAULT_VHOST: /
RABBITMQ_DEFAULT_VHOST: /
ports:
- "5672:5672"
- "15672:15672"
Expand Down
8 changes: 5 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from servc.com.server.server import start_server
from servc.server import start_server


def main():
return start_server(
resolver={},
eventResolver={},
# route="test",
)


if __name__ == '__main__':
main()
main()
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ pika==1.3.2
redis==5.2.0
simplejson==3.19.2
flask==3.0.1
pyyaml==6.0.2
File renamed without changes.
35 changes: 0 additions & 35 deletions servc/com/bus/__init__.py

This file was deleted.

Loading