Skip to content

Commit

Permalink
Merge pull request #104 from quantmind/ls-312
Browse files Browse the repository at this point in the history
Test 3.12
  • Loading branch information
lsbardel authored Jun 16, 2024
2 parents ad72970 + 5014edb commit 90154d0
Show file tree
Hide file tree
Showing 15 changed files with 576 additions and 621 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ jobs:

strategy:
matrix:
python-version: ["3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: run services
run: make services-ci
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -35,11 +35,11 @@ jobs:
- name: run tests
run: make test
- name: upload coverage
if: matrix.python-version == '3.11'
uses: codecov/codecov-action@v3
if: matrix.python-version == '3.12'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./build/coverage.xml
- name: publish
if: ${{ matrix.python-version == '3.11' && github.event.head_commit.message == 'release' }}
if: ${{ matrix.python-version == '3.12' && github.event.head_commit.message == 'release' }}
run: make publish
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ __pycache__
.coverage
.pytest_cache
.mypy_cache
.ruff_cache
venv
build
dist
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ lint-check: ## run black check in CI


outdated: ## Show outdated packages
poetry show -o
poetry show -o -a


version: ## display software version
Expand Down
2 changes: 1 addition & 1 deletion dev/lint-code
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ fi
echo "run black"
black kong tests ${BLACK_ARG}
echo "run ruff"
ruff kong tests ${RUFF_ARG}
ruff check kong tests ${RUFF_ARG}
echo "run mypy"
mypy kong
9 changes: 5 additions & 4 deletions kong/cli.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import asyncio
import click
import json
import yaml as _yaml
from typing import Any, cast

import click
import yaml as _yaml

from . import __version__
from .client import Kong, KongError
from .consumers import Consumer
Expand Down Expand Up @@ -51,7 +52,7 @@ async def _yml(yaml: Any, clear: bool) -> None:
result = await cli.apply_json(_yaml.safe_load(yaml), clear=clear)
click.echo(json.dumps(result, indent=4))
except KongError as exc:
raise click.ClickException(str(exc))
raise click.ClickException(str(exc)) from None


async def _auth_key(consumer: str) -> None:
Expand All @@ -65,4 +66,4 @@ async def _auth_key(consumer: str) -> None:
key = await c.keyauths.create()
click.echo(json.dumps(key.data, indent=4))
except KongError as exc:
raise click.ClickException(str(exc))
raise click.ClickException(str(exc)) from None
3 changes: 2 additions & 1 deletion kong/components.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from __future__ import annotations

import json
from aiohttp import ClientResponse
from typing import TYPE_CHECKING, Any, AsyncIterator, Iterator, Mapping

from aiohttp import ClientResponse

from .utils import UUID, as_dict, as_params, uid

if TYPE_CHECKING:
Expand Down
3 changes: 2 additions & 1 deletion kong/utils.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import socket
from multidict import MultiDict
from typing import Any
from uuid import UUID

from multidict import MultiDict


def as_list(key: str, data: dict) -> dict:
if key in data:
Expand Down
1,141 changes: 543 additions & 598 deletions poetry.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ click = "^8.1.3"
PyYAML = "^6.0"

[tool.poetry.group.dev.dependencies]
black = "^23.3.0"
black = "^24.4.2"
isort = "^5.10.1"
mypy = "^1.4.0"
pytest = "^7.1.2"
pytest-cov = "^4.0.0"
pytest = "^8.2.2"
pytest-cov = "^5.0.0"
python-dotenv = "^1.0.0"
pytest-asyncio = "^0.21.0"
pytest-asyncio = "^0.23.7"
types-PyYAML = "^6.0.11"
ruff = "^0.0.274"
ruff = "^0.4.9"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand All @@ -67,7 +67,7 @@ testpaths = [
profile = "black"

[tool.ruff]
select = ["E", "F"]
lint.select = ["A", "E", "W", "F", "I", "B", "N"]
line-length = 88

[tool.mypy]
Expand Down
3 changes: 2 additions & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import dotenv
import os

import dotenv

dotenv.load_dotenv()


Expand Down
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import aiohttp
import asyncio

import aiohttp
import pytest

from kong.client import Kong
Expand Down
1 change: 1 addition & 0 deletions tests/test_apply.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os

import pytest
import yaml

Expand Down
1 change: 1 addition & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json

from click.testing import CliRunner

from kong import __version__
Expand Down
1 change: 1 addition & 0 deletions tests/test_kong.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os

import pytest

from kong.client import KongError
Expand Down
3 changes: 2 additions & 1 deletion tests/test_mocks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import aiohttp
from typing import Dict, Tuple

import aiohttp

from kong.client import Kong


Expand Down

0 comments on commit 90154d0

Please sign in to comment.