Skip to content

Commit d239bd8

Browse files
authored
Drop support for Python 2.7 (EOL) (#192)
* Drop support for Python 2 and EOL Python 3.X versions * Update README - Drop support for Python 2 - Drop support for EOL Python 3.x versions - Update PyPy version * change print statement to function
1 parent b9eef14 commit d239bd8

8 files changed

+14
-17
lines changed

.travis.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ branches:
99
matrix:
1010
fast_finish: true
1111
include:
12-
- python: 2.7
13-
script: python setup.py flake8 && python setup.py test
1412
- python: 3.5
1513
script: python setup.py flake8 && python setup.py test
1614
- python: 3.6
@@ -20,4 +18,4 @@ matrix:
2018
- python: pypy
2119
script: python setup.py flake8 && python setup.py test
2220
- python: pypy3
23-
script: python setup.py flake8 && python setup.py test
21+
script: python setup.py flake8 && python setup.py test

README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ For more help please see our `Examples and Guides`_ or check the online
5959
Compatibility & Versioning
6060
--------------------------
6161

62-
This project is designed to work with Python 2.7 or greater. While it
62+
This project is designed to work with Python 3.5 or greater. While it
6363
may work on other version of Python, below are the platform and runtime
6464
versions we officially support and regularly test against.
6565

6666
+------------+-------------------------+
6767
| Platform | Versions |
6868
+============+=========================+
69-
| CPython | 2.7, 3.5, 3.6, 3.7 |
69+
| CPython | 3.5, 3.6, 3.7 |
7070
+------------+-------------------------+
7171
| PyPy | 7.x |
7272
+------------+-------------------------+

examples/account_media.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
line_item_id = account.line_items().first.id
2424

2525
# retrive the `id` of the media creative associated with a line item
26-
print account.media_creatives().first.id
26+
print(account.media_creatives().first.id)
2727

2828
# retrieve the `id` of the first account media associated with the account
2929
account_media_id = account.account_media().first.id

examples/cards_fetch.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525

2626
# fetch by card_uri
2727
card = CardsFetch.load(account, card_uris=[card_uri]).first
28-
print card
29-
print card.card_type
30-
print card.id
28+
print(card)
29+
print(card.card_type)
30+
print(card.id)
3131

3232
# fetch by card id
3333
same_card = CardsFetch.load(account, card_id=card.id)
34-
print same_card.card_type
35-
print same_card.card_uri
34+
print(same_card.card_type)
35+
print(same_card.card_uri)

examples/manual_request.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
print(response.body['data'][0])
3131
except Error as e:
3232
# see twitter_ads.error for more details
33-
print e.details
33+
print(e.details)
3434
raise
3535

3636
# you can also manually construct requests to be

examples/tailored_audience.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@
3636
# update the tailored audience
3737
success_count, total_count = audience.users(user)
3838
if success_count == total_count:
39-
print "Successfully added {total_count} users".format(total_count=total_count)
39+
print(("Successfully added {total_count} users").format(total_count=total_count))

examples/video_tutorial.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
#grab the video_id from the response
3333
video_id = video.id
34-
print video_id
34+
print(video_id)
3535

3636
account_media = AccountMedia(account)
3737
account_media.video_id = video_id
@@ -76,7 +76,7 @@
7676
response = Request(client, 'post', resource, params=params).perform()
7777
except Error as e:
7878
# see twitter_ads.error for more details
79-
print e.details
79+
print(e.details)
8080
raise
8181

8282
resource = '/' + API_VERSION + '/batch/accounts/18ce54bgxky/targeting_criteria'.format(account_id=account.id)
@@ -106,7 +106,7 @@
106106
response = Request(client, 'post', resource, params=params).perform()
107107
except Error as e:
108108
# see twitter_ads.error for more details
109-
print e.details
109+
print(e.details)
110110
raise
111111

112112
# unpause the campaign

setup.py

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ def get_version(version_tuple):
2727
'License :: OSI Approved :: MIT License',
2828
'Operating System :: OS Independent',
2929
'Programming Language :: Python',
30-
'Programming Language :: Python :: 2.7',
3130
'Programming Language :: Python :: 3',
3231
'Programming Language :: Python :: 3.5',
3332
'Programming Language :: Python :: 3.6',

0 commit comments

Comments
 (0)