sysetup 1.4.0__tar.gz → 1.4.2__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.0/src/sysetup.egg-info → sysetup-1.4.2}/PKG-INFO +9 -12
  2. {sysetup-1.4.0 → sysetup-1.4.2}/README.md +4 -8
  3. {sysetup-1.4.0 → sysetup-1.4.2}/pyproject.toml +3 -3
  4. {sysetup-1.4.0 → sysetup-1.4.2}/src/sysetup/context/__init__.py +1 -0
  5. {sysetup-1.4.0 → sysetup-1.4.2}/src/sysetup/context/context.py +4 -4
  6. sysetup-1.4.2/src/sysetup/context/secrets_.py +10 -0
  7. {sysetup-1.4.0 → sysetup-1.4.2}/src/sysetup/main/installations.py +16 -1
  8. {sysetup-1.4.0 → sysetup-1.4.2}/src/sysetup/main/main.py +1 -2
  9. {sysetup-1.4.0 → sysetup-1.4.2}/src/sysetup/main/packages.py +9 -5
  10. sysetup-1.4.2/src/sysetup/models/__init__.py +1 -0
  11. {sysetup-1.4.0 → sysetup-1.4.2}/src/sysetup/models/path.py +12 -11
  12. {sysetup-1.4.0 → sysetup-1.4.2}/src/sysetup/utils/bitwarden.py +8 -3
  13. {sysetup-1.4.0 → sysetup-1.4.2/src/sysetup.egg-info}/PKG-INFO +9 -12
  14. {sysetup-1.4.0 → sysetup-1.4.2}/src/sysetup.egg-info/SOURCES.txt +3 -2
  15. {sysetup-1.4.0 → sysetup-1.4.2}/src/sysetup.egg-info/requires.txt +1 -1
  16. sysetup-1.4.0/src/sysetup/models/__init__.py +0 -3
  17. {sysetup-1.4.0 → sysetup-1.4.2}/LICENSE +0 -0
  18. {sysetup-1.4.0 → sysetup-1.4.2}/bin/pw +0 -0
  19. {sysetup-1.4.0 → sysetup-1.4.2}/bin/pw-askpass +0 -0
  20. {sysetup-1.4.0 → sysetup-1.4.2}/setup.cfg +0 -0
  21. {sysetup-1.4.0 → sysetup-1.4.2}/src/sysetup/__init__.py +0 -0
  22. {sysetup-1.4.0 → sysetup-1.4.2}/src/sysetup/cli/__init__.py +0 -0
  23. {sysetup-1.4.0 → sysetup-1.4.2}/src/sysetup/cli/entry_point.py +0 -0
  24. {sysetup-1.4.0/src/sysetup/models → sysetup-1.4.2/src/sysetup/context}/action.py +0 -0
  25. {sysetup-1.4.0 → sysetup-1.4.2}/src/sysetup/context/installations.py +0 -0
  26. {sysetup-1.4.0/src/sysetup/models → sysetup-1.4.2/src/sysetup/context}/options.py +0 -0
  27. {sysetup-1.4.0 → sysetup-1.4.2}/src/sysetup/main/__init__.py +0 -0
  28. {sysetup-1.4.0 → sysetup-1.4.2}/src/sysetup/main/files/__init__.py +0 -0
  29. {sysetup-1.4.0 → sysetup-1.4.2}/src/sysetup/main/files/assets.py +0 -0
  30. {sysetup-1.4.0 → sysetup-1.4.2}/src/sysetup/main/files/permissions.py +0 -0
  31. {sysetup-1.4.0 → sysetup-1.4.2}/src/sysetup/main/files/settings.py +0 -0
  32. {sysetup-1.4.0 → sysetup-1.4.2}/src/sysetup/main/files/setup.py +0 -0
  33. {sysetup-1.4.0 → sysetup-1.4.2}/src/sysetup/py.typed +0 -0
  34. {sysetup-1.4.0 → sysetup-1.4.2}/src/sysetup/utils/__init__.py +0 -0
  35. {sysetup-1.4.0 → sysetup-1.4.2}/src/sysetup/utils/download.py +0 -0
  36. {sysetup-1.4.0 → sysetup-1.4.2}/src/sysetup.egg-info/dependency_links.txt +0 -0
  37. {sysetup-1.4.0 → sysetup-1.4.2}/src/sysetup.egg-info/entry_points.txt +0 -0
  38. {sysetup-1.4.0 → sysetup-1.4.2}/src/sysetup.egg-info/top_level.txt +0 -0
  39. {sysetup-1.4.0 → sysetup-1.4.2}/tests/test_background.py +0 -0
  40. {sysetup-1.4.0 → sysetup-1.4.2}/tests/test_cli_entry_point.py +0 -0
  41. {sysetup-1.4.0 → sysetup-1.4.2}/tests/test_main.py +0 -0
@@ -1,9 +1,9 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: sysetup
3
- Version: 1.4.0
3
+ Version: 1.4.2
4
4
  Summary: Personal system setup
5
5
  Author-email: Quinten Roets <qdr2104@columbia.edu>
6
- License: MIT
6
+ License-Expression: MIT
7
7
  Project-URL: Source Code, https://github.com/quintenroets/sysetup
8
8
  Requires-Python: >=3.10
9
9
  Description-Content-Type: text/markdown
@@ -16,8 +16,9 @@ Requires-Dist: requests<3,>=2.32.3
16
16
  Requires-Dist: superpathlib<3,>=2.0.4
17
17
  Provides-Extra: dev
18
18
  Requires-Dist: types-requests<3,>=2.32.0.20250306; extra == "dev"
19
- Requires-Dist: package-dev-tools<1,>=0.5.11; extra == "dev"
19
+ Requires-Dist: package-dev-tools<1,>=0.7.1; extra == "dev"
20
20
  Requires-Dist: package-dev-utils<1,>=0.1.6; extra == "dev"
21
+ Dynamic: license-file
21
22
 
22
23
  # Sysetup
23
24
  [![PyPI version](https://badge.fury.io/py/sysetup.svg)](https://badge.fury.io/py/sysetup)
@@ -39,14 +40,10 @@ Requires-Dist: package-dev-utils<1,>=0.1.6; extra == "dev"
39
40
  * Set wallpaper
40
41
  * Select We10OSX Cursors
41
42
  3) Configure autocpufreq
42
- 4) Setup Chrome
43
- * Enable GPU acceleration in chrome://flags
44
- * PDF viewer: set page zoom to page fit
45
- * Import certificate from Scripts/assets/sysetup/certificates/certificate.crt
46
- * Click experimental: enable tab groups save and sync
47
- 5) Login to
48
- * Pycharm professional
49
- 6) For new device: set touchpad scroll direction and click on touch
43
+ 4) Login to Pycharm professional
44
+ 5) For new device: configure mousepad
45
+ * natural touchpad scroll direction
46
+ * click on touch
50
47
 
51
48
  ## Installation
52
49
  ```shell
@@ -18,14 +18,10 @@
18
18
  * Set wallpaper
19
19
  * Select We10OSX Cursors
20
20
  3) Configure autocpufreq
21
- 4) Setup Chrome
22
- * Enable GPU acceleration in chrome://flags
23
- * PDF viewer: set page zoom to page fit
24
- * Import certificate from Scripts/assets/sysetup/certificates/certificate.crt
25
- * Click experimental: enable tab groups save and sync
26
- 5) Login to
27
- * Pycharm professional
28
- 6) For new device: set touchpad scroll direction and click on touch
21
+ 4) Login to Pycharm professional
22
+ 5) For new device: configure mousepad
23
+ * natural touchpad scroll direction
24
+ * click on touch
29
25
 
30
26
  ## Installation
31
27
  ```shell
@@ -1,9 +1,9 @@
1
1
  [project]
2
2
  name = "sysetup"
3
- version = "1.4.0"
3
+ version = "1.4.2"
4
4
  description = "Personal system setup"
5
5
  authors = [{name = "Quinten Roets", email = "qdr2104@columbia.edu"}]
6
- license = {text = "MIT"}
6
+ license = "MIT"
7
7
  readme = "README.md"
8
8
  requires-python = ">=3.10"
9
9
  dependencies = [
@@ -18,7 +18,7 @@ dependencies = [
18
18
  [project.optional-dependencies]
19
19
  dev = [
20
20
  "types-requests >=2.32.0.20250306, <3",
21
- "package-dev-tools >=0.5.11, <1",
21
+ "package-dev-tools >=0.7.1, <1",
22
22
  "package-dev-utils >=0.1.6, <1",
23
23
  ]
24
24
 
@@ -1 +1,2 @@
1
+ from .action import Action
1
2
  from .context import Context, context
@@ -3,12 +3,12 @@ from functools import cached_property
3
3
 
4
4
  from package_utils.context import Context as Context_
5
5
 
6
- from sysetup.models import Options
7
-
8
6
  from .installations import is_installed
7
+ from .options import Options
8
+ from .secrets_ import Secrets
9
9
 
10
10
 
11
- class Context(Context_[Options, None, None]):
11
+ class Context(Context_[Options, None, Secrets]):
12
12
  @cached_property
13
13
  def package_manager(self) -> str:
14
14
  options = "apt-get", "pacman"
@@ -23,4 +23,4 @@ class Context(Context_[Options, None, None]):
23
23
  return "DISPLAY" not in os.environ
24
24
 
25
25
 
26
- context = Context(Options)
26
+ context = Context(Options, Secrets=Secrets)
@@ -0,0 +1,10 @@
1
+ import os
2
+ from dataclasses import dataclass, field
3
+
4
+
5
+ @dataclass
6
+ class Secrets:
7
+ bw_clientid: str = field(default_factory=lambda: os.environ.get("BW_CLIENTID", ""))
8
+ bw_clientsecret: str = field(
9
+ default_factory=lambda: os.environ.get("BW_CLIENTSECRET", ""),
10
+ )
@@ -4,6 +4,8 @@ from sysetup.context import context
4
4
  from sysetup.models import Path
5
5
  from sysetup.utils import bitwarden, is_installed
6
6
 
7
+ from .packages import install
8
+
7
9
 
8
10
  def setup() -> None:
9
11
  install_chromium()
@@ -30,7 +32,7 @@ def install_language_support() -> None:
30
32
  pass
31
33
  else:
32
34
  if packages:
33
- cli.install(packages)
35
+ install(packages)
34
36
 
35
37
 
36
38
  def install_chromium() -> None:
@@ -49,6 +51,19 @@ def _install_chromium() -> None:
49
51
  )
50
52
  check = not context.is_running_in_test
51
53
  cli.run_commands(*commands, shell=True, root=True, check=check) # noqa: S604
54
+ install_custom_certificate()
55
+
56
+
57
+ def install_custom_certificate() -> None:
58
+ install(["libnss3-tools"])
59
+ certificate_directory = Path.HOME / ".pki" / "nssdb"
60
+ certificate_file = Path.assets / "certificates" / "certificate.crt"
61
+ command = (
62
+ f"certutil -d sql:{certificate_directory} "
63
+ f'-A -t "C,," -n "QCA" -i {certificate_file}'
64
+ )
65
+ if not context.is_running_in_test:
66
+ cli.run(command)
52
67
 
53
68
 
54
69
  def install_keyd() -> None:
@@ -1,7 +1,6 @@
1
1
  import cli
2
2
 
3
- from sysetup.context import context
4
- from sysetup.models import Action
3
+ from sysetup.context import Action, context
5
4
 
6
5
  from . import files, installations, packages
7
6
 
@@ -24,10 +24,7 @@ def enable_sudo() -> None:
24
24
 
25
25
  def install_packages() -> None:
26
26
  download_directory(Path.packages)
27
- packages_install_command = (
28
- "apt-get install -y" if context.apt_is_installed else "pacman -S --noconfirm"
29
- )
30
- installations = {"packages": packages_install_command, "snap": "snap install"}
27
+ installations = {"packages": None, "snap": "snap install"}
31
28
  for name, command in installations.items():
32
29
  path = (Path.packages / name).with_suffix(".yaml")
33
30
  packages: list[str] = path.yaml
@@ -71,7 +68,14 @@ def update_apt() -> None:
71
68
  cli.run("ln -s /var/lib/snapd/snap /snap", root=True)
72
69
 
73
70
 
74
- def install(packages: Iterable[str], install_command: str) -> None:
71
+ def install(packages: Iterable[str], install_command: str | None = None) -> None:
72
+ if install_command is None:
73
+ install_command = (
74
+ "apt-get install -y"
75
+ if context.apt_is_installed
76
+ else "pacman -S --noconfirm"
77
+ )
78
+
75
79
  is_linux = platform.system() == "Linux"
76
80
  if not is_linux:
77
81
  message = "Required packages can only be installed on Linux"
@@ -0,0 +1 @@
1
+ from .path import Path
@@ -2,6 +2,7 @@ from typing import TypeVar, cast
2
2
 
3
3
  import superpathlib
4
4
  from simple_classproperty import classproperty
5
+ from typing_extensions import Self
5
6
 
6
7
  T = TypeVar("T", bound="Path")
7
8
 
@@ -9,35 +10,35 @@ T = TypeVar("T", bound="Path")
9
10
  class Path(superpathlib.Path):
10
11
  @classmethod
11
12
  @classproperty
12
- def source_root(cls: type[T]) -> T:
13
+ def source_root(cls) -> Self:
13
14
  return cls(__file__).parent.parent
14
15
 
15
16
  @classmethod
16
17
  @classproperty
17
- def assets(cls: type[T]) -> T:
18
+ def assets(cls) -> Self:
18
19
  path = cls.script_assets / cls.source_root.name
19
- return cast(T, path)
20
+ return cast("Self", path)
20
21
 
21
22
  @classmethod
22
23
  @classproperty
23
- def config(cls: type[T]) -> T:
24
+ def config(cls) -> Self:
24
25
  path = cls.assets / "config" / "config.yaml"
25
- return cast(T, path)
26
+ return cast("Self", path)
26
27
 
27
28
  @classmethod
28
29
  @classproperty
29
- def packages(cls: type[T]) -> T:
30
+ def packages(cls) -> Self:
30
31
  path = cls.assets / "packages"
31
- return cast(T, path)
32
+ return cast("Self", path)
32
33
 
33
34
  @classmethod
34
35
  @classproperty
35
- def extensions(cls: type[T]) -> T:
36
+ def extensions(cls) -> Self:
36
37
  path = cls.HOME / ".local" / "share" / "extensions"
37
- return cast(T, path)
38
+ return cast("Self", path)
38
39
 
39
40
  @classmethod
40
41
  @classproperty
41
- def update_wallpaper_script(cls: type[T]) -> T:
42
+ def update_wallpaper_script(cls) -> Self:
42
43
  path = cls.source_root / "assets" / "scripts" / "update_wallpaper.js"
43
- return cast(T, path)
44
+ return cast("Self", path)
@@ -23,14 +23,19 @@ class Client:
23
23
  command = "./bw list items --session", self.session_token, "--search", name
24
24
  response = cli.capture_output(*command)
25
25
  secret = json.loads(response)[0]["notes"]
26
- return cast(str, secret)
26
+ return cast("str", secret)
27
27
 
28
28
  @cached_property
29
29
  def session_token(self) -> str:
30
30
  if not Path("bw").exists():
31
31
  self.download_cli()
32
- output = cli.capture_output(f"./bw login {self.email} {self.password}")
33
- return output.split("--session ")[-1]
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
38
+ return cli.capture_output(*command)
34
39
 
35
40
  def download_cli(self) -> None:
36
41
  response = requests.get(self.download_url, timeout=10).content
@@ -1,9 +1,9 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: sysetup
3
- Version: 1.4.0
3
+ Version: 1.4.2
4
4
  Summary: Personal system setup
5
5
  Author-email: Quinten Roets <qdr2104@columbia.edu>
6
- License: MIT
6
+ License-Expression: MIT
7
7
  Project-URL: Source Code, https://github.com/quintenroets/sysetup
8
8
  Requires-Python: >=3.10
9
9
  Description-Content-Type: text/markdown
@@ -16,8 +16,9 @@ Requires-Dist: requests<3,>=2.32.3
16
16
  Requires-Dist: superpathlib<3,>=2.0.4
17
17
  Provides-Extra: dev
18
18
  Requires-Dist: types-requests<3,>=2.32.0.20250306; extra == "dev"
19
- Requires-Dist: package-dev-tools<1,>=0.5.11; extra == "dev"
19
+ Requires-Dist: package-dev-tools<1,>=0.7.1; extra == "dev"
20
20
  Requires-Dist: package-dev-utils<1,>=0.1.6; extra == "dev"
21
+ Dynamic: license-file
21
22
 
22
23
  # Sysetup
23
24
  [![PyPI version](https://badge.fury.io/py/sysetup.svg)](https://badge.fury.io/py/sysetup)
@@ -39,14 +40,10 @@ Requires-Dist: package-dev-utils<1,>=0.1.6; extra == "dev"
39
40
  * Set wallpaper
40
41
  * Select We10OSX Cursors
41
42
  3) Configure autocpufreq
42
- 4) Setup Chrome
43
- * Enable GPU acceleration in chrome://flags
44
- * PDF viewer: set page zoom to page fit
45
- * Import certificate from Scripts/assets/sysetup/certificates/certificate.crt
46
- * Click experimental: enable tab groups save and sync
47
- 5) Login to
48
- * Pycharm professional
49
- 6) For new device: set touchpad scroll direction and click on touch
43
+ 4) Login to Pycharm professional
44
+ 5) For new device: configure mousepad
45
+ * natural touchpad scroll direction
46
+ * click on touch
50
47
 
51
48
  ## Installation
52
49
  ```shell
@@ -14,8 +14,11 @@ src/sysetup.egg-info/top_level.txt
14
14
  src/sysetup/cli/__init__.py
15
15
  src/sysetup/cli/entry_point.py
16
16
  src/sysetup/context/__init__.py
17
+ src/sysetup/context/action.py
17
18
  src/sysetup/context/context.py
18
19
  src/sysetup/context/installations.py
20
+ src/sysetup/context/options.py
21
+ src/sysetup/context/secrets_.py
19
22
  src/sysetup/main/__init__.py
20
23
  src/sysetup/main/installations.py
21
24
  src/sysetup/main/main.py
@@ -26,8 +29,6 @@ src/sysetup/main/files/permissions.py
26
29
  src/sysetup/main/files/settings.py
27
30
  src/sysetup/main/files/setup.py
28
31
  src/sysetup/models/__init__.py
29
- src/sysetup/models/action.py
30
- src/sysetup/models/options.py
31
32
  src/sysetup/models/path.py
32
33
  src/sysetup/utils/__init__.py
33
34
  src/sysetup/utils/bitwarden.py
@@ -7,5 +7,5 @@ superpathlib<3,>=2.0.4
7
7
 
8
8
  [dev]
9
9
  types-requests<3,>=2.32.0.20250306
10
- package-dev-tools<1,>=0.5.11
10
+ package-dev-tools<1,>=0.7.1
11
11
  package-dev-utils<1,>=0.1.6
@@ -1,3 +0,0 @@
1
- from .action import Action
2
- from .options import Options
3
- from .path import Path
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes