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

Deprecation warning for python3.6 #640

Merged
merged 6 commits into from
Oct 8, 2021
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ Halle Jones|HJones@aliacy.com||
[Mateus Denucci Garcia Seabra Resende](https://github.com/MateusDenucci) | |
[Victor Hart](https://github.com/vicohart) | [vicohart@gmail.com](vicohart@gmail.com) |
[nilamo](https://github.com/nilamo) | [7nilamo@gmail.com](7nilamo@gmail.com) |
[Abhijeet](https://github.com/abhijeetgupto) |[abhigupta7b@gmail.com](abhigupta7b@gmail.com) | [@abhijeetgupto](https://twitter.com/abhijeetgupto)|
[Abhijeet](https://github.com/abhijeetgupto) |[abhigupta7b@gmail.com](abhigupta7b@gmail.com) | [@abhijeetgupto](https://twitter.com/abhijeetgupto)|
[Michael duBois](https://github.com/MichaelCduBois) | |
27 changes: 27 additions & 0 deletions ppb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"""

import logging
from sys import version_info
from typing import Callable

from ppb import directions
Expand Down Expand Up @@ -73,6 +74,30 @@ def _make_kwargs(setup, title, engine_opts):
return kwargs


def _validate_python_support(required_version='3.7', ppb_release='2.0',
release_date='June 2022'):
"""
Verifies Supported Python Version.

This function verifies ppb is running on a supported Python version.

:param required_version: Minimum Python Version Supported by PPB
:type required_version: str
:param ppb_release: PPB release version deprecation will occur
:type ppb_release: str
:param release_date: Estimated release month for PPB Version
:type release_date: str
"""
# Creates (Major, Minor) version tuples for comparisson
if version_info[0:2] <= tuple(map(int, required_version.split('.'))):
deprecation_message = f"PPB v{ppb_release} will no longer support "\
f"Python {version_info[0]}.{version_info[1]} " \
f"once released around {release_date}. Please " \
f"update to Python {required_version} or newer."
warnings.filterwarnings('default')
warnings.warn(deprecation_message, DeprecationWarning)


def run(setup: Callable[[Scene], None] = None, *, log_level=logging.WARNING,
starting_scene=Scene, title="PursuedPyBear", **engine_opts):
"""
Expand Down Expand Up @@ -122,6 +147,8 @@ def __init__(self, **kwargs):
"""
logging.basicConfig(level=log_level)

_validate_python_support()

with make_engine(setup, starting_scene=starting_scene, title=title, **engine_opts) as eng:
eng.run()

Expand Down