-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add speech api streaming sample. #239
Conversation
Oh wait I should write a test shouldn't I... |
faa1ded
to
fad9687
Compare
Okay, added tests. PTAL |
@@ -86,6 +86,11 @@ def session_tests(session, interpreter, extra_pytest_args=None): | |||
# allows users to run a particular test instead of all of them. | |||
for sample in (session.posargs or | |||
collect_sample_dirs('.', SESSION_TESTS_BLACKLIST)): | |||
# Install additional dependencies if they exist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could cause some weirdness with clashing dependency versions. I'm okay with this for now, but we should be careful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah - I think we should move to a world where, instead of having a global requirements-py[23].txt at the top level, each sample module would have its own smaller requirements.txt, and the global one would be either empty, or only include the stuff needed for pytest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see what you mean - the virtualenvs are split by session, not by subdir.
Hrm... that's a puzzle... perhaps we could have a separate virtualenv for each subdir that contains a requirements.txt?
Pros:
- Also tests that requirements.txt are valid
Cons:
- Adds overhead to testing
The con might be mitigated if we could run the tests in parallel..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried that originally, and it's dreadfully slow. :/
Finished first review pass. In general, I like this but I'm unsure about the control flow. It seems weird to me, but most threaded things are. hmm.. |
Updated. Re: control flow - yeah, I had an iteration where I made the request stream a class that was an iterator, with a (something like: class RequestStream:
def __init__(self):
self.stop_audio = threading.Event()
self.audio_stream = record_audio(..)
self.is_first_request = True
def __iter__(self):
self.audio_stream.__enter__()
def __next__(self):
if self.is_first_request:
self.is_first_request = False
# ... do the special thing
else if not self.stop_audio.is_set():
# do the normal thing
else:
self.audio_stream.__exit__()
raise StopIteration() Just seemed like a lot of different pieces were interleaved. Travis is having trouble pulling down grpcio... will look into that. |
61c480d
to
bd7b58d
Compare
Please rebase, but otherwise I suppose this LGTM. I would appreciate some more time put into the control flow. Perhaps we can chat about it in person next week? |
Rebased. What do you have in mind for the control flow? At this point it's not a matter of time so much as lack of better ideas. |
Not sure, I'd have to more deeply understand a few things. Much better to discuss in person. Feel free to merge. |
) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [google-cloud-resource-manager](https://togithub.com/googleapis/python-resource-manager) | `==0.30.3` -> `==1.0.1` | [![age](https://badges.renovateapi.com/packages/pypi/google-cloud-resource-manager/1.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/google-cloud-resource-manager/1.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/google-cloud-resource-manager/1.0.1/compatibility-slim/0.30.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/google-cloud-resource-manager/1.0.1/confidence-slim/0.30.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>googleapis/python-resource-manager</summary> ### [`v1.0.1`](https://togithub.com/googleapis/python-resource-manager/blob/master/CHANGELOG.md#​101-httpswwwgithubcomgoogleapispython-resource-managercomparev100v101-2021-07-20) [Compare Source](https://togithub.com/googleapis/python-resource-manager/compare/v0.30.3...v1.0.1) </details> --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **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#github/googleapis/python-asset).
) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [google-cloud-resource-manager](https://togithub.com/googleapis/python-resource-manager) | `==0.30.3` -> `==1.0.1` | [![age](https://badges.renovateapi.com/packages/pypi/google-cloud-resource-manager/1.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/google-cloud-resource-manager/1.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/google-cloud-resource-manager/1.0.1/compatibility-slim/0.30.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/google-cloud-resource-manager/1.0.1/confidence-slim/0.30.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>googleapis/python-resource-manager</summary> ### [`v1.0.1`](https://togithub.com/googleapis/python-resource-manager/blob/master/CHANGELOG.md#​101-httpswwwgithubcomgoogleapispython-resource-managercomparev100v101-2021-07-20) [Compare Source](https://togithub.com/googleapis/python-resource-manager/compare/v0.30.3...v1.0.1) </details> --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **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#github/googleapis/python-asset).
…ssing samples (#239) * docs(samples): add processing samples for OCR, quality, splitter and specialized * Update quality, specialized and splitter samples * Fix lint issues * Fix snippet tags * update library from v1 to v1beta3 * restore previous processing sample to avoid sample tag breakage
…ssing samples (#239) * docs(samples): add processing samples for OCR, quality, splitter and specialized * Update quality, specialized and splitter samples * Fix lint issues * Fix snippet tags * update library from v1 to v1beta3 * restore previous processing sample to avoid sample tag breakage
…ssing samples (#239) * docs(samples): add processing samples for OCR, quality, splitter and specialized * Update quality, specialized and splitter samples * Fix lint issues * Fix snippet tags * update library from v1 to v1beta3 * restore previous processing sample to avoid sample tag breakage
See UPGRADING.md for a list of changes.
See UPGRADING.md for a list of changes.
See UPGRADING.md for a list of changes.
* chore(deps): update all dependencies * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * revert Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
* chore(deps): update all dependencies * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * revert Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
* chore(deps): update all dependencies * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * revert Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
/cc @jonparrott @waprin