Repository: iterative/dvc
Pull request #10298 (2024-02-10 03:07:40)

deps: bump dvc-studio-client to >=0.19,<1

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/iterative/dvc/pull/10298?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=iterative) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Comparison is base [(`f639ab5`)](https://app.codecov.io/gh/iterative/dvc/commit/f639ab50ab9f3bff7a2971e1a129aa38955ef6a4?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=iterative) 90.42% compared to head [(`994abd4`)](https://app.codecov.io/gh/iterative/dvc/pull/10298?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=iterative) 90.06%.


<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##             main   #10298      +/-   ##
==========================================
- Coverage   90.42%   90.06%   -0.37%     
==========================================
  Files         494      494              
  Lines       37820    37821       +1     
  Branches     5469     5460       -9     
==========================================
- Hits        34200    34063     -137     
- Misses       2986     3079      +93     
- Partials      634      679      +45     
```



</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/iterative/dvc/pull/10298?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=iterative).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=iterative).


Patch:
diff --git a/dvc/commands/studio.py b/dvc/commands/studio.py
index 085dd6592..49009bfff 100644
--- a/dvc/commands/studio.py
+++ b/dvc/commands/studio.py
@@ -31,12 +31,13 @@ class CmdStudioLogin(CmdConfig):
                 "logout using 'dvc studio logout'."
             )
 
+        open_browser = not self.args.no_open
         try:
             _, access_token = get_access_token(
                 token_name=name,
                 hostname=hostname,
                 scopes=scopes,
-                use_device_code=self.args.no_open,
+                open_browser=open_browser,
                 client_name="DVC",
             )
         except StudioAuthError as e:
diff --git a/pyproject.toml b/pyproject.toml
index c0ab08319..42deb2c6e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -38,7 +38,7 @@ dependencies = [
     "dvc-data>=3.10,<3.12",
     "dvc-http>=2.29.0",
     "dvc-render>=1.0.1,<2",
-    "dvc-studio-client>=0.17.1,<1",
+    "dvc-studio-client>=0.19,<1",
     "dvc-task>=0.3.0,<1",
     "flatten_dict<1,>=0.4.1",
     # https://github.com/iterative/dvc/issues/9654


Test patch:
diff --git a/tests/unit/command/test_studio.py b/tests/unit/command/test_studio.py
index 20d1b4ca0..6484d71c4 100644
--- a/tests/unit/command/test_studio.py
+++ b/tests/unit/command/test_studio.py
@@ -1,4 +1,4 @@
-from dvc_studio_client.auth import AuthenticationExpired
+from dvc_studio_client.auth import AuthorizationExpiredError
 
 from dvc.cli import main
 from dvc.utils.studio import STUDIO_URL
@@ -6,9 +6,9 @@ from dvc.utils.studio import STUDIO_URL
 
 def test_studio_login_token_check_failed(mocker):
     mocker.patch(
-        "dvc_studio_client.auth.get_access_token", side_effect=AuthenticationExpired
+        "dvc_studio_client.auth.get_access_token",
+        side_effect=AuthorizationExpiredError,
     )
-
     assert main(["studio", "login"]) == 1
 
 
@@ -52,8 +52,8 @@ def test_studio_login_arguments(mocker):
         token_name="token_name",
         hostname="https://example.com",
         scopes="experiments",
-        use_device_code=True,
         client_name="DVC",
+        open_browser=False,
     )