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

feat!: use microgenerator #76

Merged
merged 68 commits into from
Nov 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
b674615
Adds tutorials using Cloud Client [(#930)](https://github.com/GoogleC…
gguuss May 5, 2017
8a5ce83
Adds one more tutorial as well as fixes some copy/paste typos. [(#933…
gguuss May 5, 2017
f044dd6
Adds new examples, replaces markdown with restructured text [(#945)](…
gguuss May 18, 2017
cabc26a
Updates requirements [(#952)](https://github.com/GoogleCloudPlatform/…
gguuss May 18, 2017
4f9e8d6
Fix README rst links [(#962)](https://github.com/GoogleCloudPlatform/…
waprin May 24, 2017
384aec2
change the usage file sample [(#958)](https://github.com/GoogleCloudP…
merla18 May 24, 2017
77fdffa
Updates examples for video [(#968)](https://github.com/GoogleCloudPla…
gguuss May 31, 2017
4e138c1
Auto-update dependencies. [(#1093)](https://github.com/GoogleCloudPla…
dpebot Aug 29, 2017
2697805
Update all generated readme auth instructions [(#1121)](https://githu…
Sep 18, 2017
96bb40f
Auto-update dependencies. [(#1123)](https://github.com/GoogleCloudPla…
dpebot Sep 19, 2017
26b6337
Video v1beta2 [(#1088)](https://github.com/GoogleCloudPlatform/python…
dizcology Sep 19, 2017
6b0c420
Added Link to Python Setup Guide [(#1158)](https://github.com/GoogleC…
Oct 12, 2017
aef3308
Tweak doc/help strings for sample tools [(#1160)](https://github.com…
pstoll Oct 12, 2017
3acd5f5
Auto-update dependencies. [(#1186)](https://github.com/GoogleCloudPla…
dpebot Nov 1, 2017
df56ca2
update samples to v1 [(#1221)](https://github.com/GoogleCloudPlatform…
dizcology Nov 29, 2017
5d379ef
Added "Open in Cloud Shell" buttons to README files [(#1254)](https:/…
Dec 7, 2017
f405142
Auto-update dependencies. [(#1377)](https://github.com/GoogleCloudPla…
dpebot Mar 5, 2018
3eadd14
Auto-update dependencies.
dpebot Apr 2, 2018
5686751
Regenerate the README files and fix the Open in Cloud Shell link for …
Apr 7, 2018
8f83644
Update READMEs to fix numbering and add git clone [(#1464)](https://g…
frankyn Apr 26, 2018
7340ef6
Resolved conflicts.
michaelawyu Jun 29, 2018
83d9727
Merge branch 'dpebot-repositorygardener' despite flaky dataproc tests
michaelawyu Jun 29, 2018
4e944dd
Video Intelligence region tag update [(#1639)](https://github.com/Goo…
alixhami Aug 20, 2018
9be4a76
Auto-update dependencies. [(#1658)](https://github.com/GoogleCloudPla…
dpebot Aug 28, 2018
474bd6c
Use explicit URIs for Video Intelligence sample tests [(#1743)](https…
alixhami Oct 10, 2018
dea7bc7
Auto-update dependencies. [(#1846)](https://github.com/GoogleCloudPla…
dpebot Nov 20, 2018
5821ca2
Longer timeouts to address intermittent failures [(#1871)](https://gi…
engelke Nov 26, 2018
932893c
Auto-update dependencies. [(#1980)](https://github.com/GoogleCloudPla…
dpebot Feb 6, 2019
83e80fe
replace demomaker with cloud-samples-data/video for video intelligenc…
dizcology May 16, 2019
403e73a
Adds updates for samples profiler ... vision [(#2439)](https://github…
gguuss Oct 7, 2019
908d403
Auto-update dependencies. [(#2005)](https://github.com/GoogleCloudPla…
dpebot Dec 21, 2019
a4bb557
chore(deps): update dependency google-cloud-videointelligence to v1.1…
renovate-bot Mar 27, 2020
3c6b399
Simplify noxfile setup. [(#2806)](https://github.com/GoogleCloudPlatf…
kurtisvg Apr 2, 2020
2fba04c
fix: changes positional to named pararameters in Video samples [(#401…
telpirion Jun 9, 2020
2687328
Update dependency google-cloud-videointelligence to v1.15.0 [(#4041)]…
renovate-bot Jun 16, 2020
0c11743
chore(deps): update dependency pytest to v5.4.3 [(#4279)](https://git…
renovate-bot Jul 12, 2020
0827a3b
Update dependency pytest to v6 [(#4390)](https://github.com/GoogleClo…
renovate-bot Aug 1, 2020
f71d869
Merge branch 'shotchange-samples' into add-shotchange-samples
danoscarmike Sep 28, 2020
01fd2f9
chore: pin sphinx
danoscarmike Sep 28, 2020
7a8da9f
Merge branch 'master' into add-shotchange-samples
danoscarmike Oct 1, 2020
add5724
chore: adds samples templates
danoscarmike Oct 1, 2020
5a08c9d
chore: temporarily pins sphinx
danoscarmike Oct 1, 2020
1c232ed
Merge branch 'master' into add-shotchange-samples
gcf-merge-on-green[bot] Oct 2, 2020
906cf07
Merge branch 'master' into add-shotchange-samples
danoscarmike Oct 2, 2020
f5a9a0b
chore: blacken noxfile
danoscarmike Oct 2, 2020
218ec30
Merge branch 'add-shotchange-samples' of github.com:danoscarmike/pyth…
danoscarmike Oct 2, 2020
e4d5e55
chore: lints
danoscarmike Oct 6, 2020
827f0e1
chore(deps): update dependency google-cloud-videointelligence to v1.1…
renovate-bot Oct 8, 2020
b324561
chore: fixes flaky tests
danoscarmike Oct 8, 2020
c71f2cc
Merge branch 'master' into add-shotchange-samples
danoscarmike Oct 8, 2020
81fe388
chore(deps): update dependency pytest to v6.1.1 [(#4761)](https://git…
renovate-bot Oct 14, 2020
330a5f6
chore(deps): update dependency pytest to v6.1.2 [(#4921)](https://git…
renovate-bot Oct 29, 2020
8ecf08e
Merge branch 'shotchange-samples' into add-shotchange-samples
danoscarmike Nov 16, 2020
a02408c
chore: updates samples templates
danoscarmike Nov 16, 2020
3541deb
Merge branch 'master' into add-shotchange-samples
danoscarmike Nov 18, 2020
8dd7618
merge upstream
danoscarmike Nov 18, 2020
2de0132
chore: cleans up merge conflicts
danoscarmike Nov 18, 2020
e5e7dfb
chore: blacken
danoscarmike Nov 18, 2020
a532d38
Merge branch 'danoscarmike-add-shotchange-samples'
danoscarmike Nov 18, 2020
121b454
feat!: use microgenerator
danoscarmike Nov 19, 2020
1ddaef4
docs: update samples for microgenerator client
danoscarmike Nov 19, 2020
4e9c361
Merge branch 'master' into micgen
danoscarmike Nov 19, 2020
b71e6a7
docs: updates shotchange samples to microgen
danoscarmike Nov 19, 2020
e095168
chore: deletes temp files
danoscarmike Nov 19, 2020
d4f74d2
Merge branch 'master' into micgen
danoscarmike Nov 19, 2020
c9f3c3b
chore: lint and blacken
danoscarmike Nov 19, 2020
acc6de1
Update UPGRADING.md
danoscarmike Nov 19, 2020
0b0a78d
Update setup.py
danoscarmike Nov 19, 2020
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
17 changes: 6 additions & 11 deletions .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 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 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 docs/UPGRADING.md
6 changes: 0 additions & 6 deletions docs/gapic/v1/api.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/gapic/v1/types.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/gapic/v1beta2/api.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/gapic/v1p1beta1/api.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/gapic/v1p1beta1/types.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/gapic/v1p2beta1/api.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/gapic/v1p2beta1/types.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/gapic/v1p3beta1/api.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/gapic/v1p3beta1/types.rst

This file was deleted.

39 changes: 25 additions & 14 deletions 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
6 changes: 6 additions & 0 deletions docs/videointelligence_v1/services.rst
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:
6 changes: 6 additions & 0 deletions docs/videointelligence_v1/types.rst
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:
6 changes: 6 additions & 0 deletions docs/videointelligence_v1beta2/services.rst
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:
6 changes: 6 additions & 0 deletions docs/videointelligence_v1p1beta1/services.rst
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:
6 changes: 6 additions & 0 deletions docs/videointelligence_v1p1beta1/types.rst
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:
6 changes: 6 additions & 0 deletions docs/videointelligence_v1p2beta1/services.rst
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