Skip to content

Commit

Permalink
feat: updates python-aiplatform to v1 (#212)
Browse files Browse the repository at this point in the history
* feat: updates python-aiplatform to v1

* fix: adjusts import statement

* chore: adds v1 as default aiplatform

* fix: more changes to gapic/__init__.py

* fix: reverted explainability samples to v1beta1

* fix: sample failures due to v1beta1 features
  • Loading branch information
telpirion committed Feb 12, 2021
1 parent 0befde3 commit efc00ed
Show file tree
Hide file tree
Showing 330 changed files with 65,473 additions and 2,524 deletions.
18 changes: 18 additions & 0 deletions .coveragerc
@@ -0,0 +1,18 @@
[run]
branch = True

[report]
fail_under = 100
show_missing = True
omit =
google/cloud/aiplatform/v1/schema/trainingjob/definition/__init__.py
exclude_lines =
# Re-enable the standard pragma
pragma: NO COVER
# Ignore debug-only repr
def __repr__
# Ignore pkg_resources exceptions.
# This is added at the module level as a safeguard for if someone
# generates the code and tries to run it without pip installing. This
# makes it virtually impossible to test properly.
except pkg_resources.DistributionNotFound
1 change: 1 addition & 0 deletions .flake8
Expand Up @@ -26,6 +26,7 @@ exclude =
*_pb2.py

# Standard linting exemptions.
**/.nox/**
__pycache__,
.git,
*.pyc,
Expand Down
15 changes: 15 additions & 0 deletions .github/header-checker-lint.yml
@@ -0,0 +1,15 @@
{"allowedCopyrightHolders": ["Google LLC"],
"allowedLicenses": ["Apache-2.0", "MIT", "BSD-3"],
"ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt"],
"sourceFileExtensions": [
"ts",
"js",
"java",
"sh",
"Dockerfile",
"yaml",
"py",
"html",
"txt"
]
}
16 changes: 10 additions & 6 deletions .kokoro/build.sh
Expand Up @@ -15,7 +15,11 @@

set -eo pipefail

cd github/python-aiplatform
if [[ -z "${PROJECT_ROOT:-}" ]]; then
PROJECT_ROOT="github/python-aiplatform"
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-aiplatform/.kokoro/build.sh"
}

# Only run this nox session.
env_vars: {
key: "NOX_SESSION"
value: "docs docfx"
}
17 changes: 17 additions & 0 deletions .pre-commit-config.yaml
@@ -0,0 +1,17 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- repo: https://github.com/psf/black
rev: 19.10b0
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
hooks:
- id: flake8
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
21 changes: 15 additions & 6 deletions CONTRIBUTING.rst
Expand Up @@ -21,8 +21,8 @@ In order to add a feature:
- The feature must be documented in both the API and narrative
documentation.

- The feature must work fully on the following CPython versions: 2.7,
3.5, 3.6, 3.7 and 3.8 on both UNIX and Windows.
- The feature must work fully on the following CPython versions:
3.6, 3.7, 3.8 and 3.9 on both UNIX and Windows.

- The feature must not add unnecessary dependencies (where
"unnecessary" is of course subjective, but new dependencies should
Expand Down Expand Up @@ -111,6 +111,16 @@ Coding Style
should point to the official ``googleapis`` checkout and the
the branch should be the main branch on that remote (``master``).

- This repository contains configuration for the
`pre-commit <https://pre-commit.com/>`__ tool, which automates checking
our linters during a commit. If you have it installed on your ``$PATH``,
you can enable enforcing those checks via:

.. code-block:: bash
$ pre-commit install
pre-commit installed at .git/hooks/pre-commit
Exceptions to PEP8:

- Many unit tests use a helper method, ``_call_fut`` ("FUT" is short for
Expand Down Expand Up @@ -192,25 +202,24 @@ Supported Python Versions

We support:

- `Python 3.5`_
- `Python 3.6`_
- `Python 3.7`_
- `Python 3.8`_
- `Python 3.9`_

.. _Python 3.5: https://docs.python.org/3.5/
.. _Python 3.6: https://docs.python.org/3.6/
.. _Python 3.7: https://docs.python.org/3.7/
.. _Python 3.8: https://docs.python.org/3.8/
.. _Python 3.9: https://docs.python.org/3.9/


Supported versions can be found in our ``noxfile.py`` `config`_.

.. _config: https://github.com/googleapis/python-aiplatform/blob/master/noxfile.py

Python 2.7 support is deprecated. All code changes should maintain Python 2.7 compatibility until January 1, 2020.

We also explicitly decided to support Python 3 beginning with version
3.5. Reasons for this include:
3.6. Reasons for this include:

- Encouraging use of newest versions of Python 3
- Taking the lead of `prominent`_ open-source `projects`_
Expand Down
7 changes: 4 additions & 3 deletions LICENSE
@@ -1,6 +1,7 @@
Apache License

Apache License
Version 2.0, January 2004
https://www.apache.org/licenses/
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

Expand Down Expand Up @@ -192,7 +193,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
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
}
11 changes: 11 additions & 0 deletions docs/aiplatform_v1/dataset_service.rst
@@ -0,0 +1,11 @@
DatasetService
--------------------------------

.. automodule:: google.cloud.aiplatform_v1.services.dataset_service
:members:
:inherited-members:


.. automodule:: google.cloud.aiplatform_v1.services.dataset_service.pagers
:members:
:inherited-members:
11 changes: 11 additions & 0 deletions docs/aiplatform_v1/endpoint_service.rst
@@ -0,0 +1,11 @@
EndpointService
---------------------------------

.. automodule:: google.cloud.aiplatform_v1.services.endpoint_service
:members:
:inherited-members:


.. automodule:: google.cloud.aiplatform_v1.services.endpoint_service.pagers
:members:
:inherited-members:
11 changes: 11 additions & 0 deletions docs/aiplatform_v1/job_service.rst
@@ -0,0 +1,11 @@
JobService
----------------------------

.. automodule:: google.cloud.aiplatform_v1.services.job_service
:members:
:inherited-members:


.. automodule:: google.cloud.aiplatform_v1.services.job_service.pagers
:members:
:inherited-members:
11 changes: 11 additions & 0 deletions docs/aiplatform_v1/migration_service.rst
@@ -0,0 +1,11 @@
MigrationService
----------------------------------

.. automodule:: google.cloud.aiplatform_v1.services.migration_service
:members:
:inherited-members:


.. automodule:: google.cloud.aiplatform_v1.services.migration_service.pagers
:members:
:inherited-members:
11 changes: 11 additions & 0 deletions docs/aiplatform_v1/model_service.rst
@@ -0,0 +1,11 @@
ModelService
------------------------------

.. automodule:: google.cloud.aiplatform_v1.services.model_service
:members:
:inherited-members:


.. automodule:: google.cloud.aiplatform_v1.services.model_service.pagers
:members:
:inherited-members:
11 changes: 11 additions & 0 deletions docs/aiplatform_v1/pipeline_service.rst
@@ -0,0 +1,11 @@
PipelineService
---------------------------------

.. automodule:: google.cloud.aiplatform_v1.services.pipeline_service
:members:
:inherited-members:


.. automodule:: google.cloud.aiplatform_v1.services.pipeline_service.pagers
:members:
:inherited-members:
6 changes: 6 additions & 0 deletions docs/aiplatform_v1/prediction_service.rst
@@ -0,0 +1,6 @@
PredictionService
-----------------------------------

.. automodule:: google.cloud.aiplatform_v1.services.prediction_service
:members:
:inherited-members:
13 changes: 13 additions & 0 deletions docs/aiplatform_v1/services.rst
@@ -0,0 +1,13 @@
Services for Google Cloud Aiplatform v1 API
===========================================
.. toctree::
:maxdepth: 2

dataset_service
endpoint_service
job_service
migration_service
model_service
pipeline_service
prediction_service
specialist_pool_service
11 changes: 11 additions & 0 deletions docs/aiplatform_v1/specialist_pool_service.rst
@@ -0,0 +1,11 @@
SpecialistPoolService
---------------------------------------

.. automodule:: google.cloud.aiplatform_v1.services.specialist_pool_service
:members:
:inherited-members:


.. automodule:: google.cloud.aiplatform_v1.services.specialist_pool_service.pagers
:members:
:inherited-members:
7 changes: 7 additions & 0 deletions docs/aiplatform_v1/types.rst
@@ -0,0 +1,7 @@
Types for Google Cloud Aiplatform v1 API
========================================

.. automodule:: google.cloud.aiplatform_v1.types
:members:
:undoc-members:
:show-inheritance:
11 changes: 11 additions & 0 deletions docs/aiplatform_v1beta1/dataset_service.rst
@@ -0,0 +1,11 @@
DatasetService
--------------------------------

.. automodule:: google.cloud.aiplatform_v1beta1.services.dataset_service
:members:
:inherited-members:


.. automodule:: google.cloud.aiplatform_v1beta1.services.dataset_service.pagers
:members:
:inherited-members:
11 changes: 11 additions & 0 deletions docs/aiplatform_v1beta1/endpoint_service.rst
@@ -0,0 +1,11 @@
EndpointService
---------------------------------

.. automodule:: google.cloud.aiplatform_v1beta1.services.endpoint_service
:members:
:inherited-members:


.. automodule:: google.cloud.aiplatform_v1beta1.services.endpoint_service.pagers
:members:
:inherited-members:
11 changes: 11 additions & 0 deletions docs/aiplatform_v1beta1/job_service.rst
@@ -0,0 +1,11 @@
JobService
----------------------------

.. automodule:: google.cloud.aiplatform_v1beta1.services.job_service
:members:
:inherited-members:


.. automodule:: google.cloud.aiplatform_v1beta1.services.job_service.pagers
:members:
:inherited-members:
11 changes: 11 additions & 0 deletions docs/aiplatform_v1beta1/migration_service.rst
@@ -0,0 +1,11 @@
MigrationService
----------------------------------

.. automodule:: google.cloud.aiplatform_v1beta1.services.migration_service
:members:
:inherited-members:


.. automodule:: google.cloud.aiplatform_v1beta1.services.migration_service.pagers
:members:
:inherited-members:
11 changes: 11 additions & 0 deletions docs/aiplatform_v1beta1/model_service.rst
@@ -0,0 +1,11 @@
ModelService
------------------------------

.. automodule:: google.cloud.aiplatform_v1beta1.services.model_service
:members:
:inherited-members:


.. automodule:: google.cloud.aiplatform_v1beta1.services.model_service.pagers
:members:
:inherited-members:
11 changes: 11 additions & 0 deletions docs/aiplatform_v1beta1/pipeline_service.rst
@@ -0,0 +1,11 @@
PipelineService
---------------------------------

.. automodule:: google.cloud.aiplatform_v1beta1.services.pipeline_service
:members:
:inherited-members:


.. automodule:: google.cloud.aiplatform_v1beta1.services.pipeline_service.pagers
:members:
:inherited-members:
6 changes: 6 additions & 0 deletions docs/aiplatform_v1beta1/prediction_service.rst
@@ -0,0 +1,6 @@
PredictionService
-----------------------------------

.. automodule:: google.cloud.aiplatform_v1beta1.services.prediction_service
:members:
:inherited-members:

0 comments on commit efc00ed

Please sign in to comment.