Skip to content

Commit

Permalink
Removal of Python 2 support (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
wihl authored Nov 21, 2019
1 parent 06dc126 commit 13a96ee
Show file tree
Hide file tree
Showing 75 changed files with 120 additions and 251 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* 4.0.0:
- Removing support for Python 2

* 3.3.0:
- Google ads v2_2 release

Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Features

Requirements
------------
* Python 2.7.13+ / 3.5.3+
- **NOTE:** Python 2 support will cease by the end of 2019. See this `blog post`_ for more detail.
* Python 3.6.7+
- **NOTE:** Python 2 support has ceased as of v4.0. See this `blog post`_ for more detail.
* `pip`_


Expand Down
4 changes: 1 addition & 3 deletions examples/account_management/create_customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@
account.
"""

from __future__ import absolute_import

import argparse
import six
import sys
from datetime import datetime

Expand Down Expand Up @@ -73,7 +71,7 @@ def main(client, manager_customer_id):
parser = argparse.ArgumentParser(
description=('Creates a new client under the given manager.'))
# The following argument(s) should be provided to run the example.
parser.add_argument('-m', '--manager_customer_id', type=six.text_type,
parser.add_argument('-m', '--manager_customer_id', type=str,
required=True, help='A Google Ads customer ID for the '
'manager account under which the new customer will '
'be created.')
Expand Down
4 changes: 1 addition & 3 deletions examples/account_management/get_account_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@

"""This example gets the changes in the account made in the last 7 days."""

from __future__ import absolute_import

import argparse
import sys

import six

import google.ads.google_ads.client

Expand Down Expand Up @@ -113,7 +111,7 @@ def main(client, customer_id):
parser = argparse.ArgumentParser(
description=('Displays account changes that occurred in the last 7 days.'))
# The following argument(s) should be provided to run the example.
parser.add_argument('-c', '--customer_id', type=six.text_type,
parser.add_argument('-c', '--customer_id', type=str,
required=True, help='The Google Ads customer ID.')
args = parser.parse_args()

Expand Down
4 changes: 1 addition & 3 deletions examples/account_management/get_account_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
For example, its name, currency, time zone, etc.
"""

from __future__ import absolute_import

import argparse
import six
import sys

import google.ads.google_ads.client
Expand Down Expand Up @@ -61,7 +59,7 @@ def main(client, customer_id):
description=('Displays basic information about the specified '
'customer\'s advertising account.'))
# The following argument(s) should be provided to run the example.
parser.add_argument('-c', '--customer_id', type=six.text_type,
parser.add_argument('-c', '--customer_id', type=str,
required=True, help='The Google Ads customer ID.')
args = parser.parse_args()

Expand Down
6 changes: 2 additions & 4 deletions examples/account_management/link_manager_to_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
# limitations under the License.
"""This example shows how to link a manager customer to a client customer."""

from __future__ import absolute_import

import argparse
import six
import sys
import uuid
from datetime import datetime, timedelta
Expand Down Expand Up @@ -104,9 +102,9 @@ def main(client, customer_id, manager_customer_id):
description= ('Links and existing manager customer to an existing'
'client customer'))
# The following argument(s) should be provided to run the example.
parser.add_argument('-c', '--customer_id', type=six.text_type,
parser.add_argument('-c', '--customer_id', type=str,
required=True, help='The customer ID.')
parser.add_argument('-m', '--manager_customer_id', type=six.text_type,
parser.add_argument('-m', '--manager_customer_id', type=str,
required=True, help='The manager customer ID.')
args = parser.parse_args()

Expand Down
1 change: 0 additions & 1 deletion examples/account_management/list_accessible_customers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
documentation: https://developers.google.com/google-ads/api/docs/concepts/call-structure#login-customer-id
"""

from __future__ import absolute_import

import sys

Expand Down
6 changes: 2 additions & 4 deletions examples/advanced_operations/add_ad_group_bid_modifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
To get ad group bid modifiers, run get_ad_group_bid_modifiers.py
"""

from __future__ import absolute_import

import argparse
import six
import sys

import google.ads.google_ads.client
Expand Down Expand Up @@ -77,9 +75,9 @@ def main(client, customer_id, ad_group_id, bid_modifier_value):
description=('Adds an ad group bid modifier to the specified ad group '
'ID, for the given customer ID.'))
# The following argument(s) should be provided to run the example.
parser.add_argument('-c', '--customer_id', type=six.text_type,
parser.add_argument('-c', '--customer_id', type=str,
required=True, help='The Google Ads customer ID.')
parser.add_argument('-a', '--ad_group_id', type=six.text_type,
parser.add_argument('-a', '--ad_group_id', type=str,
required=True, help='The ad group ID.')
parser.add_argument('-b', '--bid_modifier_value', type=float,
required=False, default=1.5,
Expand Down
8 changes: 3 additions & 5 deletions examples/advanced_operations/add_dynamic_page_feed.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
campaigns run basic_operations/get_campaigns.py.
"""

from __future__ import absolute_import

import argparse
import six
import sys
import uuid
from datetime import datetime, timedelta
Expand Down Expand Up @@ -351,11 +349,11 @@ def add_dsa_targeting(client, customer_id, ad_group_resource_name, label):
description= ('Adds a page feed with URLs for a Dynamic Search Ads '
'Campaign.'))
# The following argument(s) should be provided to run the example.
parser.add_argument('-c', '--customer_id', type=six.text_type,
parser.add_argument('-c', '--customer_id', type=str,
required=True, help='The Google Ads customer ID.')
parser.add_argument('-i', '--campaign_id', type=six.text_type,
parser.add_argument('-i', '--campaign_id', type=str,
required=True, help='The campaign ID.')
parser.add_argument('-a', '--ad_group_id', type=six.text_type,
parser.add_argument('-a', '--ad_group_id', type=str,
required=True, help='The ad group ID.')
args = parser.parse_args()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
To get campaigns, run basic_operations/get_campaigns.py
"""

from __future__ import absolute_import

import argparse
import six
import sys
from uuid import uuid4
from datetime import datetime, timedelta
Expand Down Expand Up @@ -266,7 +264,7 @@ def add_webpage_criteria(client, customer_id, ad_group_resource_name):
description=('Adds a Dynamic Search Ad campaign under the specified '
'customer ID.'))
# The following argument(s) should be provided to run the example.
parser.add_argument('-c', '--customer_id', type=six.text_type,
parser.add_argument('-c', '--customer_id', type=str,
required=True, help='The Google Ads customer ID.')
args = parser.parse_args()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
# limitations under the License.
"""This adds an expanded text ad using advanced features of upgraded URLs."""

from __future__ import absolute_import

import argparse
import six
import sys

import google.ads.google_ads.client
Expand Down Expand Up @@ -102,9 +100,9 @@ def main(client, customer_id, ad_group_id):
description=('Adds an expanded text ad to the specified ad group ID, '
'for the given customer ID.'))
# The following argument(s) should be provided to run the example.
parser.add_argument('-c', '--customer_id', type=six.text_type,
parser.add_argument('-c', '--customer_id', type=str,
required=True, help='The Google Ads customer ID.')
parser.add_argument('-a', '--ad_group_id', type=six.text_type,
parser.add_argument('-a', '--ad_group_id', type=str,
required=True, help='The ad group ID.')
args = parser.parse_args()

Expand Down
6 changes: 2 additions & 4 deletions examples/advanced_operations/add_gmail_ad.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
DISPLAY_GMAIL_AD. To get ad groups, run basic_operations/get_ad_groups.py
"""

from __future__ import absolute_import

import argparse
import six
import sys
from uuid import uuid4
import requests
Expand Down Expand Up @@ -124,9 +122,9 @@ def get_image(url):
description=('Adds a gmail ad to the specified ad group ID, '
'for the given customer ID.'))
# The following argument(s) should be provided to run the example.
parser.add_argument('-c', '--customer_id', type=six.text_type,
parser.add_argument('-c', '--customer_id', type=str,
required=True, help='The Google Ads customer ID.')
parser.add_argument('-a', '--ad_group_id', type=six.text_type,
parser.add_argument('-a', '--ad_group_id', type=str,
required=True, help='The ad group ID.')
args = parser.parse_args()

Expand Down
4 changes: 1 addition & 3 deletions examples/advanced_operations/add_sitelink.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
# limitations under the License.
"""Demonstrates how to create a sitelink extension."""

from __future__ import absolute_import

import argparse
import six
import sys

from google.ads.google_ads.client import GoogleAdsClient
Expand Down Expand Up @@ -62,7 +60,7 @@ def main(client, customer_id):
parser = argparse.ArgumentParser(
description='Creates sitelink for the specified customer id')
# The following argument(s) should be provided to run the example.
parser.add_argument('-c', '--customer_id', type=six.text_type,
parser.add_argument('-c', '--customer_id', type=str,
required=True, help='The Google Ads customer ID')
args = parser.parse_args()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
Note that the keywords will be attached to the specified campaign.
"""

from __future__ import absolute_import

import argparse
import six
import sys
import uuid

Expand Down Expand Up @@ -123,9 +121,9 @@ def main(client, customer_id, campaign_id):
description=('Adds a list of negative broad match keywords to the '
'provided campaign, for the specified customer.'))
# The following argument(s) should be provided to run the example.
parser.add_argument('-c', '--customer_id', type=six.text_type,
parser.add_argument('-c', '--customer_id', type=str,
required=True, help='The Google Ads customer ID.')
parser.add_argument('-i', '--campaign_id', type=six.text_type,
parser.add_argument('-i', '--campaign_id', type=str,
required=True, help='The campaign ID.')
args = parser.parse_args()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
# limitations under the License.
"""Demonstrates how to find and remove shared sets, and shared set criteria."""

from __future__ import absolute_import

import argparse
import six
import sys

import google.ads.google_ads.client
Expand Down Expand Up @@ -130,9 +128,9 @@ def main(client, customer_id, page_size, campaign_id):
description=('Finds shared sets, then finds and removes shared set '
'criteria under them.'))
# The following argument(s) should be provided to run the example.
parser.add_argument('-c', '--customer_id', type=six.text_type,
parser.add_argument('-c', '--customer_id', type=str,
required=True, help='The Google Ads customer ID.')
parser.add_argument('-i', '--campaign_id', type=six.text_type,
parser.add_argument('-i', '--campaign_id', type=str,
required=True, help='The campaign ID.')
args = parser.parse_args()

Expand Down
6 changes: 2 additions & 4 deletions examples/advanced_operations/get_ad_group_bid_modifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
# limitations under the License.
"""This example illustrates how to retrieve ad group bid modifiers."""

from __future__ import absolute_import

import argparse
import six
import sys
import google.ads.google_ads.client

Expand Down Expand Up @@ -70,9 +68,9 @@ def main(client, customer_id, page_size, ad_group_id=None):
parser = argparse.ArgumentParser(
description='List ad group bid modifiers for specified customer.')
# The following argument(s) should be provided to run the example.
parser.add_argument('-c', '--customer_id', type=six.text_type,
parser.add_argument('-c', '--customer_id', type=str,
required=True, help='The Google Ads customer ID.')
parser.add_argument('-a', '--ad_group_id', type=six.text_type,
parser.add_argument('-a', '--ad_group_id', type=str,
required=False,
help=('The ad group ID. Specify this to list ad group '
'bid modifiers solely for this ad group ID.'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
# limitations under the License.
"""This example constructs a campaign with a Portfolio Bidding Strategy."""

from __future__ import absolute_import

import argparse
import six
import sys
import uuid

Expand Down Expand Up @@ -137,7 +135,7 @@ def main(client, customer_id):
parser = argparse.ArgumentParser(
description='Adds a campaign for specified customer.')
# The following argument(s) should be provided to run the example.
parser.add_argument('-c', '--customer_id', type=six.text_type,
parser.add_argument('-c', '--customer_id', type=str,
required=True, help='The Google Ads customer ID.')
args = parser.parse_args()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
It is intended to be run from the command line and requires user input.
"""

from __future__ import absolute_import

import argparse

Expand Down
1 change: 0 additions & 1 deletion examples/authentication/authenticate_in_web_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
It is intended to be run from the command line and requires user input.
"""

from __future__ import absolute_import

import argparse

Expand Down
6 changes: 2 additions & 4 deletions examples/basic_operations/add_ad_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
To get ad groups, run get_ad_groups.py.
"""

from __future__ import absolute_import

import argparse
import six
import sys
import uuid

Expand Down Expand Up @@ -68,9 +66,9 @@ def main(client, customer_id, campaign_id):
parser = argparse.ArgumentParser(
description='Adds an ad group for specified customer and campaign id.')
# The following argument(s) should be provided to run the example.
parser.add_argument('-c', '--customer_id', type=six.text_type,
parser.add_argument('-c', '--customer_id', type=str,
required=True, help='The Google Ads customer ID.')
parser.add_argument('-i', '--campaign_id', type=six.text_type,
parser.add_argument('-i', '--campaign_id', type=str,
required=True, help='The campaign ID.')
args = parser.parse_args()

Expand Down
4 changes: 1 addition & 3 deletions examples/basic_operations/add_campaigns.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@
To get campaigns, run get_campaigns.py.
"""

from __future__ import absolute_import

import argparse
import datetime
import six
import sys
import uuid

Expand Down Expand Up @@ -118,7 +116,7 @@ def main(client, customer_id):
parser = argparse.ArgumentParser(
description='Adds a campaign for specified customer.')
# The following argument(s) should be provided to run the example.
parser.add_argument('-c', '--customer_id', type=six.text_type,
parser.add_argument('-c', '--customer_id', type=str,
required=True, help='The Google Ads customer ID.')
args = parser.parse_args()

Expand Down
Loading

0 comments on commit 13a96ee

Please sign in to comment.