Skip to content

Commit

Permalink
Fix/problems with master (#172)
Browse files Browse the repository at this point in the history
* fix: corrected flake for doc

* feat: updated deps

* fix: fixed problem connected with running tests

* feat: added mypy to ci build

* fix: fix mypy
  • Loading branch information
Arfey committed Mar 15, 2020
1 parent 9966ed2 commit 88bf768
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 26 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ before_script:
# Disable services enabled by default
# http://docs.travis-ci.com/user/database-setup/#MySQL
- sudo /etc/init.d/postgresql stop
# - sudo /etc/init.d/mysql stop

cache: pip

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test:
pip install .
create-aio-app project_new
doc8 project_new/docs/
cd project_new/ && make lint && docker-compose up test && docker-compose stop
cd project_new/ && make lint && make mypy && docker-compose up test && docker-compose stop

ci: flake test

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@ services:
ports:
- 8082:8082
entrypoint: py.test -v -p no:warnings
command: ''
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ Testing

Database
--------
Next commands are available if you have not disabled ``postgres`` option when creating a project:
Next commands are available if you have not disabled ``postgres`` option when
creating a project:


.. csv-table::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ Read more:
</a>
- style checker for documentation
</li>
</ul>
</ul>
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ If you want to run a single test, you can pass an argument
to `docker-compose` like this:

.. code-block:: bash
docker-compose run test project_name/main/tests/test_views.py::test_view
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
-r production.txt
-r documentation.txt

mypy==0.670
flake8==3.7.5
pytest==5.2.0
pytest-cov==2.6.1
mypy==0.770
flake8==3.7.9
pytest==5.4.1
pytest-cov==2.8.1
pytest-aiohttp==0.3.0
black==18.9b0
black==19.10b0

aiohttp-devtools==0.11
aiohttp-debugtoolbar==0.6.0
aiohttp-devtools==0.13.1
aiohttp-debugtoolbar==0.6.0
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Sphinx==1.8.4
sphinx-autodoc-typehints==1.6.0
sphinxcontrib-websupport==1.1.0
doc8==0.8.0
Sphinx==2.4.4
sphinx-autodoc-typehints==1.10.3
sphinxcontrib-websupport==1.2.0
doc8==0.8.0
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
aiohttp==3.5.4
aiohttp_jinja2==1.1.0
aiohttp==3.6.2
aiohttp_jinja2==1.2.0
trafaret_config==2.0.2
markdown2==2.3.7
{%- if cookiecutter.use_postgres == 'y' %}
aiopg[sa]==0.16.0
psycopg2-binary==2.7.7
alembic==1.0.7
aiopg[sa]==1.0.0
psycopg2-binary==2.8.4
alembic==1.4.1
{%- endif %}
{%- if cookiecutter.use_redis == 'y' %}
aioredis==1.2.0
aioredis==1.3.1
{%- endif %}
{%- if cookiecutter.use_uvloop == 'y' %}
uvloop==0.12.2
uvloop==0.14.0
{%- endif %}
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
from pathlib import Path
from typing import Optional, List
from typing import (
Optional,
List,
AsyncGenerator,
)

{%- if cookiecutter.use_redis == 'y' %}
from functools import partial
Expand Down Expand Up @@ -33,7 +37,7 @@ def init_jinja2(app: web.Application) -> None:
{%- if cookiecutter.use_postgres == 'y' %}


async def database(app: web.Application) -> None:
async def database(app: web.Application) -> AsyncGenerator[None, None]:
'''
A function that, when the server is started, connects to postgresql,
and after stopping it breaks the connection (after yield)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from typing import Dict
import subprocess # nosec
import click
import re
Expand All @@ -24,8 +25,10 @@ def upgrade_requirements() -> None:
)\
.decode("utf-8").split("\n")

packages = dict(
package.split('==') for package in fresh_version if package)
packages: Dict[str, str] = dict(
package.split('==') # type: ignore
for package in fresh_version if package
)

with req_file.open('w') as f:
new_req = old_req
Expand Down

0 comments on commit 88bf768

Please sign in to comment.