Skip to content

Commit efc00ed

Browse files
authored
feat: updates python-aiplatform to v1 (#212)
* 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
1 parent 0befde3 commit efc00ed

File tree

330 files changed

+65473
-2524
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

330 files changed

+65473
-2524
lines changed

.coveragerc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[run]
2+
branch = True
3+
4+
[report]
5+
fail_under = 100
6+
show_missing = True
7+
omit =
8+
google/cloud/aiplatform/v1/schema/trainingjob/definition/__init__.py
9+
exclude_lines =
10+
# Re-enable the standard pragma
11+
pragma: NO COVER
12+
# Ignore debug-only repr
13+
def __repr__
14+
# Ignore pkg_resources exceptions.
15+
# This is added at the module level as a safeguard for if someone
16+
# generates the code and tries to run it without pip installing. This
17+
# makes it virtually impossible to test properly.
18+
except pkg_resources.DistributionNotFound

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ exclude =
2626
*_pb2.py
2727

2828
# Standard linting exemptions.
29+
**/.nox/**
2930
__pycache__,
3031
.git,
3132
*.pyc,

.github/header-checker-lint.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{"allowedCopyrightHolders": ["Google LLC"],
2+
"allowedLicenses": ["Apache-2.0", "MIT", "BSD-3"],
3+
"ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt"],
4+
"sourceFileExtensions": [
5+
"ts",
6+
"js",
7+
"java",
8+
"sh",
9+
"Dockerfile",
10+
"yaml",
11+
"py",
12+
"html",
13+
"txt"
14+
]
15+
}

.kokoro/build.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515

1616
set -eo pipefail
1717

18-
cd github/python-aiplatform
18+
if [[ -z "${PROJECT_ROOT:-}" ]]; then
19+
PROJECT_ROOT="github/python-aiplatform"
20+
fi
21+
22+
cd "${PROJECT_ROOT}"
1923

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

3236
# Remove old nox
33-
python3.6 -m pip uninstall --yes --quiet nox-automation
37+
python3 -m pip uninstall --yes --quiet nox-automation
3438

3539
# Install nox
36-
python3.6 -m pip install --upgrade --quiet nox
37-
python3.6 -m nox --version
40+
python3 -m pip install --upgrade --quiet nox
41+
python3 -m nox --version
3842

3943
# If NOX_SESSION is set, it only runs the specified session,
4044
# otherwise run all the sessions.
4145
if [[ -n "${NOX_SESSION:-}" ]]; then
42-
python3.6 -m nox -s "${NOX_SESSION:-}"
46+
python3 -m nox -s ${NOX_SESSION:-}
4347
else
44-
python3.6 -m nox
48+
python3 -m nox
4549
fi

.kokoro/docs/docs-presubmit.cfg

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,14 @@ env_vars: {
1515
key: "TRAMPOLINE_IMAGE_UPLOAD"
1616
value: "false"
1717
}
18+
19+
env_vars: {
20+
key: "TRAMPOLINE_BUILD_FILE"
21+
value: "github/python-aiplatform/.kokoro/build.sh"
22+
}
23+
24+
# Only run this nox session.
25+
env_vars: {
26+
key: "NOX_SESSION"
27+
value: "docs docfx"
28+
}

.pre-commit-config.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v3.4.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- repo: https://github.com/psf/black
11+
rev: 19.10b0
12+
hooks:
13+
- id: black
14+
- repo: https://gitlab.com/pycqa/flake8
15+
rev: 3.8.4
16+
hooks:
17+
- id: flake8

.trampolinerc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ required_envvars+=(
2424
pass_down_envvars+=(
2525
"STAGING_BUCKET"
2626
"V2_STAGING_BUCKET"
27+
"NOX_SESSION"
2728
)
2829

2930
# Prevent unintentional override on the default image.

CONTRIBUTING.rst

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ In order to add a feature:
2121
- The feature must be documented in both the API and narrative
2222
documentation.
2323

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

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

114+
- This repository contains configuration for the
115+
`pre-commit <https://pre-commit.com/>`__ tool, which automates checking
116+
our linters during a commit. If you have it installed on your ``$PATH``,
117+
you can enable enforcing those checks via:
118+
119+
.. code-block:: bash
120+
121+
$ pre-commit install
122+
pre-commit installed at .git/hooks/pre-commit
123+
114124
Exceptions to PEP8:
115125

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

193203
We support:
194204

195-
- `Python 3.5`_
196205
- `Python 3.6`_
197206
- `Python 3.7`_
198207
- `Python 3.8`_
208+
- `Python 3.9`_
199209

200-
.. _Python 3.5: https://docs.python.org/3.5/
201210
.. _Python 3.6: https://docs.python.org/3.6/
202211
.. _Python 3.7: https://docs.python.org/3.7/
203212
.. _Python 3.8: https://docs.python.org/3.8/
213+
.. _Python 3.9: https://docs.python.org/3.9/
204214

205215

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

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

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

212221
We also explicitly decided to support Python 3 beginning with version
213-
3.5. Reasons for this include:
222+
3.6. Reasons for this include:
214223

215224
- Encouraging use of newest versions of Python 3
216225
- Taking the lead of `prominent`_ open-source `projects`_

LICENSE

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
Apache License
1+
2+
Apache License
23
Version 2.0, January 2004
3-
https://www.apache.org/licenses/
4+
http://www.apache.org/licenses/
45

56
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
67

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

195-
https://www.apache.org/licenses/LICENSE-2.0
196+
http://www.apache.org/licenses/LICENSE-2.0
196197

197198
Unless required by applicable law or agreed to in writing, software
198199
distributed under the License is distributed on an "AS IS" BASIS,

docs/_static/custom.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
div#python2-eol {
22
border-color: red;
33
border-width: medium;
4-
}
4+
}
5+
6+
/* Ensure minimum width for 'Parameters' / 'Returns' column */
7+
dl.field-list > dt {
8+
min-width: 100px
9+
}

0 commit comments

Comments
 (0)