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

Update samples to support latest Google Cloud Python #656

Merged
merged 13 commits into from
Nov 15, 2016
2 changes: 1 addition & 1 deletion appengine/flexible/analytics/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Flask==0.11.1
gunicorn==19.6.0
requests[security]==2.11.1
requests[security]==2.12.0
2 changes: 1 addition & 1 deletion appengine/flexible/datastore/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Flask==0.11.1
google-cloud-datastore==0.20.1
google-cloud-datastore==0.21.0
gunicorn==19.6.0
oauth2client==4.0.0
2 changes: 1 addition & 1 deletion appengine/flexible/endpoints/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ flask-cors==3.0.2
gunicorn==19.6.0
six==1.10.0
pyyaml==3.12
requests==2.11.1
requests==2.12.0
2 changes: 1 addition & 1 deletion appengine/flexible/kinto/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
gunicorn==19.6.0
oauth2client==4.0.0
kinto==4.3.2
kinto==4.3.3
2 changes: 1 addition & 1 deletion appengine/flexible/mailgun/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Flask==0.11.1
gunicorn==19.6.0
requests[security]==2.11.1
requests[security]==2.12.0
2 changes: 1 addition & 1 deletion appengine/flexible/mailjet/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Flask==0.11.1
gunicorn==19.6.0
requests[security]==2.11.1
requests[security]==2.12.0
mailjet-rest==v1.2.2
2 changes: 1 addition & 1 deletion appengine/flexible/metadata/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Flask==0.11.1
gunicorn==19.6.0
requests[security]==2.11.1
requests[security]==2.12.0
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Flask==0.11.1
gunicorn==19.6.0
requests==2.11.1
requests==2.12.0
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Flask==0.11.1
gunicorn==19.6.0
requests==2.11.1
requests==2.12.0
2 changes: 1 addition & 1 deletion appengine/flexible/pubsub/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Flask==0.11.1
google-cloud-pubsub==0.20.0
google-cloud-pubsub==0.21.0
gunicorn==19.6.0
oauth2client==4.0.0
2 changes: 1 addition & 1 deletion appengine/flexible/sendgrid/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Flask==0.11.1
sendgrid==3.6.2
sendgrid==3.6.3
gunicorn==19.6.0
2 changes: 1 addition & 1 deletion appengine/flexible/storage/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Flask==0.11.1
google-cloud-storage==0.20.0
google-cloud-storage==0.21.0
gunicorn==19.6.0
2 changes: 1 addition & 1 deletion appengine/standard/analytics/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Flask==0.11.1
requests==2.11.1
requests==2.12.0
requests-toolbelt==0.7.0
2 changes: 1 addition & 1 deletion appengine/standard/firebase/firetactoe/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
flask==0.11.1
requests==2.11.1
requests==2.12.0
requests_toolbelt==0.7.0
oauth2client==4.0.0
functools32==3.2.3-2; python_version < "3"
2 changes: 1 addition & 1 deletion appengine/standard/mailjet/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Flask==0.11.1
requests==2.11.1
requests==2.12.0
requests-toolbelt==0.7.0
mailjet-rest==v1.2.2
2 changes: 1 addition & 1 deletion appengine/standard/sendgrid/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sendgrid==3.6.2
sendgrid==3.6.3
2 changes: 1 addition & 1 deletion appengine/standard/urlfetch/requests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Flask==0.11.1
requests==2.11.1
requests==2.12.0
requests-toolbelt==0.7.0
2 changes: 1 addition & 1 deletion bigquery/cloud-client/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
google-cloud-bigquery==0.20.0
google-cloud-bigquery==0.21.0
4 changes: 2 additions & 2 deletions bigquery/dml/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
flake8==3.0.4
google-cloud-bigquery==0.20.0
flake8==3.2.0
google-cloud-bigquery==0.21.0
PyMySQL==0.7.9
six==1.10.0
SQLAlchemy==1.1.3
2 changes: 1 addition & 1 deletion bigtable/hello/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
google-cloud-bigtable==0.20.0
google-cloud-bigtable==0.21.0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
google-cloud-datastore==0.20.1
google-cloud-datastore==0.21.0
2 changes: 1 addition & 1 deletion compute/auth/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
requests==2.11.1
requests==2.12.0
google-api-python-client==1.5.5
2 changes: 1 addition & 1 deletion compute/encryption/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cryptography==1.5.3
requests==2.11.1
requests==2.12.0
2 changes: 1 addition & 1 deletion compute/metadata/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
requests==2.11.1
requests==2.12.0
2 changes: 1 addition & 1 deletion compute/xmpp_wikibot/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Flask==0.11.1
requests==2.11.1
requests==2.12.0
sleekxmpp==1.3.1
six==1.10.0
2 changes: 1 addition & 1 deletion dataproc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
google-api-python-client==1.5.5
google-cloud==0.20.0
google-cloud==0.21.0
2 changes: 1 addition & 1 deletion datastore/cloud-client/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
google-cloud-datastore==0.20.1
google-cloud-datastore==0.21.0
2 changes: 1 addition & 1 deletion dns/api/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
google-cloud-dns==0.20.0
google-cloud-dns==0.21.0
2 changes: 1 addition & 1 deletion endpoints/getting-started/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ flask-cors==3.0.2
gunicorn==19.6.0
six==1.10.0
pyyaml==3.12
requests==2.11.1
requests==2.12.0
2 changes: 1 addition & 1 deletion language/movie_nl/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
google-api-python-client==1.5.5
requests==2.11.1
requests==2.12.0
2 changes: 1 addition & 1 deletion logging/cloud-client/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
google-cloud-logging==0.20.0
google-cloud-logging==0.21.0
16 changes: 14 additions & 2 deletions nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@

# Libraries that only work on Python 2.7
PY27_ONLY_LIBRARIES = ['mysql-python']
IGNORED_LIBRARIES = ['pylibmc']

# Whether we're running on Travis CI
ON_TRAVIS = os.environ.get('TRAVIS', False)
Expand Down Expand Up @@ -245,7 +246,7 @@ def session_lint(session):
sample_directories = (
sample_dir for subdir in subdirs if not subdir.startswith('.')
for sample_dir in collect_sample_dirs(
subdir, suffix='.py', blacklist='conftest.py'))
subdir, suffix='.py', blacklist='conftest.py'))

# On travis, only lint changed samples.
if ON_TRAVIS:
Expand Down Expand Up @@ -286,7 +287,7 @@ def session_reqcheck(session):
command = 'check-requirements'

reqfiles = list(list_files('.', 'requirements*.txt'))
reqfiles.append('requirements-dev.in')
reqfiles.append('testing/requirements-dev.in')

for reqfile in reqfiles:
session.run('gcprepotools', command, reqfile)
Expand All @@ -297,6 +298,7 @@ def session_reqrollup(session):

This does not test for uniqueness. pip itself will validate that.
"""
session.virtualenv = False
requirements = set()
requirements_files = list(list_files('.', 'requirements*.txt'))
requirements_files.append('./testing/requirements-dev.in')
Expand All @@ -317,9 +319,19 @@ def mark_if_necessary(requirement):
requirement.strip())
return requirement

def is_ignored(requirement):
"""Ignores certain libraries."""
for library in IGNORED_LIBRARIES:
if requirement.startswith(library):
return True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could do this more succinctly:

return any(requirement.startswith(l) for l in IGNORED_LIBRARIES)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it, but it's almost too clever. I'm going to leave as-is for now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't care either way but don't think it's too clever, a bit more English-esque if anything.


requirements = [
mark_if_necessary(requirement) for requirement in requirements]

requirements = [
requirement for requirement in requirements if not
is_ignored(requirement)]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could put this conditional in the previous comprehension, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather not.

with open('testing/requirements-dev.txt', 'w') as f:
f.write('# This file is generated by nox -s reqrollup. Do not edit.\n')
for requirement in sorted(requirements, key=lambda s: s.lower()):
Expand Down
2 changes: 1 addition & 1 deletion pubsub/cloud-client/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
google-cloud-pubsub==0.20.0
google-cloud-pubsub==0.21.0
2 changes: 1 addition & 1 deletion speech/grpc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
google-cloud-core==0.20.0
google-cloud-core==0.21.0
grpcio==1.0.1
PyAudio==0.2.9
grpc-google-cloud-speech-v1beta1==1.0.1
Expand Down
2 changes: 1 addition & 1 deletion storage/cloud-client/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
google-cloud-storage==0.20.0
google-cloud-storage==0.21.0
2 changes: 1 addition & 1 deletion testing/requirements-dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mock==2.0.0
mysql-python==1.2.5
PyCrypto==2.6.1
pytest-cov==2.4.0
pytest==3.0.3
pytest==3.0.4
pyyaml==3.12
responses==0.5.1
WebTest==2.0.23
37 changes: 18 additions & 19 deletions testing/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ beautifulsoup4==4.5.1
coverage==4.2
cryptography==1.5.3
Django==1.10.3
flake8==3.0.4
flake8==3.2.0
flaky==3.3.0
flask-cors==3.0.2
Flask-SQLAlchemy==2.1
Expand All @@ -13,24 +13,24 @@ fluent-logger==0.4.4
funcsigs==1.0.2
functools32==3.2.3-2; python_version < "3"
google-api-python-client==1.5.5
google-cloud-bigquery==0.20.0
google-cloud-bigtable==0.20.0
google-cloud-core==0.20.0
google-cloud-datastore==0.20.1
google-cloud-dns==0.20.0
google-cloud-bigquery==0.21.0
google-cloud-bigtable==0.21.0
google-cloud-core==0.21.0
google-cloud-datastore==0.21.0
google-cloud-dns==0.21.0
google-cloud-happybase==0.20.0
google-cloud-language==0.20.0
google-cloud-logging==0.20.0
google-cloud-pubsub==0.20.0
google-cloud-storage==0.20.0
google-cloud-translate==0.20.0
google-cloud-vision==0.20.0
google-cloud==0.20.0
google-cloud-language==0.21.0
google-cloud-logging==0.21.0
google-cloud-pubsub==0.21.0
google-cloud-storage==0.21.0
google-cloud-translate==0.21.0
google-cloud-vision==0.21.0
google-cloud==0.21.0
grpc-google-cloud-speech-v1beta1==1.0.1
grpcio==1.0.1
gunicorn==19.6.0
httplib2==0.9.2
kinto==4.3.2
kinto==4.3.3
mailjet-rest==v1.2.2
mock==2.0.0
mysql-python==1.2.5; python_version == '2.7'
Expand All @@ -43,20 +43,19 @@ pyasn1==0.1.9
PyAudio==0.2.9
PyCrypto==2.6.1
pyjwt==1.4.2
pylibmc==1.5.1
PyMySQL==0.7.9
pytest-cov==2.4.0
pytest==3.0.3
pytest==3.0.4
pyyaml==3.12
redis==2.10.5
requests-toolbelt==0.7.0
requests==2.11.1
requests[security]==2.11.1
requests==2.12.0
requests[security]==2.12.0
requests_toolbelt==0.7.0
responses==0.5.1
rsa==3.4.2
scipy==0.18.1
sendgrid==3.6.2
sendgrid==3.6.3
simplejson==3.10.0
six==1.10.0
sleekxmpp==1.3.1
Expand Down
2 changes: 1 addition & 1 deletion vision/cloud-client/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
google-cloud-vision==0.20.0
google-cloud-vision==0.21.0