-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add deprecation warning for 3.5 and lower #783
base: master
Are you sure you want to change the base?
Changes from 5 commits
806dde1
4acc65b
2254489
7b3464b
da51cb3
91d69b0
de62b50
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
import logging | ||
import sys | ||
import warnings | ||
|
||
from .api import Gino # NOQA | ||
from .bakery import Bakery | ||
|
@@ -14,18 +16,14 @@ | |
def create_engine(*args, **kwargs): | ||
""" | ||
Shortcut for :func:`sqlalchemy.create_engine` with ``strategy="gino"``. | ||
|
||
.. versionchanged:: 1.1 | ||
Added the ``bakery`` keyword argument, please see :class:`~.bakery.Bakery`. | ||
|
||
.. versionchanged:: 1.1 | ||
Added the ``prebake`` keyword argument to choose when to create the prepared | ||
statements for the queries in the bakery: | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this new line was to keep the markdown docs structure, the same for line 28. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They had been removed by the formatter in my IDE. Has been fixed |
||
* **Pre-bake** immediately when connected to the database (default). | ||
* No **pre-bake** but create prepared statements lazily when needed for the first | ||
time. | ||
|
||
Note: ``prebake`` has no effect in aiomysql | ||
""" | ||
|
||
|
@@ -45,6 +43,15 @@ def get_version(): | |
return version("gino") | ||
|
||
|
||
# Check if current python version is deprecated | ||
# Check if version is lower than 3.6 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick: this is quite obvious by the statement itself |
||
if sys.version_info < (3, 6): | ||
warnings.warn( | ||
"DEPRECATION WARNING: Python version 3.5 and lower are not supported", | ||
DeprecationWarning, | ||
) | ||
|
||
|
||
# noinspection PyBroadException | ||
try: | ||
__version__ = get_version() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add these two lines back too?