Skip to content

Commit

Permalink
v0.14.1
Browse files Browse the repository at this point in the history
  • Loading branch information
grigi committed Nov 7, 2019
1 parent 394e0c5 commit a217378
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 33 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.rst
Expand Up @@ -4,7 +4,8 @@ Changelog
=========
0.14.1
-------
- `ManyToManyField` is now a function instead of a class.
- ``ManyToManyField`` is now a function that has the type of the relation for autocomplete,
this allows for better type hinting at less effort.
- Added section on adding better autocomplete for relations in editors.

0.14.0
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -53,7 +53,7 @@ _testall:
$(py_warn) TORTOISE_TEST_DB=sqlite://:memory: py.test --cov-report=
python -V | grep PyPy || $(py_warn) TORTOISE_TEST_DB=postgres://postgres:$(TORTOISE_POSTGRES_PASS)@127.0.0.1:5432/test_\{\} py.test --cov-append --cov-report=
$(py_warn) TORTOISE_TEST_DB="mysql://root:$(TORTOISE_MYSQL_PASS)@127.0.0.1:3306/test_\{\}?storage_engine=MYISAM" py.test --cov-append --cov-report=
$(py_warn) TORTOISE_TEST_DB="mysql:$(TORTOISE_MYSQL_PASS)//root:@127.0.0.1:3306/test_\{\}" py.test --cov-append
$(py_warn) TORTOISE_TEST_DB="mysql://root:$(TORTOISE_MYSQL_PASS)@127.0.0.1:3306/test_\{\}" py.test --cov-append

testall: deps _testall

Expand Down
4 changes: 2 additions & 2 deletions docs/models.rst
Expand Up @@ -306,8 +306,8 @@ Sync usage requires that you call `fetch_related` before the time, and then you
The reverse lookup of ``team.event_team`` works exactly the same way.

``Improving relational type hinting``
-------------------------------------
Improving relational type hinting
=================================

Since Tortoise ORM is still a young project, it does not have such widespread support by
various editors who help you writing code using good autocomplete for models and
Expand Down
13 changes: 8 additions & 5 deletions docs/sphinx_autodoc_typehints.py
Expand Up @@ -212,8 +212,8 @@ def get_all_type_hints(obj, name):
pass
except NameError as exc:
try:
rv = get_type_hints(obj, sys.modules['tortoise'].__dict__)
except:
rv = get_type_hints(obj, localns=sys.modules['tortoise'].__dict__)
except Exception as exc:
logger.warning('Cannot resolve forward reference in type annotations of "%s": %s',
name, exc)
rv = obj.__annotations__
Expand All @@ -233,9 +233,12 @@ def get_all_type_hints(obj, name):
except (AttributeError, TypeError):
pass
except NameError as exc:
logger.warning('Cannot resolve forward reference in type annotations of "%s": %s',
name, exc)
rv = obj.__annotations__
try:
rv = get_type_hints(obj, localns=sys.modules['tortoise'].__dict__)
except:
logger.warning('Cannot resolve forward reference in type annotations of "%s": %s',
name, exc)
rv = obj.__annotations__

return rv

Expand Down
10 changes: 5 additions & 5 deletions tests/requirements-pypy.txt
Expand Up @@ -11,7 +11,7 @@ asynctest==0.13.0
atomicwrites==1.3.0 # via pytest
attrs==19.3.0 # via pytest
certifi==2019.9.11 # via requests
cffi==1.13.1 # via cryptography
cffi==1.13.2 # via cryptography
chardet==3.0.4 # via requests
ciso8601==2.1.2
coverage==4.5.4 # via coveralls, pytest-cov
Expand All @@ -27,16 +27,16 @@ pluggy==0.13.0 # via pytest
py==1.8.0 # via pytest
pycparser==2.19 # via cffi
pymysql==0.9.2 # via aiomysql
pyparsing==2.4.2 # via packaging
pypika==0.35.14
pyparsing==2.4.4 # via packaging
pypika==0.35.15
pytest-cov==2.8.1
pytest-forked==1.1.3 # via pytest-xdist
pytest-xdist==1.30.0
pytest==5.2.2
pyyaml==5.1.2
requests==2.22.0 # via coveralls
six==1.12.0 # via cryptography, packaging, pytest-xdist
typing-extensions==3.7.4
six==1.13.0 # via cryptography, packaging, pytest-xdist
typing-extensions==3.7.4.1
urllib3==1.25.6 # via requests
wcwidth==0.1.7 # via pytest
zipp==0.6.0 # via importlib-metadata
Expand Down
3 changes: 2 additions & 1 deletion tests/requirements.in
Expand Up @@ -44,7 +44,8 @@ quart;python_version>="3.7"

# Sample integration - Sanic
sanic
uvloop>=0.12.0; sys_platform != "win32" and implementation_name == "cpython"

# Sample integration - Starlette
starlette
uvicorn < 0.9
uvicorn
36 changes: 19 additions & 17 deletions tests/requirements.txt
Expand Up @@ -11,18 +11,18 @@ aiosqlite==0.10.0
alabaster==0.7.12 # via sphinx
apipkg==1.5 # via execnet
appdirs==1.4.3 # via black
astroid==2.3.2 # via pylint
astroid==2.3.3 # via pylint
asyncpg==0.19.0
asynctest==0.13.0
atomicwrites==1.3.0 # via pytest
attrs==19.3.0 # via black, pytest
babel==2.7.0 # via sphinx
bandit==1.6.2
black==19.3b0 ; python_version >= "3.6"
black==19.10b0 ; python_version >= "3.6"
bleach==3.1.0 # via readme-renderer
blinker==1.4 # via quart
certifi==2019.9.11 # via httpcore, requests
cffi==1.13.1 # via cryptography
cffi==1.13.2 # via cryptography
chardet==3.0.4 # via httpcore, requests
ciso8601==2.1.2
click==7.0 # via black, pip-tools, quart, uvicorn
Expand All @@ -37,7 +37,7 @@ entrypoints==0.3 # via flake8
execnet==1.7.1 # via pytest-xdist
filelock==3.0.12 # via tox
flake8-isort==2.7.0
flake8==3.7.8 # via flake8-isort
flake8==3.7.9 # via flake8-isort
gitdb2==2.0.6 # via gitpython
gitpython==3.0.4 # via bandit
green==3.0.0
Expand All @@ -54,7 +54,7 @@ importlib-metadata==0.23 # via pluggy, pytest, tox
isort==4.3.21 # via flake8-isort, pylint
itsdangerous==1.1.0 # via quart
jinja2==2.10.3 # via quart, sphinx
lazy-object-proxy==1.4.2 # via astroid
lazy-object-proxy==1.4.3 # via astroid
lxml==4.4.1 # via green
markupsafe==1.1.1 # via jinja2
mccabe==0.6.1 # via flake8, pylint
Expand All @@ -64,6 +64,7 @@ mypy-extensions==0.4.3 # via mypy
mypy==0.740
nose2==0.9.1
packaging==19.2 # via pytest, sphinx, tox
pathspec==0.6.0 # via black
pbr==5.4.3 # via stevedore
pip-tools==4.2.0
pkginfo==1.5.0.1 # via twine
Expand All @@ -76,8 +77,8 @@ pyflakes==2.1.1 # via flake8
pygments==2.4.2
pylint==2.4.3
pymysql==0.9.2 # via aiomysql
pyparsing==2.4.2 # via packaging
pypika==0.35.14
pyparsing==2.4.4 # via packaging
pypika==0.35.15
pytest-cov==2.8.1
pytest-forked==1.1.3 # via pytest-xdist
pytest-xdist==1.30.0
Expand All @@ -86,41 +87,42 @@ pytz==2019.3 # via babel
pyyaml==5.1.2
quart==0.10.0 ; python_version >= "3.7"
readme-renderer==24.0 # via twine
regex==2019.11.1 # via black
requests-async==0.5.0 # via sanic
requests-toolbelt==0.9.1 # via twine
requests==2.22.0 # via coveralls, requests-async, requests-toolbelt, sphinx, twine
rfc3986==1.3.2 # via httpcore
sanic==19.9.0
six==1.12.0 # via astroid, bandit, bleach, cryptography, nose2, packaging, pip-tools, pytest-xdist, readme-renderer, sphinx, stevedore, tox
six==1.13.0 # via astroid, bandit, bleach, cryptography, nose2, packaging, pip-tools, pytest-xdist, readme-renderer, sphinx, stevedore, tox
smmap2==2.0.5 # via gitdb2
snowballstemmer==2.0.0 # via sphinx
sortedcontainers==2.1.0 # via quart
sphinx==1.8.5
sphinxcontrib-websupport==1.1.2 # via sphinx
starlette==0.12.10
starlette==0.12.13
stevedore==1.31.0 # via bandit
testfixtures==6.10.0 # via flake8-isort
testfixtures==6.10.1 # via flake8-isort
toml==0.10.0 # via black, hypercorn, tox
tox==3.14.0
tqdm==4.36.1 # via twine
tqdm==4.37.0 # via twine
twine==1.15.0
typed-ast==1.4.0 # via astroid, mypy
typing-extensions==3.7.4
typed-ast==1.4.0 # via astroid, black, mypy
typing-extensions==3.7.4.1
ujson==1.35 # via sanic
unidecode==1.1.1 # via green
urllib3==1.25.6 # via requests
uvicorn==0.8.6
uvloop==0.12.2 # via sanic, uvicorn
uvicorn==0.10.3
uvloop==0.14.0rc2 ; sys_platform != "win32" and implementation_name == "cpython"
virtualenv==16.7.7 # via tox
wcwidth==0.1.7 # via pytest
webencodings==0.5.1 # via bleach
websockets==7.0 # via sanic, uvicorn
websockets==8.1 # via sanic, uvicorn
wrapt==1.11.2 # via astroid
wsproto==0.15.0 ; python_version >= "3.7"
zipp==0.6.0 # via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
# setuptools==41.4.0 # via sphinx, twine
# setuptools==41.6.0 # via sphinx, twine
aiocontextvars==0.2.2 ; python_version < "3.7"
contextvars==2.4 ; python_version < "3.7"
immutables==0.9 ; python_version < "3.7"
Expand Down
2 changes: 1 addition & 1 deletion tortoise/__init__.py
Expand Up @@ -655,4 +655,4 @@ async def do_stuff():
loop.run_until_complete(Tortoise.close_connections())


__version__ = "0.14.0"
__version__ = "0.14.1"

0 comments on commit a217378

Please sign in to comment.