Commit a44f87a4 authored by xa's avatar xa

typing

parent 8026654e
layout python3
...@@ -57,3 +57,6 @@ docs/_build/ ...@@ -57,3 +57,6 @@ docs/_build/
# PyBuilder # PyBuilder
target/ target/
.mypy_cache/
.pytest_cache/
.vscode/
\ No newline at end of file
...@@ -4,17 +4,11 @@ before_script: ...@@ -4,17 +4,11 @@ before_script:
- python -m pip install -e . - python -m pip install -e .
- python -m pip install -r requirements-test.txt - python -m pip install -r requirements-test.txt
python3.3 tests: python3 tests:
script: script:
- py.test --cov knighted --cov-report term-missing tests/ - py.test --cov knighted --cov-report term-missing tests/
tags: tags:
- python3.3 - python3
python3.4 tests:
script:
- py.test --cov knighted --cov-report term-missing tests/
tags:
- python3.4
publish to pypi: publish to pypi:
type: deploy type: deploy
...@@ -23,7 +17,7 @@ publish to pypi: ...@@ -23,7 +17,7 @@ publish to pypi:
- python setup.py sdist bdist_wheel - python setup.py sdist bdist_wheel
- twine upload -u $PYPI_USER -p $PYPI_PASSWORD dist/* - twine upload -u $PYPI_USER -p $PYPI_PASSWORD dist/*
tags: tags:
- python3.4 - python3
only: only:
- /^v[\d\.]+.*$/ - /^v[\d\.]+.*$/
allow_failure: true allow_failure: true
from __future__ import annotations
import asyncio import asyncio
import logging import logging
from abc import ABCMeta from abc import ABCMeta
...@@ -6,7 +7,7 @@ from itertools import chain ...@@ -6,7 +7,7 @@ from itertools import chain
from weakref import WeakKeyDictionary from weakref import WeakKeyDictionary
from functools import wraps from functools import wraps
logger = logging.getLogger(__name__) logger = logging.getLogger("knighted")
class Factory: class Factory:
...@@ -113,7 +114,7 @@ class Injector(metaclass=ABCMeta): ...@@ -113,7 +114,7 @@ class Injector(metaclass=ABCMeta):
return response return response
def partial(self, func): def partial(self, func):
"""Resolves lately dependancies. """Resolves lately dependencies.
Returns: Returns:
callable: the service partially resolved callable: the service partially resolved
...@@ -139,7 +140,7 @@ class Injector(metaclass=ABCMeta): ...@@ -139,7 +140,7 @@ class Injector(metaclass=ABCMeta):
return wrapper return wrapper
ANNOTATIONS = WeakKeyDictionary() ANNOTATIONS: WeakKeyDictionary[str, "Annotation"] = WeakKeyDictionary()
Annotation = namedtuple('Annotation', 'pos_notes kw_notes') Annotation = namedtuple('Annotation', 'pos_notes kw_notes')
......
...@@ -10,3 +10,8 @@ description-file = README.rst ...@@ -10,3 +10,8 @@ description-file = README.rst
[flake8] [flake8]
exclude = _version.py exclude = _version.py
max-complexity = 10 max-complexity = 10
[doc8]
max-line-length=99
verbose=1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment