Skip to content

Commit

Permalink
Enforce Python 3.6 or greater for async
Browse files Browse the repository at this point in the history
  • Loading branch information
aaront committed Sep 15, 2022
1 parent 6e288e8 commit 5407f7c
Show file tree
Hide file tree
Showing 7 changed files with 292 additions and 347 deletions.
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pytest-cov = "*"
rope = "*"
mygeotab = {editable = true,path = "."}
mypy = {markers = "python_version >= '3.5'",version = "*"}
pytest-asyncio = {markers = "python_version >= '3.5'",version = "*"}
pytest-asyncio = {markers = "python_version >= '3.6'",version = "*"}
sphinx = {markers = "python_version >= '3'",version = "*"}
sphinx-rtd-theme = {markers = "python_version >= '3'",version = "*"}
black = {markers = "python_version >= '3.6'",version = "*"}
Expand Down
623 changes: 284 additions & 339 deletions Pipfile.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ It's very easy to get started once you've registered a `MyGeotab <https://www.ge
# 'idleMinutes': 3.0,
# ......
If you're using Python 3.5 and higher, you can also make calls asynchronously via `asyncio <https://docs.python.org/3/library/asyncio.html>`__:
If you're using Python 3.6 and higher, you can also make calls asynchronously via `asyncio <https://docs.python.org/3/library/asyncio.html>`__:

.. code-block:: python
Expand Down
6 changes: 3 additions & 3 deletions mygeotab/py3/api_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
mygeotab.py3.api_async
~~~~~~~~~~~~~~~~~~~~~~
Async/Await-able (Python 3.5+) public objects and methods wrapping the MyGeotab API.
Async/Await-able (Python 3.6+) public objects and methods wrapping the MyGeotab API.
"""

import asyncio
import sys

if sys.version_info < (3, 5):
raise Exception("Python 3.5+ is required to use the async API")
if sys.version_info < (3, 6):
raise Exception("Python 3.6+ is required to use the async API")
import ssl
from concurrent.futures import TimeoutError

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
raise RuntimeError("This package requres Python 2.7.9+")

packages = ["mygeotab", "mygeotab.ext"]
if py_version >= (3, 5, 0):
if py_version >= (3, 6, 0):
packages.append("mygeotab.async") # Deprecated
packages.append("mygeotab.py3")

Expand Down
2 changes: 1 addition & 1 deletion tests/test_api_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
USERNAME = os.environ.get("MYGEOTAB_USERNAME_ASYNC", USERNAME)
PASSWORD = os.environ.get("MYGEOTAB_PASSWORD_ASYNC", PASSWORD)

pytestmark = pytest.mark.skipif(sys.version_info < (3, 5), reason="Only testing API on Python 3.5")
pytestmark = pytest.mark.skipif(sys.version_info < (3, 6), reason="Only testing API on Python 3.6")


@pytest.fixture(scope="session")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_api_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def mock_api():

@pytest.mark.skip("Too slow to run automatically")
class TestApiPerformance:
@pytest.mark.skipif(sys.version_info < (3, 5), reason="Requires Python 3.5 or higher")
@pytest.mark.skipif(sys.version_info < (3, 6), reason="Requires Python 3.6 or higher")
def test_timeout_large_json_rapidjson(self, mock_api, datadir, benchmark):
server = "https://example.com/apiv1"
json_response = (datadir / "big_nested_date_response.json").read_text()
Expand Down

0 comments on commit 5407f7c

Please sign in to comment.