Skip to content

Commit

Permalink
Workflow maintenance, apply isort and black (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertoPrevato authored Nov 30, 2022
1 parent 3eaa296 commit ce54994
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 70 deletions.
18 changes: 4 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ jobs:
build:
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.8, 3.9, "3.10", "3.11"]

steps:
- uses: actions/checkout@v1
Expand All @@ -28,24 +29,13 @@ jobs:
submodules: false

- name: Use Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- uses: actions/cache@v1
id: depcache
with:
path: deps
key: requirements-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }}

- name: Download dependencies
if: steps.depcache.outputs.cache-hit != 'true'
run: |
pip download --dest=deps -r dev-requirements.txt
- name: Install dependencies
run: |
pip install -U --no-index --find-links=deps deps/*
pip install -r dev-requirements.txt
- name: Prepare test database
run: |
Expand Down
6 changes: 3 additions & 3 deletions blacksheepsqlalchemy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from typing import Optional

from blacksheep.server import Application
from sqlalchemy.ext.asyncio import (
create_async_engine,
AsyncConnection,
AsyncEngine,
AsyncSession,
AsyncConnection,
create_async_engine,
)
from blacksheep.server import Application


def __configure_services(
Expand Down
81 changes: 37 additions & 44 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,49 +1,42 @@
aiosqlite==0.17.0
alembic==1.6.3
appdirs==1.4.4
asyncpg==0.23.0
attrs==21.2.0
black==21.5b1
blacksheep==1.0.5
cchardet==2.1.7
certifi==2020.12.5
click==7.1.2
coverage==5.5
essentials==1.1.4
essentials-openapi==0.1.2
flake8==3.9.2
greenlet==1.1.0
guardpost==0.0.7
h11==0.12.0
httptools==0.2.0
alembic==1.8.1
attrs==22.1.0
black==22.10.0
blacksheep==1.2.8
certifi==2022.9.24
click==8.1.3
coverage==6.5.0
essentials==1.1.5
essentials-openapi==0.1.6
exceptiongroup==1.0.4
flake8==6.0.0
greenlet==2.0.1
guardpost==0.0.9
h11==0.14.0
httptools==0.5.0
iniconfig==1.1.1
itsdangerous==1.1.0
Jinja2==2.11.3
Mako==1.1.4
MarkupSafe==2.0.1
mccabe==0.6.1
mypy==0.812
isort==5.10.1
itsdangerous==2.1.2
Jinja2==3.1.2
Mako==1.2.4
MarkupSafe==2.1.1
mccabe==0.7.0
mypy-extensions==0.4.3
packaging==20.9
pathspec==0.8.1
pluggy==0.13.1
py==1.10.0
pycodestyle==2.7.0
pyflakes==2.3.1
pyparsing==2.4.7
pytest==6.2.4
pytest-asyncio==0.15.1
pytest-cov==2.12.0
python-dateutil==2.8.1
python-editor==1.0.4
packaging==21.3
pathspec==0.10.2
platformdirs==2.5.4
pluggy==1.0.0
pycodestyle==2.10.0
pyflakes==3.0.1
pyparsing==3.0.9
pytest==7.2.0
pytest-asyncio==0.20.2
pytest-cov==4.0.0
python-dateutil==2.8.2
PyYAML==5.4.1
regex==2021.4.4
rodi==1.1.1
rodi==1.1.3
six==1.16.0
SQLAlchemy==1.4.15
sqlalchemy-stubs==0.4
sqlalchemy2-stubs==0.0.2a1
toml==0.10.2
typed-ast==1.4.3
typing-extensions==3.10.0.0
uvicorn==0.13.4
SQLAlchemy==1.4.44
tomli==2.0.1
typing_extensions==4.4.0
uvicorn==0.20.0
2 changes: 1 addition & 1 deletion tests/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
from blacksheep.messages import Response
from blacksheep.server import Application
from blacksheep.server.openapi.v3 import OpenAPIHandler
from blacksheepsqlalchemy import use_sqlalchemy
from openapidocs.v3 import Info
from sqlalchemy import delete as sql_delete
from sqlalchemy import text

from blacksheepsqlalchemy import use_sqlalchemy
from tests.domain import Country

app = Application(show_error_details=True)
Expand Down
4 changes: 1 addition & 3 deletions tests/migrations/env.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import sys
from logging.config import fileConfig

from sqlalchemy import engine_from_config
from sqlalchemy import pool

from alembic import context
from sqlalchemy import engine_from_config, pool

# hack to keep example code inside the tests folder without polluting the root folder
# of the repository
Expand Down
3 changes: 1 addition & 2 deletions tests/migrations/versions/ae4207a54d40_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
Create Date: 2021-05-22 09:54:27.486818
"""
from alembic import op
import sqlalchemy as sa

from alembic import op

# revision identifiers, used by Alembic.
revision = "ae4207a54d40"
Expand Down
8 changes: 5 additions & 3 deletions tests/test_blacksheepsqlalchemy.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from blacksheep.contents import JSONContent
import pytest
from .fixtures import * # NoQA
from blacksheep.server import Application
from blacksheep.client import ClientSession
from blacksheep.contents import JSONContent
from blacksheep.server import Application

from blacksheepsqlalchemy import use_sqlalchemy

from .fixtures import * # NoQA


async def insert_fetch_delete_scenario(
client_session: ClientSession, option: str, country_code: str, country_name: str
Expand Down

0 comments on commit ce54994

Please sign in to comment.