Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add python 3.11 and 3.12 in github action #61

Merged
merged 2 commits into from
Jul 4, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
__pycache__/
.vscode
venv/
venv*
venv-pypy/
.pytest_cache
.idea
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/dockerize/aiohttp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-slim
FROM python:3.11-slim

COPY . .
RUN pip install -r requirements.txt
5 changes: 2 additions & 3 deletions benchmarks/dockerize/aiohttp/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
aiohttp
gunicorn
PyJWT
aioredis
redis>=4.2.0rc1
uvloop
msgpack
redis
msgpack
2 changes: 1 addition & 1 deletion benchmarks/dockerize/aiohttp/shared.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from dataclasses import dataclass
from datetime import datetime

import aioredis
import msgpack
import redis
from redis import asyncio as aioredis


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/dockerize/aiozmq/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-slim
FROM python:3.11-slim

COPY . .
RUN pip install -r requirements.txt
3 changes: 1 addition & 2 deletions benchmarks/dockerize/aiozmq/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
aiozmq
PyJWT
aioredis
redis>=4.2.0rc1
uvloop
msgpack
aiohttp
gunicorn
redis
sanic
2 changes: 1 addition & 1 deletion benchmarks/dockerize/aiozmq/shared.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from dataclasses import dataclass
from datetime import datetime

import aioredis
import msgpack
import redis
from redis import asyncio as aioredis


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/dockerize/blacksheep/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-slim
FROM python:3.11-slim

COPY . .
RUN pip install -r requirements.txt
5 changes: 2 additions & 3 deletions benchmarks/dockerize/blacksheep/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
blacksheep
uvicorn
PyJWT
aioredis
redis>=4.2.0rc1
uvloop
msgpack
redis
msgpack
2 changes: 1 addition & 1 deletion benchmarks/dockerize/blacksheep/shared.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from dataclasses import dataclass
from datetime import datetime

import aioredis
import msgpack
import redis
from redis import asyncio as aioredis


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/dockerize/fast_api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-slim
FROM python:3.11-slim

COPY . .
RUN pip install -r requirements.txt
5 changes: 2 additions & 3 deletions benchmarks/dockerize/fast_api/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
fastapi
uvicorn
PyJWT
aioredis
redis>=4.2.0rc1
uvloop
msgpack
aiohttp
redis
aiohttp
2 changes: 1 addition & 1 deletion benchmarks/dockerize/fast_api/shared.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from dataclasses import dataclass
from datetime import datetime

import aioredis
import msgpack
import redis
from redis import asyncio as aioredis


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/dockerize/sanic/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-slim
FROM python:3.11-slim

COPY . .
RUN pip install -r requirements.txt
5 changes: 2 additions & 3 deletions benchmarks/dockerize/sanic/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
sanic
PyJWT
aioredis
redis>=4.2.0rc1
uvloop
msgpack
aiohttp
redis
aiohttp
2 changes: 1 addition & 1 deletion benchmarks/dockerize/sanic/shared.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from dataclasses import dataclass
from datetime import datetime

import aioredis
import msgpack
import redis
from redis import asyncio as aioredis


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/dockerize/zero/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-slim
FROM python:3.11-slim

COPY . .
RUN pip install -r requirements.txt
3 changes: 1 addition & 2 deletions benchmarks/dockerize/zero/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
zeroapi
PyJWT
aioredis
redis>=4.2.0rc1
uvloop
aiohttp
gunicorn
redis
sanic
msgpack
uvicorn
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/dockerize/zero/shared.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from dataclasses import dataclass
from datetime import datetime

import aioredis
import msgpack
import redis
from redis import asyncio as aioredis


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/local/zero/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-slim
FROM python:3.11-slim

COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/local/zero/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
pyzmq
msgspec
PyJWT
aioredis
redis>=4.2.0rc1
uvloop
aiohttp
gunicorn
redis
sanic
msgpack
blacksheep
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/local/zero/shared.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from dataclasses import dataclass
from datetime import datetime

import aioredis
import msgpack
import redis
from redis import asyncio as aioredis


@dataclass
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/others/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ httpx
fastapi
sanic
PyJWT
redis
aioredis @ git+https://github.com/aio-libs/aioredis@ff5a8fe068ebda837d14c3b3777a6182e610854a
redis>=4.2.0rc1
uvloop
pydantic
4 changes: 2 additions & 2 deletions tests/concurrency/rps_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ async def task(semaphore, items):


async def process_tasks(items_chunk):
conc = 8
conc = 16
semaphore = asyncio.BoundedSemaphore(conc)
tasks = [task(semaphore, items) for items in items_chunk]
await asyncio.gather(*tasks)
await async_client.close()
async_client.close()


def run_chunk(items_chunk):
Expand Down
10 changes: 0 additions & 10 deletions tests/concurrency/single_req.py

This file was deleted.

26 changes: 26 additions & 0 deletions tests/concurrency/single_req_async.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import asyncio

from zero import AsyncZeroClient, ZeroClient

client = ZeroClient("localhost", 5559)
async_client = AsyncZeroClient("localhost", 5559)

# Create a semaphore outside of the task function
semaphore = asyncio.BoundedSemaphore(32)


async def task(sleep_time, i):
# Use the semaphore as an async context manager to limit concurrency
async with semaphore:
res = await async_client.call("sleep", sleep_time)
assert res == f"slept for {sleep_time} msecs"
print(res, i)


async def main():
tasks = [task(200, i) for i in range(500)]
await asyncio.gather(*tasks)


if __name__ == "__main__":
asyncio.run(main())
9 changes: 9 additions & 0 deletions tests/concurrency/single_req_sync.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from zero import ZeroClient

client = ZeroClient("localhost", 5559)

if __name__ == "__main__":
for i in range(50):
res = client.call("sleep", 200)
assert res == "slept for 200 msecs"
print(res)
11 changes: 1 addition & 10 deletions tests/concurrency/sleep_test_async.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
import asyncio
import random
import time
from contextlib import contextmanager

from zero import AsyncZeroClient


@contextmanager
def get_client():
client = AsyncZeroClient("localhost", 5559)
yield client
client.close()


async_client = AsyncZeroClient("localhost", 5559)


Expand All @@ -25,7 +16,7 @@ async def task(semaphore, sleep_time):


async def test():
conc = 10
conc = 32
semaphore = asyncio.BoundedSemaphore(conc)

sleep_times = []
Expand Down
2 changes: 1 addition & 1 deletion tests/concurrency/sleep_test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def get_and_print(msg):
resp = func(msg)
if resp != f"slept for {msg} msecs":
print(f"expected: slept for {msg} msecs, got: {resp}")
print(resp)
# print(resp)


if __name__ == "__main__":
Expand Down
Loading
Loading