Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
feat: generate v1
Browse files Browse the repository at this point in the history
  • Loading branch information
parthea committed Feb 10, 2021
1 parent 2658465 commit 5c3486d
Show file tree
Hide file tree
Showing 23 changed files with 1,134 additions and 395 deletions.
16 changes: 10 additions & 6 deletions .kokoro/build.sh
Expand Up @@ -15,7 +15,11 @@

set -eo pipefail

cd github/python-memcache
if [[ -z "${PROJECT_ROOT:-}" ]]; then
PROJECT_ROOT="github/python-memcache"
fi

cd "${PROJECT_ROOT}"

# Disable buffering, so that the logs stream through.
export PYTHONUNBUFFERED=1
Expand All @@ -30,16 +34,16 @@ export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.json")

# Remove old nox
python3.6 -m pip uninstall --yes --quiet nox-automation
python3 -m pip uninstall --yes --quiet nox-automation

# Install nox
python3.6 -m pip install --upgrade --quiet nox
python3.6 -m nox --version
python3 -m pip install --upgrade --quiet nox
python3 -m nox --version

# If NOX_SESSION is set, it only runs the specified session,
# otherwise run all the sessions.
if [[ -n "${NOX_SESSION:-}" ]]; then
python3.6 -m nox -s "${NOX_SESSION:-}"
python3 -m nox -s ${NOX_SESSION:-}
else
python3.6 -m nox
python3 -m nox
fi
11 changes: 11 additions & 0 deletions .kokoro/docs/docs-presubmit.cfg
Expand Up @@ -15,3 +15,14 @@ env_vars: {
key: "TRAMPOLINE_IMAGE_UPLOAD"
value: "false"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-memcache/.kokoro/build.sh"
}

# Only run this nox session.
env_vars: {
key: "NOX_SESSION"
value: "docs docfx"
}
1 change: 1 addition & 0 deletions .trampolinerc
Expand Up @@ -24,6 +24,7 @@ required_envvars+=(
pass_down_envvars+=(
"STAGING_BUCKET"
"V2_STAGING_BUCKET"
"NOX_SESSION"
)

# Prevent unintentional override on the default image.
Expand Down
22 changes: 18 additions & 4 deletions CONTRIBUTING.rst
Expand Up @@ -70,9 +70,14 @@ We use `nox <https://nox.readthedocs.io/en/latest/>`__ to instrument our tests.
- To test your changes, run unit tests with ``nox``::

$ nox -s unit-2.7
$ nox -s unit-3.7
$ nox -s unit-3.8
$ ...

- Args to pytest can be passed through the nox command separated by a `--`. For
example, to run a single test::

$ nox -s unit-3.8 -- -k <name of test>

.. note::

The unit tests and system tests are described in the
Expand All @@ -93,8 +98,12 @@ On Debian/Ubuntu::
************
Coding Style
************
- We use the automatic code formatter ``black``. You can run it using
the nox session ``blacken``. This will eliminate many lint errors. Run via::

$ nox -s blacken

- PEP8 compliance, with exceptions defined in the linter configuration.
- PEP8 compliance is required, with exceptions defined in the linter configuration.
If you have ``nox`` installed, you can test that you have not introduced
any non-compliant code via::

Expand Down Expand Up @@ -133,13 +142,18 @@ Running System Tests

- To run system tests, you can execute::

$ nox -s system-3.7
# Run all system tests
$ nox -s system-3.8
$ nox -s system-2.7

# Run a single system test
$ nox -s system-3.8 -- -k <name of test>


.. note::

System tests are only configured to run under Python 2.7 and
Python 3.7. For expediency, we do not run them in older versions
Python 3.8. For expediency, we do not run them in older versions
of Python 3.

This alone will not run the tests. You'll need to change some local
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.in
Expand Up @@ -16,10 +16,10 @@

# Generated by synthtool. DO NOT EDIT!
include README.rst LICENSE
recursive-include google *.json *.proto
recursive-include google *.json *.proto py.typed
recursive-include tests *
global-exclude *.py[co]
global-exclude __pycache__

# Exclude scripts for samples readmegen
prune scripts/readme-gen
prune scripts/readme-gen
7 changes: 6 additions & 1 deletion docs/_static/custom.css
@@ -1,4 +1,9 @@
div#python2-eol {
border-color: red;
border-width: medium;
}
}

/* Ensure minimum width for 'Parameters' / 'Returns' column */
dl.field-list > dt {
min-width: 100px
}
17 changes: 15 additions & 2 deletions docs/index.rst
Expand Up @@ -2,8 +2,21 @@

.. include:: multiprocessing.rst

API Reference
-------------
This package includes clients for multiple versions of the Memcache
API. By default, you will get ``v1``, the latest GA version.

v1 API Reference
-------------------------

.. toctree::
:maxdepth: 2

memcache_v1/services
memcache_v1/types


v1beta2 API Reference
------------------------------

.. toctree::
:maxdepth: 2
Expand Down
6 changes: 3 additions & 3 deletions docs/memcache_v1beta2/services.rst
@@ -1,6 +1,6 @@
Services for Google Cloud Memcache v1beta2 API
==============================================
.. toctree::
:maxdepth: 2

.. automodule:: google.cloud.memcache_v1beta2.services.cloud_memcache
:members:
:inherited-members:
cloud_memcache
1 change: 1 addition & 0 deletions docs/memcache_v1beta2/types.rst
Expand Up @@ -3,4 +3,5 @@ Types for Google Cloud Memcache v1beta2 API

.. automodule:: google.cloud.memcache_v1beta2.types
:members:
:undoc-members:
:show-inheritance:
34 changes: 14 additions & 20 deletions google/cloud/memcache/__init__.py
Expand Up @@ -15,26 +15,22 @@
# limitations under the License.
#

from google.cloud.memcache_v1beta2.services.cloud_memcache.async_client import (
from google.cloud.memcache_v1.services.cloud_memcache.async_client import (
CloudMemcacheAsyncClient,
)
from google.cloud.memcache_v1beta2.services.cloud_memcache.client import (
CloudMemcacheClient,
)
from google.cloud.memcache_v1beta2.types.cloud_memcache import ApplyParametersRequest
from google.cloud.memcache_v1beta2.types.cloud_memcache import CreateInstanceRequest
from google.cloud.memcache_v1beta2.types.cloud_memcache import DeleteInstanceRequest
from google.cloud.memcache_v1beta2.types.cloud_memcache import GetInstanceRequest
from google.cloud.memcache_v1beta2.types.cloud_memcache import Instance
from google.cloud.memcache_v1beta2.types.cloud_memcache import ListInstancesRequest
from google.cloud.memcache_v1beta2.types.cloud_memcache import ListInstancesResponse
from google.cloud.memcache_v1beta2.types.cloud_memcache import LocationMetadata
from google.cloud.memcache_v1beta2.types.cloud_memcache import MemcacheParameters
from google.cloud.memcache_v1beta2.types.cloud_memcache import MemcacheVersion
from google.cloud.memcache_v1beta2.types.cloud_memcache import OperationMetadata
from google.cloud.memcache_v1beta2.types.cloud_memcache import UpdateInstanceRequest
from google.cloud.memcache_v1beta2.types.cloud_memcache import UpdateParametersRequest
from google.cloud.memcache_v1beta2.types.cloud_memcache import ZoneMetadata
from google.cloud.memcache_v1.services.cloud_memcache.client import CloudMemcacheClient
from google.cloud.memcache_v1.types.cloud_memcache import ApplyParametersRequest
from google.cloud.memcache_v1.types.cloud_memcache import CreateInstanceRequest
from google.cloud.memcache_v1.types.cloud_memcache import DeleteInstanceRequest
from google.cloud.memcache_v1.types.cloud_memcache import GetInstanceRequest
from google.cloud.memcache_v1.types.cloud_memcache import Instance
from google.cloud.memcache_v1.types.cloud_memcache import ListInstancesRequest
from google.cloud.memcache_v1.types.cloud_memcache import ListInstancesResponse
from google.cloud.memcache_v1.types.cloud_memcache import MemcacheParameters
from google.cloud.memcache_v1.types.cloud_memcache import MemcacheVersion
from google.cloud.memcache_v1.types.cloud_memcache import OperationMetadata
from google.cloud.memcache_v1.types.cloud_memcache import UpdateInstanceRequest
from google.cloud.memcache_v1.types.cloud_memcache import UpdateParametersRequest

__all__ = (
"ApplyParametersRequest",
Expand All @@ -46,11 +42,9 @@
"Instance",
"ListInstancesRequest",
"ListInstancesResponse",
"LocationMetadata",
"MemcacheParameters",
"MemcacheVersion",
"OperationMetadata",
"UpdateInstanceRequest",
"UpdateParametersRequest",
"ZoneMetadata",
)
2 changes: 2 additions & 0 deletions google/cloud/memcache_v1beta2/__init__.py
Expand Up @@ -17,6 +17,7 @@

from .services.cloud_memcache import CloudMemcacheClient
from .types.cloud_memcache import ApplyParametersRequest
from .types.cloud_memcache import ApplySoftwareUpdateRequest
from .types.cloud_memcache import CreateInstanceRequest
from .types.cloud_memcache import DeleteInstanceRequest
from .types.cloud_memcache import GetInstanceRequest
Expand All @@ -34,6 +35,7 @@

__all__ = (
"ApplyParametersRequest",
"ApplySoftwareUpdateRequest",
"CreateInstanceRequest",
"DeleteInstanceRequest",
"GetInstanceRequest",
Expand Down

0 comments on commit 5c3486d

Please sign in to comment.