Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
setup,ci: Set the required Python version to 3.10 (#550)
Browse files Browse the repository at this point in the history
* setup: Update the common pkg
* ci: Update actions/setup-python with cache options
* ci: Install wheel to get prebuild support of cached pkgs
* setup: Update some deps
* fix: Update usage of pytest-aiohttp
  • Loading branch information
achimnol authored Mar 14, 2022
1 parent ae3b424 commit 3e444e0
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 49 deletions.
63 changes: 32 additions & 31 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Cache pip packages
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements/*.txt') }}
python-version: "3.10"
cache: "pip"
cache-dependency-path: |
requirements/lint.txt
setup.cfg
- name: Install dependencies
env:
REQUIREMENTS_FILE: lint
run: |
sudo apt-get install libsnappy-dev
python -m pip install -U pip setuptools
python -m pip install -U pip setuptools wheel
if [ -n "$GITHUB_HEAD_REF" ]; then
export GHBRANCH="${GITHUB_HEAD_REF#refs/heads/}"
else
Expand Down Expand Up @@ -53,21 +52,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Cache pip packages
uses: actions/cache@v2
- name: Set up Python
uses: actions/setup-python@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements/*.txt') }}
python-version: "3.10"
cache: "pip"
cache-dependency-path: |
requirements/typecheck.txt
setup.cfg
- name: Install dependencies
env:
REQUIREMENTS_FILE: typecheck
run: |
sudo apt-get install libsnappy-dev
python -m pip install -U pip setuptools
python -m pip install -U pip setuptools wheel
if [ -n "$GITHUB_HEAD_REF" ]; then
export GHBRANCH="${GITHUB_HEAD_REF#refs/heads/}"
else
Expand Down Expand Up @@ -119,21 +117,20 @@ jobs:
- 6379:6379
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Cache pip packages
uses: actions/cache@v2
- name: Set up Python
uses: actions/setup-python@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements/*.txt') }}
python-version: "~3.10.2"
cache: "pip"
cache-dependency-path: |
requirements/test.txt
setup.cfg
- name: Install dependencies
env:
REQUIREMENTS_FILE: test
run: |
sudo apt-get install libsnappy-dev
python -m pip install -U pip setuptools
python -m pip install -U pip setuptools wheel
if [ -n "$GITHUB_HEAD_REF" ]; then
export GHBRANCH="${GITHUB_HEAD_REF#refs/heads/}"
else
Expand Down Expand Up @@ -191,16 +188,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.9
python-version: "3.10"
cache: "pip"
cache-dependency-path: |
requirements/build.txt
setup.cfg
- name: Install dependencies
env:
REQUIREMENTS_FILE: build
run: |
sudo apt-get install libsnappy-dev
python -m pip install -U pip setuptools
python -m pip install -U pip setuptools wheel
if [ -n "$GITHUB_HEAD_REF" ]; then
export GHBRANCH="${GITHUB_HEAD_REF#refs/heads/}"
else
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/timeline-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,18 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v2
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.9
python-version: "3.10"
- name: Cache pip packages
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements/*.txt') }}
- name: Install dependencies
run: |
sudo apt-get install libsnappy-dev
python -m pip install -U pip setuptools
python -m pip install -U pip setuptools wheel
python -m pip install -U towncrier
- name: Check existence of news fragment
run: |
Expand Down
1 change: 1 addition & 0 deletions changes/550.breaking.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Now it requires Python 3.10 or higher to run.
14 changes: 7 additions & 7 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ classifiers =
Intended Audience :: Developers
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Operating System :: POSIX
Operating System :: MacOS :: MacOS X
Environment :: No Input/Output (Daemon)
Expand All @@ -29,14 +29,14 @@ project_urls =
package_dir =
= src
packages = find_namespace:
python_requires = >=3.9
python_requires = >=3.10
setup_requires =
setuptools>=51.1.1
wheel>=0.36.2
install_requires =
aiodataloader-ng~=0.2.1
aiodocker~=0.21.0
aiofiles~=0.7.0
aiofiles~=0.8.0
aiohttp~=3.8.0
aiohttp_cors~=0.7
aiohttp_sse~=2.0
Expand Down Expand Up @@ -69,7 +69,7 @@ install_requires =
trafaret~=2.1
uvloop>=0.16
zipstream-new~=1.1.8
backend.ai-common==22.3.0b1
backend.ai-common==22.3.0b2
backend.ai-cli~=0.5
zip_safe = false
include_package_data = true
Expand All @@ -80,9 +80,9 @@ build =
twine>=3.4.1
towncrier~=21.9.0
test =
pytest~=6.2.5
pytest-asyncio~=0.16.0
pytest-aiohttp>=0.3
pytest~=7.1.0
pytest-asyncio~=0.18.2
pytest-aiohttp>=1.0.4
pytest-cov>=2.11
pytest-mock>=3.5.0
codecov
Expand Down
12 changes: 6 additions & 6 deletions tests/api/test_middlewares.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from ai.backend.manager.server import api_middleware


async def test_api_method_override(test_client):
async def test_api_method_override(aiohttp_client):
observed_method = None
app = web.Application()

Expand All @@ -18,7 +18,7 @@ async def service_handler(request):
app.router.add_route('REPORT', r'/test',
service_handler)
app.middlewares.append(api_middleware)
client = await test_client(app)
client = await aiohttp_client(app)

# native method
resp = await client.request('REPORT', '/test')
Expand Down Expand Up @@ -48,7 +48,7 @@ async def service_handler(request):
assert observed_method is None


async def test_api_method_override_with_different_ops(test_client):
async def test_api_method_override_with_different_ops(aiohttp_client):
observed_method = None
app = web.Application()

Expand All @@ -65,7 +65,7 @@ async def op2_handler(request):
app.router.add_route('POST', r'/test', op1_handler)
app.router.add_route('REPORT', r'/test', op2_handler)
app.middlewares.append(api_middleware)
client = await test_client(app)
client = await aiohttp_client(app)

# native method
resp = await client.request('POST', '/test')
Expand Down Expand Up @@ -99,7 +99,7 @@ async def op2_handler(request):
assert observed_method == 'REPORT'


async def test_api_ver(test_client):
async def test_api_ver(aiohttp_client):
inner_request = None
app = web.Application()

Expand All @@ -110,7 +110,7 @@ async def dummy_handler(request):

app.router.add_post(r'/test', dummy_handler)
app.middlewares.append(api_middleware)
client = await test_client(app)
client = await aiohttp_client(app)

# normal call
resp = await client.post('/test', headers={
Expand Down

0 comments on commit 3e444e0

Please sign in to comment.