Skip to content

Commit

Permalink
feat!: use microgenerator (#76)
Browse files Browse the repository at this point in the history
* Adds tutorials using Cloud Client [(#930)](GoogleCloudPlatform/python-docs-samples#930)

* Adds tutorials.

* Removes unused enumerate

* Adds one more tutorial as well as fixes some copy/paste typos. [(#933)](GoogleCloudPlatform/python-docs-samples#933)

* Adds new examples, replaces markdown with restructured text [(#945)](GoogleCloudPlatform/python-docs-samples#945)

* Adds new examples, replaces markdown with restructured text

* Address review feedback

* Use videos from pubilc bucket, update to new client library.

* Style nit

* Updates requirements [(#952)](GoogleCloudPlatform/python-docs-samples#952)

* Fix README rst links [(#962)](GoogleCloudPlatform/python-docs-samples#962)

* Fix README rst links

* Update all READMEs

* change the usage file sample [(#958)](GoogleCloudPlatform/python-docs-samples#958)

since the file does not exist. Propose to use the same one as the tutorial: demomaker/gbikes_dinosaur.mp4

* Updates examples for video [(#968)](GoogleCloudPlatform/python-docs-samples#968)

* Auto-update dependencies. [(#1093)](GoogleCloudPlatform/python-docs-samples#1093)

* Auto-update dependencies.

* Fix storage notification poll sample

Change-Id: I6afbc79d15e050531555e4c8e51066996717a0f3

* Fix spanner samples

Change-Id: I40069222c60d57e8f3d3878167591af9130895cb

* Drop coverage because it's not useful

Change-Id: Iae399a7083d7866c3c7b9162d0de244fbff8b522

* Try again to fix flaky logging test

Change-Id: I6225c074701970c17c426677ef1935bb6d7e36b4

* Update all generated readme auth instructions [(#1121)](GoogleCloudPlatform/python-docs-samples#1121)

Change-Id: I03b5eaef8b17ac3dc3c0339fd2c7447bd3e11bd2

* Auto-update dependencies. [(#1123)](GoogleCloudPlatform/python-docs-samples#1123)

* Video v1beta2 [(#1088)](GoogleCloudPlatform/python-docs-samples#1088)

* update analyze_safe_search

* update analyze_shots

* update explicit_content_detection and test

* update fece detection

* update label detection (path)

* update label detection (file)

* flake

* safe search --> explicit content

* update faces tutorial

* update client library quickstart

* update shotchange tutorial

* update labels tutorial

* correct spelling

* correction start_time_offset

* import order

* rebased

* Added Link to Python Setup Guide [(#1158)](GoogleCloudPlatform/python-docs-samples#1158)

* Update Readme.rst to add Python setup guide

As requested in b/64770713.

This sample is linked in documentation https://cloud.google.com/bigtable/docs/scaling, and it would make more sense to update the guide here than in the documentation.

* Update README.rst

* Update README.rst

* Update README.rst

* Update README.rst

* Update README.rst

* Update install_deps.tmpl.rst

* Updated readmegen scripts and re-generated related README files

* Fixed the lint error

* Tweak doc/help strings for sample tools  [(#1160)](GoogleCloudPlatform/python-docs-samples#1160)

* Corrected copy-paste on doc string

* Updated doc/help string to be more specific to labels tool

* Made shotchange doc/help string more specific

* Tweaked doc/help string to indicate no arg expected

* Adjusted import order to satisfy flake8

* Wrapped doc string to 79 chars to flake8 correctly

* Adjusted import order to pass flake8 test

* Auto-update dependencies. [(#1186)](GoogleCloudPlatform/python-docs-samples#1186)

* update samples to v1 [(#1221)](GoogleCloudPlatform/python-docs-samples#1221)

* update samples to v1

* replace while loop with operation.result(timeout)

* addressing review comments

* flake

* flake

* Added "Open in Cloud Shell" buttons to README files [(#1254)](GoogleCloudPlatform/python-docs-samples#1254)

* Auto-update dependencies. [(#1377)](GoogleCloudPlatform/python-docs-samples#1377)

* Auto-update dependencies.

* Update requirements.txt

* Auto-update dependencies.

* Regenerate the README files and fix the Open in Cloud Shell link for some samples [(#1441)](GoogleCloudPlatform/python-docs-samples#1441)

* Update READMEs to fix numbering and add git clone [(#1464)](GoogleCloudPlatform/python-docs-samples#1464)

* Video Intelligence region tag update [(#1639)](GoogleCloudPlatform/python-docs-samples#1639)

* Auto-update dependencies. [(#1658)](GoogleCloudPlatform/python-docs-samples#1658)

* Auto-update dependencies.

* Rollback appengine/standard/bigquery/.

* Rollback appengine/standard/iap/.

* Rollback bigtable/metricscaler.

* Rolledback appengine/flexible/datastore.

* Rollback dataproc/

* Rollback jobs/api_client

* Rollback vision/cloud-client.

* Rollback functions/ocr/app.

* Rollback iot/api-client/end_to_end_example.

* Rollback storage/cloud-client.

* Rollback kms/api-client.

* Rollback dlp/

* Rollback bigquery/cloud-client.

* Rollback iot/api-client/manager.

* Rollback appengine/flexible/cloudsql_postgresql.

* Use explicit URIs for Video Intelligence sample tests [(#1743)](GoogleCloudPlatform/python-docs-samples#1743)

* Auto-update dependencies. [(#1846)](GoogleCloudPlatform/python-docs-samples#1846)

ACK, merging.

* Longer timeouts to address intermittent failures [(#1871)](GoogleCloudPlatform/python-docs-samples#1871)

* Auto-update dependencies. [(#1980)](GoogleCloudPlatform/python-docs-samples#1980)

* Auto-update dependencies.

* Update requirements.txt

* Update requirements.txt

* replace demomaker with cloud-samples-data/video for video intelligenc… [(#2162)](GoogleCloudPlatform/python-docs-samples#2162)

* replace demomaker with cloud-samples-data/video for video intelligence samples

* flake

* Adds updates for samples profiler ... vision [(#2439)](GoogleCloudPlatform/python-docs-samples#2439)

* Auto-update dependencies. [(#2005)](GoogleCloudPlatform/python-docs-samples#2005)

* Auto-update dependencies.

* Revert update of appengine/flexible/datastore.

* revert update of appengine/flexible/scipy

* revert update of bigquery/bqml

* revert update of bigquery/cloud-client

* revert update of bigquery/datalab-migration

* revert update of bigtable/quickstart

* revert update of compute/api

* revert update of container_registry/container_analysis

* revert update of dataflow/run_template

* revert update of datastore/cloud-ndb

* revert update of dialogflow/cloud-client

* revert update of dlp

* revert update of functions/imagemagick

* revert update of functions/ocr/app

* revert update of healthcare/api-client/fhir

* revert update of iam/api-client

* revert update of iot/api-client/gcs_file_to_device

* revert update of iot/api-client/mqtt_example

* revert update of language/automl

* revert update of run/image-processing

* revert update of vision/automl

* revert update testing/requirements.txt

* revert update of vision/cloud-client/detect

* revert update of vision/cloud-client/product_search

* revert update of jobs/v2/api_client

* revert update of jobs/v3/api_client

* revert update of opencensus

* revert update of translate/cloud-client

* revert update to speech/cloud-client

Co-authored-by: Kurtis Van Gent <[email protected]>
Co-authored-by: Doug Mahugh <[email protected]>

* chore(deps): update dependency google-cloud-videointelligence to v1.14.0 [(#3169)](GoogleCloudPlatform/python-docs-samples#3169)

* Simplify noxfile setup. [(#2806)](GoogleCloudPlatform/python-docs-samples#2806)

* chore(deps): update dependency requests to v2.23.0

* Simplify noxfile and add version control.

* Configure appengine/standard to only test Python 2.7.

* Update Kokokro configs to match noxfile.

* Add requirements-test to each folder.

* Remove Py2 versions from everything execept appengine/standard.

* Remove conftest.py.

* Remove appengine/standard/conftest.py

* Remove 'no-sucess-flaky-report' from pytest.ini.

* Add GAE SDK back to appengine/standard tests.

* Fix typo.

* Roll pytest to python 2 version.

* Add a bunch of testing requirements.

* Remove typo.

* Add appengine lib directory back in.

* Add some additional requirements.

* Fix issue with flake8 args.

* Even more requirements.

* Readd appengine conftest.py.

* Add a few more requirements.

* Even more Appengine requirements.

* Add webtest for appengine/standard/mailgun.

* Add some additional requirements.

* Add workaround for issue with mailjet-rest.

* Add responses for appengine/standard/mailjet.

Co-authored-by: Renovate Bot <[email protected]>

* fix: changes positional to named pararameters in Video samples [(#4017)](GoogleCloudPlatform/python-docs-samples#4017)

Changes calls to `VideoClient.annotate_video()` so that GCS URIs are provided as named parameters.

Example:
```
operation = video_client.annotate_video(path, features=features)
```
Becomes:
```
operation = video_client.annotate_video(input_uri=path, features=features)
```

* Update dependency google-cloud-videointelligence to v1.15.0 [(#4041)](GoogleCloudPlatform/python-docs-samples#4041)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [google-cloud-videointelligence](https://togithub.com/googleapis/python-videointelligence) | minor | `==1.14.0` -> `==1.15.0` |

---

### Release Notes

<details>
<summary>googleapis/python-videointelligence</summary>

### [`v1.15.0`](https://togithub.com/googleapis/python-videointelligence/blob/master/CHANGELOG.md#&#8203;1150-httpswwwgithubcomgoogleapispython-videointelligencecomparev1140v1150-2020-06-09)

[Compare Source](https://togithub.com/googleapis/python-videointelligence/compare/v1.14.0...v1.15.0)

##### Features

-   add support for streaming automl action recognition in v1p3beta1; make 'features' a positional param for annotate_video in betas ([#&#8203;31](https://www.github.com/googleapis/python-videointelligence/issues/31)) ([586f920](https://www.github.com/googleapis/python-videointelligence/commit/586f920a1932e1a813adfed500502fba0ff5edb7)), closes [#&#8203;517](https://www.github.com/googleapis/python-videointelligence/issues/517) [#&#8203;538](https://www.github.com/googleapis/python-videointelligence/issues/538) [#&#8203;565](https://www.github.com/googleapis/python-videointelligence/issues/565) [#&#8203;576](https://www.github.com/googleapis/python-videointelligence/issues/576) [#&#8203;506](https://www.github.com/googleapis/python-videointelligence/issues/506) [#&#8203;586](https://www.github.com/googleapis/python-videointelligence/issues/586) [#&#8203;585](https://www.github.com/googleapis/python-videointelligence/issues/585)

</details>

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Never, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#GoogleCloudPlatform/python-docs-samples).

* chore(deps): update dependency pytest to v5.4.3 [(#4279)](GoogleCloudPlatform/python-docs-samples#4279)

* chore(deps): update dependency pytest to v5.4.3

* specify pytest for python 2 in appengine

Co-authored-by: Leah Cole <[email protected]>

* Update dependency pytest to v6 [(#4390)](GoogleCloudPlatform/python-docs-samples#4390)

* chore: pin sphinx

* chore: adds samples templates

* chore: temporarily pins sphinx

* chore: blacken noxfile

* chore: lints

* chore(deps): update dependency google-cloud-videointelligence to v1.16.0 [(#4798)](GoogleCloudPlatform/python-docs-samples#4798)

* chore: fixes flaky tests

* chore(deps): update dependency pytest to v6.1.1 [(#4761)](GoogleCloudPlatform/python-docs-samples#4761)

* chore(deps): update dependency pytest to v6.1.2 [(#4921)](GoogleCloudPlatform/python-docs-samples#4921)

Co-authored-by: Charles Engelke <[email protected]>

* chore: updates samples templates

* chore: cleans up merge conflicts

* chore: blacken

* feat!: use microgenerator

* docs: update samples for microgenerator client

* docs: updates shotchange samples to microgen

* chore: deletes temp files

* chore: lint and blacken

* Update UPGRADING.md

Co-authored-by: Bu Sun Kim <[email protected]>

* Update setup.py

Co-authored-by: Bu Sun Kim <[email protected]>

Co-authored-by: Gus Class <[email protected]>
Co-authored-by: Bill Prin <[email protected]>
Co-authored-by: florencep <[email protected]>
Co-authored-by: DPE bot <[email protected]>
Co-authored-by: Jon Wayne Parrott <[email protected]>
Co-authored-by: Yu-Han Liu <[email protected]>
Co-authored-by: michaelawyu <[email protected]>
Co-authored-by: Perry Stoll <[email protected]>
Co-authored-by: Frank Natividad <[email protected]>
Co-authored-by: michaelawyu <[email protected]>
Co-authored-by: Alix Hamilton <[email protected]>
Co-authored-by: Charles Engelke <[email protected]>
Co-authored-by: Yu-Han Liu <[email protected]>
Co-authored-by: Kurtis Van Gent <[email protected]>
Co-authored-by: Doug Mahugh <[email protected]>
Co-authored-by: WhiteSource Renovate <[email protected]>
Co-authored-by: Eric Schmidt <[email protected]>
Co-authored-by: Leah Cole <[email protected]>
Co-authored-by: gcf-merge-on-green[bot] <60162190+gcf-merge-on-green[bot]@users.noreply.github.com>
Co-authored-by: Charles Engelke <[email protected]>
Co-authored-by: Bu Sun Kim <[email protected]>
  • Loading branch information
22 people authored Nov 19, 2020
1 parent b529950 commit 32ef47f
Show file tree
Hide file tree
Showing 194 changed files with 21,890 additions and 28,815 deletions.
17 changes: 6 additions & 11 deletions packages/google-cloud-videointelligence/.coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Generated by synthtool. DO NOT EDIT!
[run]
branch = True
omit =
google/cloud/__init__.py

[report]
fail_under = 100
show_missing = True
omit = google/cloud/texttospeech/__init__.py
exclude_lines =
# Re-enable the standard pragma
pragma: NO COVER
# Ignore debug-only repr
def __repr__
# Ignore abstract methods
raise NotImplementedError
omit =
*/gapic/*.py
*/proto/*.py
*/core/*.py
*/site-packages/*.py
google/cloud/__init__.py
# 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
9 changes: 5 additions & 4 deletions packages/google-cloud-videointelligence/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,13 @@ dependencies.

Supported Python Versions
^^^^^^^^^^^^^^^^^^^^^^^^^
Python >= 3.5
Python >= 3.6

Deprecated Python Versions
^^^^^^^^^^^^^^^^^^^^^^^^^^
Python == 2.7. Python 2.7 support will be removed on January 1, 2020.
Unsupported Python Versions
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Python == 2.7.

The last version of this library compatible with Python 2.7 is google-cloud-videointelligence==1.17.0.

Mac/Linux
^^^^^^^^^
Expand Down
154 changes: 154 additions & 0 deletions packages/google-cloud-videointelligence/UPGRADING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
# 2.0.0 Migration Guide

The 2.0 release of the `google-cloud-videointelligence` client is a significant upgrade based on a [next-gen code generator](https://github.com/googleapis/gapic-generator-python), and includes substantial interface changes. Existing code written for earlier versions of this library will likely require updates to use this version. This document describes the changes that have been made, and what you need to do to update your usage.

If you experience issues or have questions, please file an [issue](https://github.com/googleapis/python-videointelligence/issues).

## Supported Python Versions

> **WARNING**: Breaking change
The 2.0.0 release requires Python 3.6+.


## Method Calls

> **WARNING**: Breaking change
Methods expect request objects. We provide a script that will convert most common use cases.

* Install the library

```py
python3 -m pip install google-cloud-videointelligence
```

* The script `fixup_keywords.py` is shipped with the library. It expects
an input directory (with the code to convert) and an empty destination directory.

```sh
$ fixup_keywords.py --input-directory .samples/ --output-directory samples/
```

**Before:**
```py
from google.cloud import videointelligence

client = videointelligence.VideoIntelligenceServiceClient()
input_uri = "gs://cloud-samples-data/video/cat.mp4"
features = [videointelligence.enums.Feature.LABEL_DETECTION]
operation = client.annotate_video(
input_uri=input_uri, features=features
)
```


**After:**
```py
from google.cloud import videointelligence

client = videointelligence.VideoIntelligenceServiceClient()
input_uri = "gs://cloud-samples-data/video/cat.mp4"
features = [videointelligence.Feature.LABEL_DETECTION]
operation = client.annotate_video(request={"input_uri": input_uri, "features": features})
```

### More Details

In `google-cloud-videointelligence<2.0.0`, parameters required by the API were positional parameters and optional parameters were keyword parameters.

**Before:**
```py
def annotate_video(
self,
input_uri=None,
input_content=None,
features=None,
video_context=None,
output_uri=None,
location_id=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
```

In the 2.0.0 release, all methods have a single positional parameter `request`. Method docstrings indicate whether a parameter is required or optional.

Some methods have additional keyword only parameters. The available parameters depend on the [`google.api.method_signature` annotation](https://github.com/googleapis/googleapis/blob/master/google/cloud/videointelligence/v1/video_intelligence.proto#L51) specified by the API producer.


**After:**
```py
def annotate_video(
self,
request: video_intelligence.AnnotateVideoRequest = None,
*,
input_uri: str = None,
features: Sequence[video_intelligence.Feature] = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
```

> **NOTE:** The `request` parameter and flattened keyword parameters for the API are mutually exclusive.
> Passing both will result in an error.

Both of these calls are valid:

```py
response = client.annotate_video(
request={
"input_uri": input_uri,
"features": features
}
)
```

```py
response = client.annotate_video(
input_uri=input_uri
features=features
)
```

This call is invalid because it mixes `request` with a keyword argument `features`. Executing this code
will result in an error.

```py
response = client.annotate_video(
request={
"input_uri": input_uri
},
features=features
)
```



## Enums and Types


> **WARNING**: Breaking change
The submodules `enums` and `types` have been removed.

**Before:**
```py

from google.cloud import videointelligence

features = [videointelligence.enums.Feature.TEXT_DETECTION]
video_context = videointelligence.types.VideoContext()
```


**After:**
```py
from google.cloud import videointelligence

features = [videointelligence.Feature.TEXT_DETECTION]
video_context = videointelligence.VideoContext()
```
1 change: 1 addition & 0 deletions packages/google-cloud-videointelligence/docs/UPGRADING.md
6 changes: 0 additions & 6 deletions packages/google-cloud-videointelligence/docs/gapic/v1/api.rst

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

39 changes: 25 additions & 14 deletions packages/google-cloud-videointelligence/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,50 @@ API. By default, you will get ``v1``, the latest stable version.
.. toctree::
:maxdepth: 2

gapic/v1/api
gapic/v1/types
videointelligence_v1/services
videointelligence_v1/types

A new beta release with additional features over the current stable version,
spelled ``v1p3beta1``, is provided to allow you to use these new features.
These are expected to move into the stable release soon; until then, the
A beta release with additional features over the current stable version,
spelled ``v1p3beta1``, is also provided.
These are expected to move into the stable release; until then, the
usual beta admonishment (changes are possible, etc.) applies.

An API and type reference is provided for this beta:

.. toctree::
:maxdepth: 2

gapic/v1p3beta1/api
gapic/v1p3beta1/types
videointelligence_v1p3beta1/services
videointelligence_v1p3beta1/types

The previous beta releases, spelled ``v1p2beta1``, ``v1p1beta1``, and
``v1beta2``, are provided to continue to support code previously written
against them. In order to use ththem, you will want to import from e.g.
``google.cloud.videointelligence_v1beta2`` in lieu of
``google.cloud.videointelligence_v1``.

An API and type reference is provided the these betas also:
An API and type reference is provided for these betas also:

.. toctree::
:maxdepth: 2

gapic/v1p2beta1/api
gapic/v1p2beta1/types
gapic/v1p1beta1/api
gapic/v1p1beta1/types
gapic/v1beta2/api
gapic/v1beta2/types
videointelligence_v1p2beta1/services
videointelligence_v1p2beta1/types
videointelligence_v1p1beta1/services
videointelligence_v1p1beta1/types
videointelligence_v1beta2/services
videointelligence_v1beta2/types


Migration Guide
---------------

See the guide below for instructions on migrating to the 2.x release of this library.

.. toctree::
:maxdepth: 2

UPGRADING


Changelog
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Services for Google Cloud Videointelligence v1 API
==================================================

.. automodule:: google.cloud.videointelligence_v1.services.video_intelligence_service
:members:
:inherited-members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Types for Google Cloud Videointelligence v1 API
===============================================

.. automodule:: google.cloud.videointelligence_v1.types
:members:
:show-inheritance:
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Services for Google Cloud Videointelligence v1beta2 API
=======================================================

.. automodule:: google.cloud.videointelligence_v1beta2.services.video_intelligence_service
:members:
:inherited-members:
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Types for Google Cloud Video Intelligence API Client
Types for Google Cloud Videointelligence v1beta2 API
====================================================

.. automodule:: google.cloud.videointelligence_v1beta2.types
:members:
:noindex:
:show-inheritance:
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Services for Google Cloud Videointelligence v1p1beta1 API
=========================================================

.. automodule:: google.cloud.videointelligence_v1p1beta1.services.video_intelligence_service
:members:
:inherited-members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Types for Google Cloud Videointelligence v1p1beta1 API
======================================================

.. automodule:: google.cloud.videointelligence_v1p1beta1.types
:members:
:show-inheritance:
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Services for Google Cloud Videointelligence v1p2beta1 API
=========================================================

.. automodule:: google.cloud.videointelligence_v1p2beta1.services.video_intelligence_service
:members:
:inherited-members:
Loading

0 comments on commit 32ef47f

Please sign in to comment.