Skip to content

Commit 8d58d2e

Browse files
authored
Remove py2 support (#786)
1 parent 5e125a1 commit 8d58d2e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1118
-2017
lines changed

.travis.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
11
language: python
22

33
python:
4+
- "3.7"
45
- "3.6"
5-
- "3.5"
6-
- "2.7"
7-
- "pypy"
8-
9-
10-
# See https://github.com/travis-ci/travis-ci/issues/9815
11-
matrix:
12-
include:
13-
- python: "3.7"
14-
dist: xenial
15-
sudo: true
16-
17-
env:
18-
- AWS_SECRET_ACCESS_KEY=fake_key AWS_ACCESS_KEY_ID=fake_id
6+
- "pypy3"
197

208
install:
219
- pip install -e .[signals] -r requirements-dev.txt

README.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ From GitHub::
3434
$ pip install git+https://github.com/pynamodb/PynamoDB#egg=pynamodb
3535

3636
From conda-forge::
37-
37+
3838
$ conda install -c conda-forge pynamodb
3939

4040
Upgrading
@@ -228,7 +228,7 @@ Want to backup and restore a table? No problem.
228228
Features
229229
========
230230

231-
* Python >= 3.3, and 2.7 support
231+
* Python >= 3.5 support
232232
* An ORM-like interface with query and scan filters
233233
* Compatible with DynamoDB Local
234234
* Supports the entire DynamoDB API
@@ -240,4 +240,3 @@ Features
240240
* Complex queries
241241
* Batch operations with automatic pagination
242242
* Iterators for working with Query and Scan operations
243-

docs/logging.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Here is an example showing how to enable logging for PynamoDB:
88

99
.. code-block:: python
1010
11-
from __future__ import print_function
1211
import logging
1312
from pynamodb.models import Model
1413
from pynamodb.attributes import (

examples/attributes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""
22
A PynamoDB example using a custom attribute
33
"""
4-
from __future__ import print_function
54
import pickle
65
from pynamodb.attributes import BinaryAttribute, UnicodeAttribute
76
from pynamodb.models import Model

examples/connection.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""
22
Examples using a connection
33
"""
4-
from __future__ import print_function
54
from pynamodb.connection import Connection
65

76
# Get a connection

examples/model.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
44
http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SampleTablesAndData.html
55
"""
6-
from __future__ import print_function
76
import logging
87
from pynamodb.models import Model
98
from pynamodb.attributes import (

examples/url_shortener/shortener.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""
22
A fully working url shortener example
33
"""
4-
from __future__ import print_function
54
import flask
65
from hashlib import md5
76
from base64 import b64encode

pynamodb/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
"""
88
__author__ = 'Jharrod LaFon'
99
__license__ = 'MIT'
10-
__version__ = '4.3.3'
10+
__version__ = '5.0.0b1'

pynamodb/_compat.py

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,6 @@
1-
import six
2-
import sys
1+
from typing import Generic, TYPE_CHECKING
32

4-
if six.PY2:
5-
from inspect import getargspec as getfullargspec
3+
if TYPE_CHECKING:
4+
GenericMeta = type # to avoid dynamic base class
65
else:
7-
from inspect import getfullargspec
8-
9-
10-
class FakeGenericMeta(type):
11-
"""Poor man's Generic[T] that doesn't depend on typing. The real generics are in the type stubs."""
12-
def __getitem__(self, item):
13-
return self
14-
15-
16-
def load_module(name, path):
17-
"""Load module using the Python version compatible function."""
18-
if sys.version_info >= (3, 3):
19-
from importlib.machinery import SourceFileLoader
20-
21-
# Typeshed is incorrect in requiring a string arg to `load_module`,
22-
# as this works with no args or a None arg.
23-
# Even `load_module` is now deprecated, so we should update to just
24-
# using the following approach in >= python 3.5:
25-
# https://docs.python.org/3/library/importlib.html#importing-a-source-file-directly
26-
loader = SourceFileLoader(name, path)
27-
return loader.load_module() # type: ignore
28-
else:
29-
from imp import load_source
30-
return load_source(name, path)
31-
32-
33-
__all__ = ('getfullargspec', 'FakeGenericMeta', 'load_module')
6+
GenericMeta = type(Generic)

0 commit comments

Comments
 (0)