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

Change gcloud package to google.cloud #2223

Merged
merged 24 commits into from
Sep 7, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
261c969
Renaming gcloud/ directory to google/cloud/.
dhermes Sep 3, 2016
e55a1d8
Renaming "import gcloud" statements as google.cloud.
dhermes Sep 3, 2016
416071b
Renaming "from gcloud import *" statements as google.cloud.
dhermes Sep 3, 2016
835578f
Renaming ">>> from gcloud.foo.bar import *" statements as google.cloud.
dhermes Sep 3, 2016
d05a9d4
Updating gcloud->google.cloud imports in gRPC rewrite scripts.
dhermes Sep 3, 2016
822e719
Rename remaining "gcloud" imports as "google.cloud".
dhermes Sep 3, 2016
ab18ce8
Renaming mentions of "gcloud-python" as "google-cloud-python".
dhermes Sep 3, 2016
c13d2ec
Renaming mentions of "hack-on-gcloud" as "hack-on-google-cloud-python".
dhermes Sep 3, 2016
f29999a
Renaming mentions of "gcloud" docs automodules as "google.cloud".
dhermes Sep 3, 2016
f12fee4
Renaming docs mentions of "gcloud" as "google-cloud".
dhermes Sep 3, 2016
ae89f77
Renaming docs path in JSON docs (gcloud->google/cloud).
dhermes Sep 3, 2016
381d236
Replacing usage of gcloud with google-cloud in docs config.
dhermes Sep 3, 2016
3649f3a
Replacing gcloud with google-cloud in scripts directory.
dhermes Sep 3, 2016
ab59f8d
Renaming all GCLOUD_* env. vars. as GOOGLE_CLOUD_*.
dhermes Sep 3, 2016
e12cc95
Renaming all GCloudError as GoogleCloudError.
dhermes Sep 3, 2016
faab61c
Renaming all ~gcloud references as google.cloud.
dhermes Sep 3, 2016
5910b22
Cleaning up remaining renames of gcloud->google-cloud.
dhermes Aug 29, 2016
e6139ac
Adding __init__.py to make google/ a package.
dhermes Sep 3, 2016
73d2986
Adding __init__.py to make google/ a package.
dhermes Aug 30, 2016
adf5e21
Fixing lint issues after package rename.
dhermes Aug 30, 2016
e03a7f8
Fixing docs issues after package rename.
dhermes Sep 3, 2016
c2c9f4d
Updating coveragerc omit section for namespace collisions.
dhermes Sep 3, 2016
4534d9a
Restoring most services as non-namespace packages.
dhermes Sep 6, 2016
fee8d0d
Removing json-docs from Travis config.
dhermes Sep 6, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Renaming all GCLOUD_* env. vars. as GOOGLE_CLOUD_*.
Done via:

$ git grep -l 'GCLOUD_' | \
> xargs sed -i s/'GCLOUD_'/'GOOGLE_CLOUD_'/g
  • Loading branch information
dhermes committed Sep 6, 2016
commit ab59f8d725949e00dd6efc503c8ac1057fd3f406
10 changes: 5 additions & 5 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ Coding Style
- In order to make ``tox -e lint`` run faster, you can set some environment
variables::

export GCLOUD_REMOTE_FOR_LINT="upstream"
export GCLOUD_BRANCH_FOR_LINT="master"
export GOOGLE_CLOUD_REMOTE_FOR_LINT="upstream"
export GOOGLE_CLOUD_BRANCH_FOR_LINT="master"

By doing this, you are specifying the location of the most up-to-date
version of ``google-cloud-python``. The the suggested remote name ``upstream``
Expand Down Expand Up @@ -153,7 +153,7 @@ Running System Tests
so you'll need to provide some environment variables to facilitate
authentication to your project:

- ``GCLOUD_TESTS_PROJECT_ID``: Developers Console project ID (e.g.
- ``GOOGLE_CLOUD_TESTS_PROJECT_ID``: Developers Console project ID (e.g.
bamboo-shift-455).
- ``GOOGLE_APPLICATION_CREDENTIALS``: The path to a JSON key file;
see ``system_tests/app_credentials.json.sample`` as an example. Such a file
Expand Down Expand Up @@ -187,7 +187,7 @@ Running System Tests

# Create the indexes
$ gcloud preview datastore create-indexes system_tests/data/index.yaml \
> --project=$GCLOUD_TESTS_PROJECT_ID
> --project=$GOOGLE_CLOUD_TESTS_PROJECT_ID

# Restore your environment to its previous state.
$ unset CLOUDSDK_PYTHON_SITEPACKAGES
Expand Down Expand Up @@ -230,7 +230,7 @@ Running System Tests

$ DATASTORE_HOST=http://localhost:8471 \
> DATASTORE_DATASET=gcloud-settings-app-id \
> GCLOUD_NO_PRINT=true \
> GOOGLE_CLOUD_NO_PRINT=true \
> python system_tests/run_system_test.py \
> --package=datastore --ignore-requirements

Expand Down
2 changes: 1 addition & 1 deletion docs/bigquery-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Authentication / Configuration
:meth:`from_service_account_p12 <google.cloud.bigquery.client.Client.from_service_account_p12>`.

- After setting :envvar:`GOOGLE_APPLICATION_CREDENTIALS` and
:envvar:`GCLOUD_PROJECT` environment variables, create an instance of
:envvar:`GOOGLE_CLOUD_PROJECT` environment variables, create an instance of
:class:`Client <google.cloud.bigquery.client.Client>`.

.. doctest::
Expand Down
2 changes: 1 addition & 1 deletion docs/bigtable-client-intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Configuration
see :doc:`gcloud-auth`.

- In addition to any authentication configuration, you can also set the
:envvar:`GCLOUD_PROJECT` environment variable for the Google Cloud Console
:envvar:`GOOGLE_CLOUD_PROJECT` environment variable for the Google Cloud Console
project you'd like to interact with. If your code is running in Google App
Engine or Google Compute Engine the project will be detected automatically.
(Setting this environment variable is not required, you may instead pass the
Expand Down
2 changes: 1 addition & 1 deletion docs/error-reporting-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Authentication and Configuration
see :doc:`gcloud-auth`.

- In addition to any authentication configuration, you should also set the
:envvar:`GCLOUD_PROJECT` environment variable for the project you'd like
:envvar:`GOOGLE_CLOUD_PROJECT` environment variable for the project you'd like
to interact with. If you are Google App Engine or Google Compute Engine
this will be detected automatically.

Expand Down
4 changes: 2 additions & 2 deletions docs/gcloud-config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ For example:
When creating a client in this way, the project ID will be determined by
searching these locations in the following order.

* GCLOUD_PROJECT environment variable
* GOOGLE_CLOUD_PROJECT environment variable
* GOOGLE_APPLICATION_CREDENTIALS JSON file
* Default service configuration path from
``$ gcloud beta auth application-default login``.
Expand Down Expand Up @@ -49,7 +49,7 @@ Logging in via ``gcloud beta auth application-default login`` will
automatically configure a JSON key file with your default project ID and
credentials.

Setting the ``GOOGLE_APPLICATION_CREDENTIALS`` and ``GCLOUD_PROJECT``
Setting the ``GOOGLE_APPLICATION_CREDENTIALS`` and ``GOOGLE_CLOUD_PROJECT``
environment variables will override the automatically configured credentials.

You can change your default project ID to ``my-new-default-project`` by
Expand Down
6 changes: 3 additions & 3 deletions docs/logging-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ Authentication and Configuration
see :doc:`gcloud-auth`.

- In addition to any authentication configuration, you should also set the
:envvar:`GCLOUD_PROJECT` environment variable for the project you'd like
:envvar:`GOOGLE_CLOUD_PROJECT` environment variable for the project you'd like
to interact with. If you are Google App Engine or Google Compute Engine
this will be detected automatically.

- The library now enables the ``gRPC`` transport for the logging API by
default, assuming that the required dependencies are installed and
importable. To *disable* this transport, set the
:envvar:`GCLOUD_DISABLE_GAX` environment variable to a non-empty string,
e.g.: ``$ export GCLOUD_DISABLE_GAX=1``.
:envvar:`GOOGLE_CLOUD_DISABLE_GAX` environment variable to a non-empty string,
e.g.: ``$ export GOOGLE_CLOUD_DISABLE_GAX=1``.

- After configuring your environment, create a
:class:`Client <google.cloud.logging.client.Client>`
Expand Down
2 changes: 1 addition & 1 deletion docs/monitoring-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ It is thus typical to create a client object as follows::

If you are running in Google Compute Engine or Google App Engine,
the current project is the default target project. This default
can be further overridden with the :envvar:`GCLOUD_PROJECT`
can be further overridden with the :envvar:`GOOGLE_CLOUD_PROJECT`
environment variable. Using the default target project is
even easier::

Expand Down
8 changes: 4 additions & 4 deletions docs/pubsub-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ Authentication / Configuration
your applications.

- In addition to any authentication configuration, you should also set the
:envvar:`GCLOUD_PROJECT` environment variable for the project you'd like
:envvar:`GOOGLE_CLOUD_PROJECT` environment variable for the project you'd like
to interact with. If you are Google App Engine or Google Compute Engine
this will be detected automatically.

- The library now enables the ``gRPC`` transport for the pubsub API by
default, assuming that the required dependencies are installed and
importable. To *disable* this transport, set the
:envvar:`GCLOUD_DISABLE_GAX` environment variable to a non-empty string,
e.g.: ``$ export GCLOUD_DISABLE_GAX=1``.
:envvar:`GOOGLE_CLOUD_DISABLE_GAX` environment variable to a non-empty string,
e.g.: ``$ export GOOGLE_CLOUD_DISABLE_GAX=1``.

- :class:`Client <google.cloud.pubsub.client.Client>` objects hold both a ``project``
and an authenticated connection to the PubSub service.
Expand All @@ -27,7 +27,7 @@ Authentication / Configuration
and
:meth:`from_service_account_p12 <google.cloud.pubsub.client.Client.from_service_account_p12>`.

- After setting ``GOOGLE_APPLICATION_CREDENTIALS`` and ``GCLOUD_PROJECT``
- After setting ``GOOGLE_APPLICATION_CREDENTIALS`` and ``GOOGLE_CLOUD_PROJECT``
environment variables, create a :class:`Client <google.cloud.pubsub.client.Client>`

.. doctest::
Expand Down
4 changes: 2 additions & 2 deletions docs/vision-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Authentication and Configuration
see :doc:`gcloud-auth`.

- In addition to any authentication configuration, you should also set the
:envvar:`GCLOUD_PROJECT` environment variable for the project you'd like
to interact with. If the GCLOUD_PROJECT environment variable is not present,
:envvar:`GOOGLE_CLOUD_PROJECT` environment variable for the project you'd like
to interact with. If the GOOGLE_CLOUD_PROJECT environment variable is not present,
the project ID from JSON file credentials is used.

If you are using Google App Engine or Google Compute Engine
Expand Down
16 changes: 8 additions & 8 deletions google/cloud/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@
_USER_ROOT = os.path.expanduser('~')
except ImportError: # pragma: NO COVER
_USER_ROOT = None
_GCLOUD_CONFIG_FILE = os.path.join(
_GOOGLE_CLOUD_CONFIG_FILE = os.path.join(
'gcloud', 'configurations', 'config_default')
_GCLOUD_CONFIG_SECTION = 'core'
_GCLOUD_CONFIG_KEY = 'project'
_GOOGLE_CLOUD_CONFIG_SECTION = 'core'
_GOOGLE_CLOUD_CONFIG_KEY = 'project'


class _LocalStack(Local):
Expand Down Expand Up @@ -201,7 +201,7 @@ def _get_nix_config_path():
:returns: The filename on a *nix system containing the CLI
config file.
"""
return os.path.join(_USER_ROOT, '.config', _GCLOUD_CONFIG_FILE)
return os.path.join(_USER_ROOT, '.config', _GOOGLE_CLOUD_CONFIG_FILE)


def _get_windows_config_path():
Expand All @@ -212,7 +212,7 @@ def _get_windows_config_path():
config file.
"""
appdata_dir = os.getenv('APPDATA', '')
return os.path.join(appdata_dir, _GCLOUD_CONFIG_FILE)
return os.path.join(appdata_dir, _GOOGLE_CLOUD_CONFIG_FILE)


def _default_service_project_id():
Expand Down Expand Up @@ -242,8 +242,8 @@ def _default_service_project_id():
config = configparser.RawConfigParser()
config.read(search_paths)

if config.has_section(_GCLOUD_CONFIG_SECTION):
return config.get(_GCLOUD_CONFIG_SECTION, _GCLOUD_CONFIG_KEY)
if config.has_section(_GOOGLE_CLOUD_CONFIG_SECTION):
return config.get(_GOOGLE_CLOUD_CONFIG_SECTION, _GOOGLE_CLOUD_CONFIG_KEY)


def _compute_engine_id():
Expand Down Expand Up @@ -290,7 +290,7 @@ def _determine_default_project(project=None):
In implicit case, supports three environments. In order of precedence, the
implicit environments are:

* GCLOUD_PROJECT environment variable
* GOOGLE_CLOUD_PROJECT environment variable
* GOOGLE_APPLICATION_CREDENTIALS JSON file
* Get default service project from
``$ gcloud beta auth application-default login``
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/datastore/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def _determine_default_project(project=None):
implicit environments are:

* DATASTORE_DATASET environment variable (for ``gcd`` / emulator testing)
* GCLOUD_PROJECT environment variable
* GOOGLE_CLOUD_PROJECT environment variable
* Google App Engine application ID
* Google Compute Engine project ID (from metadata server)

Expand Down
4 changes: 2 additions & 2 deletions google/cloud/environment_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
and tests.
"""

PROJECT = 'GCLOUD_PROJECT'
PROJECT = 'GOOGLE_CLOUD_PROJECT'
"""Environment variable defining default project."""

TESTS_PROJECT = 'GCLOUD_TESTS_PROJECT_ID'
TESTS_PROJECT = 'GOOGLE_CLOUD_TESTS_PROJECT_ID'
"""Environment variable defining project for tests."""

GCD_DATASET = 'DATASTORE_DATASET'
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/logging/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
from google.cloud.logging.sink import Sink


_DISABLE_GAX = os.getenv('GCLOUD_DISABLE_GAX', False)
_DISABLE_GAX = os.getenv('GOOGLE_CLOUD_DISABLE_GAX', False)
_USE_GAX = _HAVE_GAX and not _DISABLE_GAX


Expand Down
2 changes: 1 addition & 1 deletion google/cloud/pubsub/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
# pylint: enable=ungrouped-imports


_DISABLE_GAX = os.getenv('GCLOUD_DISABLE_GAX', False)
_DISABLE_GAX = os.getenv('GOOGLE_CLOUD_DISABLE_GAX', False)
_USE_GAX = _HAVE_GAX and not _DISABLE_GAX


Expand Down
6 changes: 3 additions & 3 deletions scripts/run_pylint.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def get_files_for_linting(allow_limited=True):
this value is not dependable.

To allow faster local ``tox`` runs, the environment variables
``GCLOUD_REMOTE_FOR_LINT`` and ``GCLOUD_BRANCH_FOR_LINT`` can be set to
``GOOGLE_CLOUD_REMOTE_FOR_LINT`` and ``GOOGLE_CLOUD_BRANCH_FOR_LINT`` can be set to
specify a remote branch to diff against.

:type allow_limited: bool
Expand All @@ -163,8 +163,8 @@ def get_files_for_linting(allow_limited=True):
diff_base = 'origin/master'
elif os.getenv('TRAVIS') is None:
# Only allow specified remote and branch in local dev.
remote = os.getenv('GCLOUD_REMOTE_FOR_LINT')
branch = os.getenv('GCLOUD_BRANCH_FOR_LINT')
remote = os.getenv('GOOGLE_CLOUD_REMOTE_FOR_LINT')
branch = os.getenv('GOOGLE_CLOUD_BRANCH_FOR_LINT')
if remote is not None and branch is not None:
diff_base = '%s/%s' % (remote, branch)

Expand Down
2 changes: 1 addition & 1 deletion system_tests/clear_datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@


def print_func(message):
if os.getenv('GCLOUD_NO_PRINT') != 'true':
if os.getenv('GOOGLE_CLOUD_NO_PRINT') != 'true':
print(message)


Expand Down
6 changes: 3 additions & 3 deletions system_tests/local_test_setup.sample
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export GOOGLE_APPLICATION_CREDENTIALS="app_credentials.json.sample"
export GCLOUD_TESTS_PROJECT_ID="my-project"
export GCLOUD_REMOTE_FOR_LINT="upstream"
export GCLOUD_BRANCH_FOR_LINT="master"
export GOOGLE_CLOUD_TESTS_PROJECT_ID="my-project"
export GOOGLE_CLOUD_REMOTE_FOR_LINT="upstream"
export GOOGLE_CLOUD_BRANCH_FOR_LINT="master"
2 changes: 1 addition & 1 deletion system_tests/populate_datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@


def print_func(message):
if os.getenv('GCLOUD_NO_PRINT') != 'true':
if os.getenv('GOOGLE_CLOUD_NO_PRINT') != 'true':
print(message)


Expand Down
2 changes: 1 addition & 1 deletion system_tests/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from google.cloud import translate


ENV_VAR = 'GCLOUD_TESTS_API_KEY'
ENV_VAR = 'GOOGLE_CLOUD_TESTS_API_KEY'


class Config(object):
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ basepython =
python2.7
commands =
python {toxinidir}/system_tests/attempt_system_tests.py
passenv = GOOGLE_* GCLOUD_* TRAVIS* encrypted_*
passenv = GOOGLE_* GOOGLE_CLOUD_* TRAVIS* encrypted_*

[testenv:system-tests3]
basepython =
Expand All @@ -123,7 +123,7 @@ basepython =
commands =
python {toxinidir}/system_tests/run_emulator.py --package=datastore
setenv =
GCLOUD_NO_PRINT=true
GOOGLE_CLOUD_NO_PRINT=true
deps =
{[testenv]deps}
psutil
Expand All @@ -133,5 +133,5 @@ basepython =
python2.7
commands =
python {toxinidir}/system_tests/run_emulator.py --package=pubsub
passenv = GCLOUD_*
passenv = GOOGLE_CLOUD_*
deps = {[testenv:datastore-emulator]deps}
12 changes: 6 additions & 6 deletions unit_tests/test__helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def test_it(self):
user_root = 'a'
config_file = 'b'
with _Monkey(MUT, _USER_ROOT=user_root,
_GCLOUD_CONFIG_FILE=config_file):
_GOOGLE_CLOUD_CONFIG_FILE=config_file):
result = self._callFUT()

expected = os.path.join(user_root, '.config', config_file)
Expand All @@ -216,7 +216,7 @@ def test_it(self):
environ = {'APPDATA': appdata_dir}
config_file = 'b'
with _Monkey(os, getenv=environ.get):
with _Monkey(MUT, _GCLOUD_CONFIG_FILE=config_file):
with _Monkey(MUT, _GOOGLE_CLOUD_CONFIG_FILE=config_file):
result = self._callFUT()

expected = os.path.join(appdata_dir, config_file)
Expand All @@ -239,8 +239,8 @@ def test_nix(self):
project_id = 'test-project-id'
with _NamedTemporaryFile() as temp:
config_value = self.CONFIG_TEMPLATE % (
MUT._GCLOUD_CONFIG_SECTION,
MUT._GCLOUD_CONFIG_KEY, project_id)
MUT._GOOGLE_CLOUD_CONFIG_SECTION,
MUT._GOOGLE_CLOUD_CONFIG_KEY, project_id)
with open(temp.name, 'w') as config_file:
config_file.write(config_value)

Expand All @@ -262,8 +262,8 @@ def test_windows(self):
project_id = 'test-project-id'
with _NamedTemporaryFile() as temp:
config_value = self.CONFIG_TEMPLATE % (
MUT._GCLOUD_CONFIG_SECTION,
MUT._GCLOUD_CONFIG_KEY, project_id)
MUT._GOOGLE_CLOUD_CONFIG_SECTION,
MUT._GOOGLE_CLOUD_CONFIG_KEY, project_id)
with open(temp.name, 'w') as config_file:
config_file.write(config_value)

Expand Down