Skip to content
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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/gino/__init__.py
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
Expand All @@ -14,18 +16,14 @@
def create_engine(*args, **kwargs):
"""
Shortcut for :func:`sqlalchemy.create_engine` with ``strategy="gino"``.

Copy link
Member

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?

.. 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:

Copy link
Member

Choose a reason for hiding this comment

The 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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
"""

Expand All @@ -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
Copy link
Member

Choose a reason for hiding this comment

The 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()
Expand Down