sysetup 1.4.2__tar.gz → 1.4.3__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 (41) hide show
  1. {sysetup-1.4.2/src/sysetup.egg-info → sysetup-1.4.3}/PKG-INFO +3 -2
  2. sysetup-1.4.3/bin/pw +10 -0
  3. {sysetup-1.4.2 → sysetup-1.4.3}/pyproject.toml +3 -2
  4. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup/main/files/assets.py +5 -5
  5. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup/main/installations.py +6 -2
  6. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup/utils/bitwarden.py +8 -6
  7. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup/utils/download.py +13 -5
  8. {sysetup-1.4.2 → sysetup-1.4.3/src/sysetup.egg-info}/PKG-INFO +3 -2
  9. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup.egg-info/requires.txt +2 -1
  10. {sysetup-1.4.2 → sysetup-1.4.3}/tests/test_background.py +2 -6
  11. sysetup-1.4.2/bin/pw +0 -4
  12. {sysetup-1.4.2 → sysetup-1.4.3}/LICENSE +0 -0
  13. {sysetup-1.4.2 → sysetup-1.4.3}/README.md +0 -0
  14. {sysetup-1.4.2 → sysetup-1.4.3}/bin/pw-askpass +0 -0
  15. {sysetup-1.4.2 → sysetup-1.4.3}/setup.cfg +0 -0
  16. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup/__init__.py +0 -0
  17. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup/cli/__init__.py +0 -0
  18. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup/cli/entry_point.py +0 -0
  19. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup/context/__init__.py +0 -0
  20. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup/context/action.py +0 -0
  21. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup/context/context.py +0 -0
  22. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup/context/installations.py +0 -0
  23. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup/context/options.py +0 -0
  24. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup/context/secrets_.py +0 -0
  25. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup/main/__init__.py +0 -0
  26. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup/main/files/__init__.py +0 -0
  27. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup/main/files/permissions.py +0 -0
  28. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup/main/files/settings.py +0 -0
  29. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup/main/files/setup.py +0 -0
  30. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup/main/main.py +0 -0
  31. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup/main/packages.py +0 -0
  32. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup/models/__init__.py +0 -0
  33. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup/models/path.py +0 -0
  34. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup/py.typed +0 -0
  35. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup/utils/__init__.py +0 -0
  36. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup.egg-info/SOURCES.txt +0 -0
  37. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup.egg-info/dependency_links.txt +0 -0
  38. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup.egg-info/entry_points.txt +0 -0
  39. {sysetup-1.4.2 → sysetup-1.4.3}/src/sysetup.egg-info/top_level.txt +0 -0
  40. {sysetup-1.4.2 → sysetup-1.4.3}/tests/test_cli_entry_point.py +0 -0
  41. {sysetup-1.4.2 → sysetup-1.4.3}/tests/test_main.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sysetup
3
- Version: 1.4.2
3
+ Version: 1.4.3
4
4
  Summary: Personal system setup
5
5
  Author-email: Quinten Roets <qdr2104@columbia.edu>
6
6
  License-Expression: MIT
@@ -8,13 +8,14 @@ Project-URL: Source Code, https://github.com/quintenroets/sysetup
8
8
  Requires-Python: >=3.10
9
9
  Description-Content-Type: text/markdown
10
10
  License-File: LICENSE
11
- Requires-Dist: backupmaster<2,>=1.2.21
11
+ Requires-Dist: backupmaster<3,>=2.0.2
12
12
  Requires-Dist: dbus-next<1,>=0.2.3
13
13
  Requires-Dist: package-utils[context]<1,>=0.6.1
14
14
  Requires-Dist: powercli<1,>=0.3.1
15
15
  Requires-Dist: requests<3,>=2.32.3
16
16
  Requires-Dist: superpathlib<3,>=2.0.4
17
17
  Provides-Extra: dev
18
+ Requires-Dist: dirhash<1,>=0.5.0; extra == "dev"
18
19
  Requires-Dist: types-requests<3,>=2.32.0.20250306; extra == "dev"
19
20
  Requires-Dist: package-dev-tools<1,>=0.7.1; extra == "dev"
20
21
  Requires-Dist: package-dev-utils<1,>=0.1.6; extra == "dev"
sysetup-1.4.3/bin/pw ADDED
@@ -0,0 +1,10 @@
1
+ #! /bin/bash
2
+
3
+ password_name=${1:-Login}
4
+
5
+ if command -v ksshaskpass >/dev/null 2>&1; then
6
+ ksshaskpass -- "Enter passphrase for $password_name: "
7
+ else
8
+ security find-generic-password -s "$password_name" -a "autopass" -w
9
+ # to add: security add-generic-password -s "$password_name" -a "autopass" -U -w
10
+ fi
@@ -1,13 +1,13 @@
1
1
  [project]
2
2
  name = "sysetup"
3
- version = "1.4.2"
3
+ version = "1.4.3"
4
4
  description = "Personal system setup"
5
5
  authors = [{name = "Quinten Roets", email = "qdr2104@columbia.edu"}]
6
6
  license = "MIT"
7
7
  readme = "README.md"
8
8
  requires-python = ">=3.10"
9
9
  dependencies = [
10
- "backupmaster >=1.2.21, <2",
10
+ "backupmaster >=2.0.2, <3",
11
11
  "dbus-next >=0.2.3, <1",
12
12
  "package-utils[context] >=0.6.1, <1",
13
13
  "powercli >=0.3.1, <1",
@@ -17,6 +17,7 @@ dependencies = [
17
17
 
18
18
  [project.optional-dependencies]
19
19
  dev = [
20
+ "dirhash >=0.5.0, <1",
20
21
  "types-requests >=2.32.0.20250306, <3",
21
22
  "package-dev-tools >=0.7.1, <1",
22
23
  "package-dev-utils >=0.1.6, <1",
@@ -1,5 +1,6 @@
1
1
  import cli
2
- from backup.backups.cache import cache
2
+ from backup.syncer import Syncer
3
+ from backup.syncer.sync_configs import SyncConfigs
3
4
 
4
5
  from sysetup.models import Path
5
6
  from sysetup.utils import download_directory
@@ -33,12 +34,11 @@ def move_setup_files() -> None:
33
34
  else:
34
35
  archived_setup_files.append(path)
35
36
 
37
+ config = SyncConfigs.cache.with_paths(setup_files)
36
38
  if setup_files:
37
- cache.Backup(paths=setup_files).pull()
38
-
39
- source = cache.Backup().source
39
+ Syncer(config).capture_pull()
40
40
  for path in archived_setup_files:
41
- dest = (source / path.relative_to(setup_files_root)).parent
41
+ dest = (config.source / path.relative_to(setup_files_root)).parent
42
42
  if dest.is_root and not dest.exists():
43
43
  cli.run("mkdir -p", dest, root=True)
44
44
  else:
@@ -43,9 +43,13 @@ def install_chromium() -> None:
43
43
  def _install_chromium() -> None:
44
44
  release_name = cli.capture_output_lines("lsb_release -sc")[-1]
45
45
  repo_url = f"https://freeshell.de/phd/chromium/{release_name}"
46
+ key = "869689FE09306074"
47
+ keyring = "/usr/share/keyrings/phd-chromium.gpg"
48
+ sources_file = "/etc/apt/sources.list.d/phd-chromium.list"
46
49
  commands = (
47
- f'echo "deb {repo_url} /" | sudo tee /etc/apt/sources.list.d/phd-chromium.list',
48
- "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 869689FE09306074",
50
+ f"gpg --keyserver keyserver.ubuntu.com --recv-keys {key}",
51
+ f"gpg --export {key} | sudo gpg --dearmor -o {keyring}",
52
+ f'echo "deb [signed-by={keyring}] {repo_url} /" | sudo tee {sources_file}',
49
53
  "apt-get update",
50
54
  "apt-get install -y chromium",
51
55
  )
@@ -29,12 +29,14 @@ class Client:
29
29
  def session_token(self) -> str:
30
30
  if not Path("bw").exists():
31
31
  self.download_cli()
32
- command: tuple[str, ...]
33
- if context.secrets.bw_clientid:
34
- cli.run("./bw login --apikey")
35
- command = "./bw unlock --raw", self.password
36
- else:
37
- command = "./bw login --raw", self.email, self.password
32
+
33
+ logged_in = "userEmail" in cli.capture_output("./bw status")
34
+ command: tuple[str, ...] = "./bw unlock --raw", self.password
35
+ if not logged_in:
36
+ if context.secrets.bw_clientid:
37
+ cli.run("./bw login --apikey")
38
+ else:
39
+ command = "./bw login --raw", self.email, self.password
38
40
  return cli.capture_output(*command)
39
41
 
40
42
  def download_cli(self) -> None:
@@ -1,9 +1,9 @@
1
1
  import os
2
2
 
3
3
  import cli
4
- from backup.backups import Backup
5
4
  from backup.context import context as backup_context
6
- from backup.models import Path as BackupPath
5
+ from backup.syncer import Syncer
6
+ from backup.syncer.sync_configs import select_sync_config
7
7
 
8
8
  from sysetup.models import Path
9
9
 
@@ -11,13 +11,21 @@ from .bitwarden import bitwarden
11
11
 
12
12
 
13
13
  def download_directory(path: Path) -> None:
14
- check_authenticated()
15
- Backup(sub_check_path=BackupPath(path), confirm=False).pull()
14
+ download_item(directory=path)
16
15
 
17
16
 
18
17
  def download_file(path: Path) -> None:
18
+ download_item(path)
19
+
20
+
21
+ def download_item(path: Path | None = None, directory: Path | None = None) -> None:
19
22
  check_authenticated()
20
- Backup(path=BackupPath(path), confirm=False).pull()
23
+ location = path or directory
24
+ assert location is not None
25
+ config = select_sync_config(location)
26
+ config.path = path
27
+ config.directory = directory
28
+ Syncer(config).capture_pull()
21
29
 
22
30
 
23
31
  def check_authenticated() -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sysetup
3
- Version: 1.4.2
3
+ Version: 1.4.3
4
4
  Summary: Personal system setup
5
5
  Author-email: Quinten Roets <qdr2104@columbia.edu>
6
6
  License-Expression: MIT
@@ -8,13 +8,14 @@ Project-URL: Source Code, https://github.com/quintenroets/sysetup
8
8
  Requires-Python: >=3.10
9
9
  Description-Content-Type: text/markdown
10
10
  License-File: LICENSE
11
- Requires-Dist: backupmaster<2,>=1.2.21
11
+ Requires-Dist: backupmaster<3,>=2.0.2
12
12
  Requires-Dist: dbus-next<1,>=0.2.3
13
13
  Requires-Dist: package-utils[context]<1,>=0.6.1
14
14
  Requires-Dist: powercli<1,>=0.3.1
15
15
  Requires-Dist: requests<3,>=2.32.3
16
16
  Requires-Dist: superpathlib<3,>=2.0.4
17
17
  Provides-Extra: dev
18
+ Requires-Dist: dirhash<1,>=0.5.0; extra == "dev"
18
19
  Requires-Dist: types-requests<3,>=2.32.0.20250306; extra == "dev"
19
20
  Requires-Dist: package-dev-tools<1,>=0.7.1; extra == "dev"
20
21
  Requires-Dist: package-dev-utils<1,>=0.1.6; extra == "dev"
@@ -1,4 +1,4 @@
1
- backupmaster<2,>=1.2.21
1
+ backupmaster<3,>=2.0.2
2
2
  dbus-next<1,>=0.2.3
3
3
  package-utils[context]<1,>=0.6.1
4
4
  powercli<1,>=0.3.1
@@ -6,6 +6,7 @@ requests<3,>=2.32.3
6
6
  superpathlib<3,>=2.0.4
7
7
 
8
8
  [dev]
9
+ dirhash<1,>=0.5.0
9
10
  types-requests<3,>=2.32.0.20250306
10
11
  package-dev-tools<1,>=0.7.1
11
12
  package-dev-utils<1,>=0.1.6
@@ -1,7 +1,6 @@
1
1
  import os
2
2
  from collections.abc import Callable, Iterator
3
3
 
4
- import cli
5
4
  import pytest
6
5
  from backup.utils import setup
7
6
 
@@ -31,12 +30,9 @@ def restore_and_check(
31
30
  setup.check_setup()
32
31
 
33
32
  def _restore_and_check(restored_path: Path) -> Iterator[None]:
34
- def extract_content_hash() -> str:
35
- return cli.capture_output("rclone hashsum MD5", restored_path, check=False)
36
-
37
- content_hash = extract_content_hash()
33
+ content_hash = restored_path.content_hash
38
34
  yield from restore(restored_path)
39
- assert extract_content_hash() == content_hash
35
+ assert restored_path.content_hash == content_hash
40
36
 
41
37
  return _restore_and_check
42
38
 
sysetup-1.4.2/bin/pw DELETED
@@ -1,4 +0,0 @@
1
- #! /bin/bash
2
-
3
- password_name=${1:-Login}
4
- ksshaskpass -- "Enter passphrase for $password_name: "
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes