google-analytics-cli 0.1.4__tar.gz → 0.1.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/PKG-INFO +1 -1
  2. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/pyproject.toml +1 -1
  3. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/upgrade_cmd.py +11 -8
  4. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_upgrade_cmd.py +47 -4
  5. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/uv.lock +1 -1
  6. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/.api-snapshots/analyticsadmin_v1alpha.json +0 -0
  7. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/.api-snapshots/analyticsadmin_v1beta.json +0 -0
  8. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/.api-snapshots/analyticsdata_v1alpha.json +0 -0
  9. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/.api-snapshots/analyticsdata_v1beta.json +0 -0
  10. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/.github/workflows/api-watch.yml +0 -0
  11. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/.github/workflows/ci.yml +0 -0
  12. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/.github/workflows/release.yml +0 -0
  13. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/.gitignore +0 -0
  14. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/.python-version +0 -0
  15. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/README.md +0 -0
  16. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/install.sh +0 -0
  17. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/scripts/check_api_changes.py +0 -0
  18. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/__init__.py +0 -0
  19. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/api/__init__.py +0 -0
  20. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/api/client.py +0 -0
  21. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/auth/__init__.py +0 -0
  22. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/auth/credentials.py +0 -0
  23. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/auth/oauth.py +0 -0
  24. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/auth/service_account.py +0 -0
  25. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/__init__.py +0 -0
  26. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/access_bindings.py +0 -0
  27. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/access_reports.py +0 -0
  28. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/account_summaries.py +0 -0
  29. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/accounts.py +0 -0
  30. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/agent_cmd.py +0 -0
  31. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/annotations.py +0 -0
  32. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/audiences.py +0 -0
  33. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/auth_cmd.py +0 -0
  34. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/bigquery_links.py +0 -0
  35. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/calculated_metrics.py +0 -0
  36. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/channel_groups.py +0 -0
  37. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/completions_cmd.py +0 -0
  38. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/config_cmd.py +0 -0
  39. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/custom_dimensions.py +0 -0
  40. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/custom_metrics.py +0 -0
  41. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/data_retention.py +0 -0
  42. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/data_streams.py +0 -0
  43. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/enhanced_measurement.py +0 -0
  44. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/event_create_rules.py +0 -0
  45. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/event_edit_rules.py +0 -0
  46. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/firebase_links.py +0 -0
  47. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/google_ads_links.py +0 -0
  48. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/key_events.py +0 -0
  49. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/mp_secrets.py +0 -0
  50. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/properties.py +0 -0
  51. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/property_settings.py +0 -0
  52. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/commands/reports.py +0 -0
  53. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/config/__init__.py +0 -0
  54. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/config/constants.py +0 -0
  55. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/config/store.py +0 -0
  56. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/main.py +0 -0
  57. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/utils/__init__.py +0 -0
  58. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/utils/describe.py +0 -0
  59. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/utils/dry_run.py +0 -0
  60. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/utils/errors.py +0 -0
  61. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/utils/filters.py +0 -0
  62. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/utils/output.py +0 -0
  63. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/src/ga_cli/utils/pagination.py +0 -0
  64. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/__init__.py +0 -0
  65. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/conftest.py +0 -0
  66. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_access_bindings.py +0 -0
  67. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_access_reports.py +0 -0
  68. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_account_summaries.py +0 -0
  69. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_accounts.py +0 -0
  70. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_agent_cmd.py +0 -0
  71. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_annotations.py +0 -0
  72. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_api_client.py +0 -0
  73. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_api_diff.py +0 -0
  74. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_audiences.py +0 -0
  75. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_auth_cmd.py +0 -0
  76. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_bigquery_links.py +0 -0
  77. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_calculated_metrics.py +0 -0
  78. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_channel_groups.py +0 -0
  79. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_completions_cmd.py +0 -0
  80. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_config_cmd.py +0 -0
  81. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_credentials.py +0 -0
  82. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_custom_dimensions.py +0 -0
  83. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_custom_metrics.py +0 -0
  84. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_data_retention.py +0 -0
  85. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_data_streams.py +0 -0
  86. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_describe.py +0 -0
  87. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_dry_run.py +0 -0
  88. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_enhanced_measurement.py +0 -0
  89. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_errors.py +0 -0
  90. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_event_create_rules.py +0 -0
  91. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_event_edit_rules.py +0 -0
  92. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_filters.py +0 -0
  93. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_firebase_links.py +0 -0
  94. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_google_ads_links.py +0 -0
  95. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_install_script.sh +0 -0
  96. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_key_events.py +0 -0
  97. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_mp_secrets.py +0 -0
  98. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_output.py +0 -0
  99. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_pagination.py +0 -0
  100. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_properties.py +0 -0
  101. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_property_settings.py +0 -0
  102. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_quiet_nocolor.py +0 -0
  103. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_reports.py +0 -0
  104. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_reports_batch.py +0 -0
  105. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_reports_funnel.py +0 -0
  106. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_reports_pivot.py +0 -0
  107. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_service_account.py +0 -0
  108. {google_analytics_cli-0.1.4 → google_analytics_cli-0.1.5}/tests/test_version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: google-analytics-cli
3
- Version: 0.1.4
3
+ Version: 0.1.5
4
4
  Summary: Command-line interface for Google Analytics 4
5
5
  Project-URL: Homepage, https://github.com/daidalytics/google-analytics-cli
6
6
  Project-URL: Repository, https://github.com/daidalytics/google-analytics-cli
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "google-analytics-cli"
3
- version = "0.1.4"
3
+ version = "0.1.5"
4
4
  description = "Command-line interface for Google Analytics 4"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -20,7 +20,7 @@ upgrade_app = typer.Typer(
20
20
  name="upgrade", help="Check for and install updates", invoke_without_command=True
21
21
  )
22
22
 
23
- PYPI_URL = "https://pypi.org/pypi/ga-cli/json"
23
+ PYPI_URL = "https://pypi.org/pypi/google-analytics-cli/json"
24
24
  PYPI_TIMEOUT = 5
25
25
  UPDATE_CHECK_INTERVAL = 86400 # 24 hours in seconds
26
26
 
@@ -49,11 +49,13 @@ def _is_newer(latest: str, current: str) -> bool:
49
49
  def _detect_installer() -> list[str]:
50
50
  """Detect the best install command to upgrade ga-cli.
51
51
 
52
- Checks for pipx first, then falls back to pip via the current interpreter.
52
+ Checks for uv first, then pipx, then falls back to pip.
53
53
  """
54
+ if shutil.which("uv"):
55
+ return ["uv", "pip", "install", "--upgrade", "google-analytics-cli"]
54
56
  if shutil.which("pipx"):
55
- return ["pipx", "upgrade", "ga-cli"]
56
- return [sys.executable, "-m", "pip", "install", "--upgrade", "ga-cli"]
57
+ return ["pipx", "upgrade", "google-analytics-cli"]
58
+ return [sys.executable, "-m", "pip", "install", "--upgrade", "google-analytics-cli"]
57
59
 
58
60
 
59
61
  @upgrade_app.callback(invoke_without_command=True)
@@ -78,11 +80,12 @@ def upgrade_cmd(
78
80
  if force:
79
81
  info(f"Force-reinstalling ga-cli {current}...")
80
82
  cmd = _detect_installer()
81
- # Append --force-reinstall for pip-based installs
82
- if cmd[0] != "pipx":
83
- cmd.append("--force-reinstall")
83
+ if cmd[0] == "pipx":
84
+ cmd = ["pipx", "install", "--force", "google-analytics-cli"]
85
+ elif cmd[0] == "uv":
86
+ cmd.append("--reinstall")
84
87
  else:
85
- cmd = ["pipx", "install", "--force", "ga-cli"]
88
+ cmd.append("--force-reinstall")
86
89
  result = subprocess.run(cmd, capture_output=True, text=True)
87
90
  if result.returncode == 0:
88
91
  success(f"Reinstalled ga-cli {current}.")
@@ -110,7 +110,7 @@ class TestUpgradeRun:
110
110
  "ga_cli.commands.upgrade_cmd.subprocess.run"
111
111
  ) as mock_run, patch(
112
112
  "ga_cli.commands.upgrade_cmd._detect_installer",
113
- return_value=["pip", "install", "--upgrade", "ga-cli"],
113
+ return_value=["pip", "install", "--upgrade", "google-analytics-cli"],
114
114
  ):
115
115
  mock_run.return_value = MagicMock(returncode=0)
116
116
  result = runner.invoke(app, ["upgrade"])
@@ -137,7 +137,7 @@ class TestUpgradeRun:
137
137
  "ga_cli.commands.upgrade_cmd.subprocess.run"
138
138
  ) as mock_run, patch(
139
139
  "ga_cli.commands.upgrade_cmd._detect_installer",
140
- return_value=["pip", "install", "--upgrade", "ga-cli"],
140
+ return_value=["pip", "install", "--upgrade", "google-analytics-cli"],
141
141
  ):
142
142
  mock_run.return_value = MagicMock(returncode=0)
143
143
  result = runner.invoke(app, ["upgrade", "--force"])
@@ -152,7 +152,7 @@ class TestUpgradeRun:
152
152
  "ga_cli.commands.upgrade_cmd.subprocess.run"
153
153
  ) as mock_run, patch(
154
154
  "ga_cli.commands.upgrade_cmd._detect_installer",
155
- return_value=["pip", "install", "--upgrade", "ga-cli"],
155
+ return_value=["pip", "install", "--upgrade", "google-analytics-cli"],
156
156
  ):
157
157
  mock_run.return_value = MagicMock(returncode=1, stderr="install error")
158
158
  result = runner.invoke(app, ["upgrade"])
@@ -160,12 +160,15 @@ class TestUpgradeRun:
160
160
  assert "Upgrade failed" in result.output
161
161
 
162
162
  def test_upgrade_detects_pipx(self):
163
+ def _which(name):
164
+ return "/usr/local/bin/pipx" if name == "pipx" else None
165
+
163
166
  with patch(
164
167
  "ga_cli.commands.upgrade_cmd._check_pypi_version", return_value="2.0.0"
165
168
  ), patch("ga_cli.commands.upgrade_cmd.__version__", "0.1.0"), patch(
166
169
  "ga_cli.commands.upgrade_cmd.subprocess.run"
167
170
  ) as mock_run, patch(
168
- "ga_cli.commands.upgrade_cmd.shutil.which", return_value="/usr/local/bin/pipx"
171
+ "ga_cli.commands.upgrade_cmd.shutil.which", side_effect=_which
169
172
  ):
170
173
  mock_run.return_value = MagicMock(returncode=0)
171
174
  result = runner.invoke(app, ["upgrade"])
@@ -173,6 +176,46 @@ class TestUpgradeRun:
173
176
  cmd_args = mock_run.call_args[0][0]
174
177
  assert "pipx" in cmd_args
175
178
 
179
+ def test_upgrade_detects_uv(self):
180
+ def _which(name):
181
+ return "/usr/local/bin/uv" if name == "uv" else None
182
+
183
+ with patch(
184
+ "ga_cli.commands.upgrade_cmd._check_pypi_version", return_value="2.0.0"
185
+ ), patch("ga_cli.commands.upgrade_cmd.__version__", "0.1.0"), patch(
186
+ "ga_cli.commands.upgrade_cmd.subprocess.run"
187
+ ) as mock_run, patch(
188
+ "ga_cli.commands.upgrade_cmd.shutil.which", side_effect=_which
189
+ ):
190
+ mock_run.return_value = MagicMock(returncode=0)
191
+ result = runner.invoke(app, ["upgrade"])
192
+ assert result.exit_code == 0
193
+ cmd_args = mock_run.call_args[0][0]
194
+ assert "uv" in cmd_args
195
+
196
+ def test_upgrade_uv_preferred_over_pipx(self):
197
+ """When both uv and pipx are available, uv should be preferred."""
198
+ def _which(name):
199
+ if name == "uv":
200
+ return "/usr/local/bin/uv"
201
+ if name == "pipx":
202
+ return "/usr/local/bin/pipx"
203
+ return None
204
+
205
+ with patch(
206
+ "ga_cli.commands.upgrade_cmd._check_pypi_version", return_value="2.0.0"
207
+ ), patch("ga_cli.commands.upgrade_cmd.__version__", "0.1.0"), patch(
208
+ "ga_cli.commands.upgrade_cmd.subprocess.run"
209
+ ) as mock_run, patch(
210
+ "ga_cli.commands.upgrade_cmd.shutil.which", side_effect=_which
211
+ ):
212
+ mock_run.return_value = MagicMock(returncode=0)
213
+ result = runner.invoke(app, ["upgrade"])
214
+ assert result.exit_code == 0
215
+ cmd_args = mock_run.call_args[0][0]
216
+ assert "uv" in cmd_args
217
+ assert "pipx" not in cmd_args
218
+
176
219
 
177
220
  class TestDailyUpdateCheck:
178
221
  def test_skips_when_checked_recently(self, isolated_config_dir):
@@ -306,7 +306,7 @@ wheels = [
306
306
 
307
307
  [[package]]
308
308
  name = "google-analytics-cli"
309
- version = "0.1.3"
309
+ version = "0.1.4"
310
310
  source = { editable = "." }
311
311
  dependencies = [
312
312
  { name = "click" },