diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c3473a3..324961f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,107 +1,7 @@ name: Test EasyRpc Core Functionality on: ['pull_request'] jobs: - test_easyrpc_core_37: - # Containers must run in Linux based operating systems - runs-on: ubuntu-latest - # Docker Hub image that `container-job` executes in - #container: joshjamison/python38:latest - strategy: - matrix: - python-version: [3.7] - steps: - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - # Downloads a copy of the code in your repository before running CI tests - - name: Check out repository code - uses: actions/checkout@v2 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - pip install pytest requests pytest-asyncio - - name: Test EasyRpc Core Functionality - run: | - pytest tests/test_core.py - test_easyrpc_cluster_1_37: - needs: test_easyrpc_core_37 - # Containers must run in Linux based operating systems - runs-on: ubuntu-latest - # Docker Hub image that `container-job` executes in - #container: joshjamison/python38:latest - strategy: - matrix: - python-version: [3.7] - steps: - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - # Downloads a copy of the code in your repository before running CI tests - - name: Check out repository code - uses: actions/checkout@v2 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - pip install pytest requests pytest-asyncio - - name: Test EasyRpc Cluster Functionality - 1 - run: | - pytest tests/test_clustering_1.py - test_easyrpc_cluster_2_37: - needs: test_easyrpc_cluster_1_37 - # Containers must run in Linux based operating systems - runs-on: ubuntu-latest - # Docker Hub image that `container-job` executes in - #container: joshjamison/python38:latest - strategy: - matrix: - python-version: [3.7] - steps: - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - # Downloads a copy of the code in your repository before running CI tests - - name: Check out repository code - uses: actions/checkout@v2 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - pip install pytest requests pytest-asyncio - - name: Test EasyRpc Cluster Functionality - 2 - run: | - pytest tests/test_clustering_2.py - test_easyrpc_cluster_3_37: - needs: test_easyrpc_cluster_2_37 - # Containers must run in Linux based operating systems - runs-on: ubuntu-latest - # Docker Hub image that `container-job` executes in - #container: joshjamison/python38:latest - strategy: - matrix: - python-version: [3.7] - steps: - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - # Downloads a copy of the code in your repository before running CI tests - - name: Check out repository code - uses: actions/checkout@v2 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - pip install pytest requests pytest-asyncio - - name: Test EasyRpc Cluster Functionality - 3 - run: | - pytest tests/test_clustering_3.py test_easyrpc_core_38: - needs: test_easyrpc_cluster_3_37 # Containers must run in Linux based operating systems runs-on: ubuntu-latest # Docker Hub image that `container-job` executes in diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml index 705344d..0a0fbc1 100644 --- a/.github/workflows/package.yaml +++ b/.github/workflows/package.yaml @@ -4,108 +4,8 @@ on: tags: - "*" jobs: - test_easyrpc_core: - # Containers must run in Linux based operating systems - runs-on: ubuntu-latest - # Docker Hub image that `container-job` executes in - #container: joshjamison/python38:latest - strategy: - matrix: - python-version: [3.8] - steps: - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - # Downloads a copy of the code in your repository before running CI tests - - name: Check out repository code - uses: actions/checkout@v2 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - pip install pytest requests pytest-asyncio - - name: Test EasyRpc Core Functionality - run: | - pytest tests/test_core.py - test_easyrpc_cluster_1: - # Containers must run in Linux based operating systems - needs: test_easyrpc_core - runs-on: ubuntu-latest - # Docker Hub image that `container-job` executes in - #container: joshjamison/python38:latest - strategy: - matrix: - python-version: [3.8] - steps: - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - # Downloads a copy of the code in your repository before running CI tests - - name: Check out repository code - uses: actions/checkout@v2 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - pip install pytest requests pytest-asyncio - - name: Test EasyRpc Cluster Functionality - 1 - run: | - pytest tests/test_clustering_1.py - test_easyrpc_cluster_2: - needs: test_easyrpc_cluster_1 - # Containers must run in Linux based operating systems - runs-on: ubuntu-latest - # Docker Hub image that `container-job` executes in - #container: joshjamison/python38:latest - strategy: - matrix: - python-version: [3.8] - steps: - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - # Downloads a copy of the code in your repository before running CI tests - - name: Check out repository code - uses: actions/checkout@v2 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - pip install pytest requests pytest-asyncio - - name: Test EasyRpc Cluster Functionality - 2 - run: | - pytest tests/test_clustering_2.py - test_easyrpc_cluster_3: - needs: test_easyrpc_cluster_2 - # Containers must run in Linux based operating systems - runs-on: ubuntu-latest - # Docker Hub image that `container-job` executes in - #container: joshjamison/python38:latest - strategy: - matrix: - python-version: [3.8] - steps: - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - # Downloads a copy of the code in your repository before running CI tests - - name: Check out repository code - uses: actions/checkout@v2 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - pip install pytest requests pytest-asyncio - - name: Test EasyRpc Cluster Functionality - 3 - run: | - pytest tests/test_clustering_3.py package: name: Package easyrpc for PyPI - needs: test_easyrpc_cluster_3 runs-on: ubuntu-latest steps: # Downloads a copy of the code in your repository before running CI tests diff --git a/easyrpc/proxy.py b/easyrpc/proxy.py index 33df7a3..9e80fc2 100644 --- a/easyrpc/proxy.py +++ b/easyrpc/proxy.py @@ -155,7 +155,7 @@ async def create(cls, def run_cron(self, action, interval): async def cron(): - self.log.warning(f"creating cron or {action.__name__} - interval {interval}") + self.log.debug(f"creating cron or {action.__name__} - interval {interval}") tasks = [] while True: try: @@ -466,7 +466,7 @@ async def ws_client(): ws_sender = self.get_ws_sender(ws) ws_receiver = self.get_ws_receiver(ws) - self.log.warning( + self.log.debug( f"started connection to server {self.origin_host}:{self.origin_port}" ) async def keep_alive(): diff --git a/easyrpc/register.py b/easyrpc/register.py index b25c1d0..a272e8f 100644 --- a/easyrpc/register.py +++ b/easyrpc/register.py @@ -46,8 +46,8 @@ async def __proxy__(*args, **kwargs): return await result return result - #__proxy__.__name__ = f"{config['name']}_proxy" __proxy__.__name__ = f"{config['name']}" + __proxy__.__doc__ = config.get('doc', '') nf = create_function( create_signature_from_dict( config['sig'] @@ -126,6 +126,7 @@ def register(f, namespace): obj.namespaces[namespace][f.__name__]['config'] = { 'sig': get_signature_as_dict(f), 'name': f.__name__, + 'doc': f.__doc__, 'is_async': iscoroutinefunction(f) } obj.namespaces[namespace][f.__name__]['method'] = f diff --git a/easyrpc/server.py b/easyrpc/server.py index 4b7c021..6c46d20 100644 --- a/easyrpc/server.py +++ b/easyrpc/server.py @@ -23,11 +23,11 @@ async def connect(self, websocket: WebSocket): return await websocket.accept() def store_connect(self, endpoint_id, websocket: WebSocket): - self.log.warning(f"created websocket connection with endpoint {endpoint_id}") + self.log.debug(f"created websocket connection with endpoint {endpoint_id}") self.active_connections[endpoint_id] = websocket def disconnect(self, endpoint_id: str): - self.log.warning(f"deleted websocket connection with endpoint {endpoint_id}") + self.log.debug(f"deleted websocket connection with endpoint {endpoint_id}") del self.active_connections[endpoint_id] async def broadcast(self, message: str): for connection in self.active_connections: @@ -422,7 +422,7 @@ async def ws_receiver(): await finished.get() # child connection closed - self.log.warning(f"client websocket connection with id {decoded_id} finished") + self.log.debug(f"client websocket connection with id {decoded_id} finished") # check if child is server or proxy if setup['type'] == 'SERVER':