obsideo-cli 0.2.4__tar.gz → 0.2.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 (24) hide show
  1. {obsideo_cli-0.2.4 → obsideo_cli-0.2.5}/PKG-INFO +1 -1
  2. {obsideo_cli-0.2.4 → obsideo_cli-0.2.5}/obsideo/cli.py +9 -2
  3. {obsideo_cli-0.2.4 → obsideo_cli-0.2.5}/obsideo_cli.egg-info/PKG-INFO +1 -1
  4. {obsideo_cli-0.2.4 → obsideo_cli-0.2.5}/pyproject.toml +1 -1
  5. {obsideo_cli-0.2.4 → obsideo_cli-0.2.5}/tests/test_cli.py +19 -1
  6. {obsideo_cli-0.2.4 → obsideo_cli-0.2.5}/README.md +0 -0
  7. {obsideo_cli-0.2.4 → obsideo_cli-0.2.5}/obsideo/__init__.py +0 -0
  8. {obsideo_cli-0.2.4 → obsideo_cli-0.2.5}/obsideo/__main__.py +0 -0
  9. {obsideo_cli-0.2.4 → obsideo_cli-0.2.5}/obsideo/manifest.py +0 -0
  10. {obsideo_cli-0.2.4 → obsideo_cli-0.2.5}/obsideo/sync.py +0 -0
  11. {obsideo_cli-0.2.4 → obsideo_cli-0.2.5}/obsideo_cli.egg-info/SOURCES.txt +0 -0
  12. {obsideo_cli-0.2.4 → obsideo_cli-0.2.5}/obsideo_cli.egg-info/dependency_links.txt +0 -0
  13. {obsideo_cli-0.2.4 → obsideo_cli-0.2.5}/obsideo_cli.egg-info/entry_points.txt +0 -0
  14. {obsideo_cli-0.2.4 → obsideo_cli-0.2.5}/obsideo_cli.egg-info/requires.txt +0 -0
  15. {obsideo_cli-0.2.4 → obsideo_cli-0.2.5}/obsideo_cli.egg-info/top_level.txt +0 -0
  16. {obsideo_cli-0.2.4 → obsideo_cli-0.2.5}/obsideo_core/__init__.py +0 -0
  17. {obsideo_cli-0.2.4 → obsideo_cli-0.2.5}/obsideo_core/config.py +0 -0
  18. {obsideo_cli-0.2.4 → obsideo_cli-0.2.5}/obsideo_core/crypto.py +0 -0
  19. {obsideo_cli-0.2.4 → obsideo_cli-0.2.5}/obsideo_core/identity.py +0 -0
  20. {obsideo_cli-0.2.4 → obsideo_cli-0.2.5}/obsideo_core/login.py +0 -0
  21. {obsideo_cli-0.2.4 → obsideo_cli-0.2.5}/obsideo_core/names.py +0 -0
  22. {obsideo_cli-0.2.4 → obsideo_cli-0.2.5}/obsideo_core/storage.py +0 -0
  23. {obsideo_cli-0.2.4 → obsideo_cli-0.2.5}/setup.cfg +0 -0
  24. {obsideo_cli-0.2.4 → obsideo_cli-0.2.5}/tests/test_core.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: obsideo-cli
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Summary: Obsideo Cloud - encrypted storage we can't read. Save, browse, and sync whatever you want, from your terminal.
5
5
  License: MIT
6
6
  Project-URL: Homepage, https://obsideo.io
@@ -200,8 +200,15 @@ def check_for_update() -> None:
200
200
  except (EOFError, KeyboardInterrupt):
201
201
  print(file=sys.stderr)
202
202
  return
203
+ manual = f"pip install -U --no-cache-dir {config.PACKAGE}"
203
204
  if ans not in ("", "y", "yes"):
204
- print(f"Skipped. Update later with: pip install -U {config.PACKAGE}", file=sys.stderr)
205
+ print(f"Skipped. Update later with: {manual}", file=sys.stderr)
206
+ return
207
+ if sys.platform == "win32":
208
+ # Windows file-locks the running obsideo.exe, so pip can't replace it from
209
+ # inside a live session (WinError 32). Hand over the one command to run.
210
+ print(f"\nWindows can't replace the CLI while it's running. To finish, close\n"
211
+ f"obsideo and run:\n {manual}", file=sys.stderr)
205
212
  return
206
213
  print(f"Updating to {latest}...", file=sys.stderr)
207
214
  try:
@@ -209,7 +216,7 @@ def check_for_update() -> None:
209
216
  [sys.executable, "-m", "pip", "install", "-U", "--no-cache-dir", config.PACKAGE]
210
217
  ).returncode
211
218
  except Exception as e:
212
- print(f"Update failed: {e}\nTry manually: pip install -U {config.PACKAGE}", file=sys.stderr)
219
+ print(f"Update failed: {e}\nTry manually: {manual}", file=sys.stderr)
213
220
  return
214
221
  if rc == 0:
215
222
  print(f"\nUpdated to {latest}. Restart `obsideo` to use the new version.", file=sys.stderr)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: obsideo-cli
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Summary: Obsideo Cloud - encrypted storage we can't read. Save, browse, and sync whatever you want, from your terminal.
5
5
  License: MIT
6
6
  Project-URL: Homepage, https://obsideo.io
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "obsideo-cli"
7
- version = "0.2.4"
7
+ version = "0.2.5"
8
8
  description = "Obsideo Cloud - encrypted storage we can't read. Save, browse, and sync whatever you want, from your terminal."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -213,8 +213,9 @@ def test_update_check_prompts_and_respects_no(monkeypatch, capsys):
213
213
  assert ran == [] # declined -> no pip invocation
214
214
 
215
215
 
216
- def test_update_check_runs_pip_on_yes(monkeypatch, capsys):
216
+ def test_update_check_runs_pip_on_yes_posix(monkeypatch, capsys):
217
217
  monkeypatch.setattr(cli.sys.stdout, "isatty", lambda: True, raising=False)
218
+ monkeypatch.setattr(cli.sys, "platform", "linux") # in-process upgrade path
218
219
  monkeypatch.delenv("OBSIDEO_NO_UPDATE_CHECK", raising=False)
219
220
  monkeypatch.setattr(cli.config, "VERSION", "0.2.1")
220
221
  monkeypatch.setattr(cli, "_latest_pypi_version", lambda: "0.2.2")
@@ -228,3 +229,20 @@ def test_update_check_runs_pip_on_yes(monkeypatch, capsys):
228
229
  cli.check_for_update()
229
230
  assert e.value.code == 0
230
231
  assert calls and calls[0][1:] == ["-m", "pip", "install", "-U", "--no-cache-dir", "obsideo-cli"]
232
+
233
+
234
+ def test_update_check_windows_prints_command_not_pip(monkeypatch, capsys):
235
+ # On Windows the running .exe is locked; "yes" must NOT run pip in-process,
236
+ # it prints the command instead (no WinError 32, no doomed self-replace).
237
+ monkeypatch.setattr(cli.sys.stdout, "isatty", lambda: True, raising=False)
238
+ monkeypatch.setattr(cli.sys, "platform", "win32")
239
+ monkeypatch.delenv("OBSIDEO_NO_UPDATE_CHECK", raising=False)
240
+ monkeypatch.setattr(cli.config, "VERSION", "0.2.1")
241
+ monkeypatch.setattr(cli, "_latest_pypi_version", lambda: "0.2.2")
242
+ monkeypatch.setattr("builtins.input", lambda *a: "y")
243
+ ran = []
244
+ monkeypatch.setattr(cli.subprocess, "run", lambda *a, **k: ran.append(a))
245
+ cli.check_for_update() # returns, does not SystemExit
246
+ err = capsys.readouterr().err
247
+ assert ran == [] # never attempts the locked self-replace
248
+ assert "pip install -U --no-cache-dir obsideo-cli" in err
File without changes
File without changes
File without changes