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 all 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
13 changes: 11 additions & 2 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,10 +16,8 @@
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:
Expand Down Expand Up @@ -45,6 +45,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