-
Notifications
You must be signed in to change notification settings - Fork 6.5k
chore(deps): update dependency pytest-asyncio to v1 #13389
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
base: main
Are you sure you want to change the base?
chore(deps): update dependency pytest-asyncio to v1 #13389
Conversation
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.
Hello @renovate-bot, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
Summary of Changes
Hello team, gemini-code-assist here to provide a summary of this pull request. This PR, authored by renovate-bot, focuses on updating the pytest-asyncio
dependency across various test requirement files within the repository. The update targets version 1.0.0
, which is a major version bump from the previously pinned versions (ranging from 0.16.0
to 0.25.3
). This upgrade is a standard dependency maintenance task to ensure we are using the latest stable version of the library, incorporating its newest features, bug fixes, and performance improvements. Reviewers should pay attention to potential breaking changes introduced in the 1.0.0
release of pytest-asyncio
and verify that our test suites remain compatible.
Highlights
- Dependency Update: The primary change is the upgrade of the
pytest-asyncio
library to version1.0.0
in multiplerequirements-test.txt
files. - Major Version Bump: This is a major version update for
pytest-asyncio
, indicating potentially significant changes or breaking API modifications compared to the previous0.x
versions used. - Widespread Impact: The update affects test dependencies in several different sample directories, including
alloydb
,dialogflow-cx
,firestore
,genai
,generative_ai
, andmodel_garden
.
Changelog
Click here to see the changelog
- alloydb/notebooks/requirements-test.txt
- Updated
pytest-asyncio
from0.24.0
to1.0.0
.
- Updated
- dialogflow-cx/requirements-test.txt
- Updated
pytest-asyncio
from0.21.1
to1.0.0
.
- Updated
- firestore/cloud-async-client/requirements-test.txt
- Updated
pytest-asyncio
from0.21.0
(for Python > 3.6) and0.16.0
(for Python < 3.7) to1.0.0
.
- Updated
- genai/controlled_generation/requirements-test.txt
- Updated
pytest-asyncio
from0.23.6
to1.0.0
.
- Updated
- genai/count_tokens/requirements-test.txt
- Updated
pytest-asyncio
from0.23.6
to1.0.0
.
- Updated
- genai/live/requirements-test.txt
- Updated
pytest-asyncio
from0.25.3
to1.0.0
.
- Updated
- genai/model_optimizer/requirements-test.txt
- Updated
pytest-asyncio
from0.23.6
to1.0.0
.
- Updated
- genai/template_folder/requirements-test.txt
- Updated
pytest-asyncio
from0.23.6
to1.0.0
.
- Updated
- genai/thinking/requirements-test.txt
- Updated
pytest-asyncio
from0.23.6
to1.0.0
.
- Updated
- genai/tools/requirements-test.txt
- Updated
pytest-asyncio
from0.23.6
to1.0.0
.
- Updated
- generative_ai/chat_completions/requirements-test.txt
- Updated
pytest-asyncio
from0.23.6
to1.0.0
.
- Updated
- generative_ai/embeddings/requirements-test.txt
- Updated
pytest-asyncio
from0.23.6
to1.0.0
.
- Updated
- generative_ai/evaluation/requirements-test.txt
- Updated
pytest-asyncio
from0.23.6
to1.0.0
.
- Updated
- generative_ai/extensions/requirements-test.txt
- Updated
pytest-asyncio
from0.23.6
to1.0.0
.
- Updated
- generative_ai/function_calling/requirements-test.txt
- Updated
pytest-asyncio
from0.23.6
to1.0.0
.
- Updated
- generative_ai/image_generation/requirements-test.txt
- Updated
pytest-asyncio
from0.23.6
to1.0.0
.
- Updated
- generative_ai/model_garden/requirements-test.txt
- Updated
pytest-asyncio
from0.23.6
to1.0.0
.
- Updated
- generative_ai/model_tuning/requirements-test.txt
- Updated
pytest-asyncio
from0.23.6
to1.0.0
.
- Updated
- generative_ai/prompts/requirements-test.txt
- Updated
pytest-asyncio
from0.23.6
to1.0.0
.
- Updated
- generative_ai/provisioned_throughput/requirements-test.txt
- Updated
pytest-asyncio
from0.23.6
to1.0.0
.
- Updated
- generative_ai/rag/requirements-test.txt
- Updated
pytest-asyncio
from0.23.6
to1.0.0
.
- Updated
- generative_ai/reasoning_engine/requirements-test.txt
- Updated
pytest-asyncio
from0.23.6
to1.0.0
.
- Updated
- model_garden/gemma/requirements-test.txt
- Updated
pytest-asyncio
from0.23.6
to1.0.0
.
- Updated
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Async tests run fast,
Pytest helps them all pass,
New version is here.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request updates pytest-asyncio
to v1.0.0
across multiple requirements-test.txt
files. This is a significant major version upgrade from 0.x
series, which can introduce breaking changes.
While many of the updates are from v0.23.x
or v0.25.x
and might be lower risk (especially where async tests are not heavily used), a few files are jumping from v0.21.x
, which requires more careful consideration due to historical known issues with pytest-asyncio
versions post-0.21.x
concerning event loop and fixture scopes.
One critical issue has been identified regarding Python version compatibility for pytest-asyncio 1.0.0
in firestore/cloud-async-client/requirements-test.txt
.
It's crucial that all corresponding test suites pass in CI environments after these updates. Please pay special attention to the test results for dialogflow-cx
and firestore/cloud-async-client
.
Summary of Findings
- Python Version Incompatibility: In
firestore/cloud-async-client/requirements-test.txt
, the Python version markers forpytest-asyncio==1.0.0
are incorrect, as this version requires Python 3.8+. This is a critical issue that could lead to installation failures. - Risk of Breaking Changes from Large Version Jump: For
dialogflow-cx/requirements-test.txt
andfirestore/cloud-async-client/requirements-test.txt
, the update frompytest-asyncio v0.21.x
tov1.0.0
is a large leap. Past versions between these releases had known issues that could break test suites. Thorough testing is essential to ensure compatibility. - Dependency Update Verification: This PR updates
pytest-asyncio
to a new major version (1.0.0
). It's important to ensure all tests pass in CI across all affected samples to confirm compatibility and catch any regressions introduced by this update.
Merge Readiness
This pull request updates pytest-asyncio
to v1.0.0
. There is a critical issue in firestore/cloud-async-client/requirements-test.txt
concerning Python version compatibility that must be addressed. Additionally, there are high-risk updates for dialogflow-cx
and firestore/cloud-async-client
due to the significant version jump from 0.21.x
, which had different behavior regarding asyncio event loops and fixtures compared to later versions.
I recommend that the identified critical issue be fixed and that the high-risk updates be carefully validated through CI testing before this PR is merged. As I am an AI, I am not authorized to approve pull requests; please ensure this PR is reviewed and approved by a human maintainer after addressing the feedback.
pytest-asyncio==1.0.0; python_version > '3.6' | ||
pytest-asyncio==1.0.0; python_version < '3.7' |
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.
The updated pytest-asyncio==1.0.0
requires Python 3.8 or newer. The current version markers seem to be a carry-over from older pytest-asyncio
versions and are now incompatible or misleading.
Specifically:
pytest-asyncio==1.0.0; python_version > '3.6'
: This would attempt to installpytest-asyncio 1.0.0
on Python 3.7, where it's not supported.pytest-asyncio==1.0.0; python_version < '3.7'
: This line attempts to installpytest-asyncio 1.0.0
on Python versions older than 3.7 (e.g., 3.6), where it's also not supported. This will likely lead to installation errors in such environments.
Given that pytest==8.2.0
(also in this file) requires Python 3.8+, it's likely that Python versions older than 3.8 are no longer targeted for these tests.
Could we update these lines to accurately reflect the Python version compatibility of pytest-asyncio==1.0.0
? A single line specifying python_version >= '3.8'
would be appropriate.
pytest-asyncio==1.0.0; python_version >= '3.8'
pytest-asyncio==1.0.0 |
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 is a significant jump from pytest-asyncio==0.21.1
to 1.0.0
. Versions of pytest-asyncio
after 0.21.x
(specifically around 0.23.x
) had known issues regarding changes in event loop and fixture scope management that could break test suites previously working with 0.21.x
. The release notes for v0.23.7
and v0.23.8
(included in this PR's description) explicitly warned about this and recommended staying on v0.21
if affected.
While these specific warnings are not present in the release notes for v0.25.0
onwards, indicating the issue might be resolved or mitigated, the large version leap warrants careful testing.
Could you please ensure that the tests in dialogflow-cx/
, particularly streaming_detect_intent_infinite_test.py
which uses @pytest.mark.asyncio
, are thoroughly checked and pass with this new version? This is important to confirm that the test suite is not affected by the past behavior changes.
@@ -1,4 +1,4 @@ | |||
pytest==8.2.0 | |||
pytest-asyncio==0.21.0; python_version > '3.6' | |||
pytest-asyncio==0.16.0; python_version < '3.7' | |||
pytest-asyncio==1.0.0; python_version > '3.6' |
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.
Similar to the concern raised for dialogflow-cx
, this update involves a significant jump from pytest-asyncio==0.21.0
to 1.0.0
(for Python > 3.6).
As mentioned, pytest-asyncio
versions post-0.21.x
(around 0.23.x
) introduced changes to event loop and fixture scope handling that could potentially break existing test suites. The firestore/cloud-async-client/
directory contains extensive use of async tests (snippets_test.py
, distributed_counters_test.py
).
Given the substantial changes between 0.21.0
and 1.0.0
, it's crucial to verify that these tests continue to function correctly. Please ensure thorough CI validation for this package.
This PR contains the following updates:
==0.23.6
->==1.0.0
==0.25.3
->==1.0.0
==0.16.0
->==1.0.0
==0.21.0
->==1.0.0
==0.21.1
->==1.0.0
==0.24.0
->==1.0.0
Release Notes
pytest-dev/pytest-asyncio (pytest-asyncio)
v1.0.0
Compare Source
v0.26.0
: pytest-asyncio 0.26.0Compare Source
pytest_asyncio.fixture
#1045typing-extensions
as additional dependency for Python<3.10
#1045v0.25.3
: pytest-asyncio 0.25.3Compare Source
v0.25.2
: pytest-asyncio 0.25.2Compare Source
loop.shutdown_asyncgens()
before closing the event loop to ensure async generators are closed in the same manner asasyncio.run
does #1034v0.25.1
: pytest-asyncio 0.25.1Compare Source
v0.25.0
: pytest-asyncio 0.25.0Compare Source
0.25.0 (2024-12-13)
@pytest.fixture
in strict mode. This will become an error in a future version of flake8-asyncio. #979v0.24.0
: pytest-asyncio 0.24.0Compare Source
0.24.0 (2024-08-22)
pytest_asyncio.fixture
. Users are encouraged to use the loop_scope keyword argument, which does exactly the same.@pytest.mark.asyncio
. #812v0.23.8
: pytest-asyncio 0.23.8Compare Source
0.23.8 (2024-07-17)
Known issues
As of v0.23, pytest-asyncio attaches an asyncio event loop to each item of the test suite (i.e. session, packages, modules, classes, functions) and allows tests to be run in those loops when marked accordingly. Pytest-asyncio currently assumes that async fixture scope is correlated with the new event loop scope. This prevents fixtures from being evaluated independently from the event loop scope and breaks some existing test suites (see #706). For example, a test suite may require all fixtures and tests to run in the same event loop, but have async fixtures that are set up and torn down for each module. If you're affected by this issue, please continue using the v0.21 release, until it is resolved.
v0.23.7
: pytest-asyncio 0.23.7Compare Source
0.23.7 (2024-05-19)
Known issues
As of v0.23, pytest-asyncio attaches an asyncio event loop to each item of the test suite (i.e. session, packages, modules, classes, functions) and allows tests to be run in those loops when marked accordingly. Pytest-asyncio currently assumes that async fixture scope is correlated with the new event loop scope. This prevents fixtures from being evaluated independently from the event loop scope and breaks some existing test suites (see #706). For example, a test suite may require all fixtures and tests to run in the same event loop, but have async fixtures that are set up and torn down for each module. If you're affected by this issue, please continue using the v0.21 release, until it is resolved.
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Never, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.