sysetup 1.2.1__tar.gz → 1.3.dev0__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 (39) hide show
  1. {sysetup-1.2.1/src/sysetup.egg-info → sysetup-1.3.dev0}/PKG-INFO +3 -2
  2. {sysetup-1.2.1 → sysetup-1.3.dev0}/README.md +1 -0
  3. {sysetup-1.2.1 → sysetup-1.3.dev0}/pyproject.toml +2 -5
  4. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup/main/environment.py +2 -3
  5. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup/main/files/assets.py +7 -2
  6. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup/main/files/settings.py +1 -1
  7. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup/main/installations.py +27 -8
  8. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup/main/packages.py +18 -12
  9. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup/models/path.py +7 -1
  10. {sysetup-1.2.1 → sysetup-1.3.dev0/src/sysetup.egg-info}/PKG-INFO +3 -2
  11. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup.egg-info/requires.txt +1 -1
  12. {sysetup-1.2.1 → sysetup-1.3.dev0}/tests/test_background.py +4 -3
  13. {sysetup-1.2.1 → sysetup-1.3.dev0}/tests/test_cli_entry_point.py +1 -0
  14. {sysetup-1.2.1 → sysetup-1.3.dev0}/tests/test_installer.py +1 -0
  15. {sysetup-1.2.1 → sysetup-1.3.dev0}/tests/test_main.py +1 -0
  16. {sysetup-1.2.1 → sysetup-1.3.dev0}/LICENSE +0 -0
  17. {sysetup-1.2.1 → sysetup-1.3.dev0}/bin/pw +0 -0
  18. {sysetup-1.2.1 → sysetup-1.3.dev0}/bin/pw-askpass +0 -0
  19. {sysetup-1.2.1 → sysetup-1.3.dev0}/setup.cfg +0 -0
  20. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup/__init__.py +0 -0
  21. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup/cli/__init__.py +0 -0
  22. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup/cli/entry_point.py +0 -0
  23. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup/context/__init__.py +0 -0
  24. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup/context/context.py +0 -0
  25. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup/main/__init__.py +0 -0
  26. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup/main/files/__init__.py +0 -0
  27. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup/main/files/permissions.py +0 -0
  28. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup/main/files/setup.py +0 -0
  29. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup/main/main.py +0 -0
  30. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup/models/__init__.py +0 -0
  31. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup/models/action.py +0 -0
  32. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup/models/options.py +0 -0
  33. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup/py.typed +0 -0
  34. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup/utils/__init__.py +0 -0
  35. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup/utils/download.py +0 -0
  36. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup.egg-info/SOURCES.txt +0 -0
  37. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup.egg-info/dependency_links.txt +0 -0
  38. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup.egg-info/entry_points.txt +0 -0
  39. {sysetup-1.2.1 → sysetup-1.3.dev0}/src/sysetup.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sysetup
3
- Version: 1.2.1
3
+ Version: 1.3.dev0
4
4
  Summary: Personal system setup
5
5
  Author-email: Quinten Roets <qdr2104@columbia.edu>
6
6
  License: MIT
@@ -8,7 +8,7 @@ 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.6
11
+ Requires-Dist: backupmaster<2,>=1.2.21
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
@@ -21,6 +21,7 @@ Requires-Dist: package-dev-utils<1,>=0.1.6; extra == "dev"
21
21
 
22
22
  # Sysetup
23
23
  [![PyPI version](https://badge.fury.io/py/sysetup.svg)](https://badge.fury.io/py/sysetup)
24
+ ![PyPI downloads](https://img.shields.io/pypi/dm/sysetup)
24
25
  ![Python version](https://img.shields.io/badge/python-3.10+-brightgreen)
25
26
  ![Operating system](https://img.shields.io/badge/os-linux-brightgreen)
26
27
  ![Coverage](https://img.shields.io/badge/coverage-66%25-brightgreen)
@@ -1,5 +1,6 @@
1
1
  # Sysetup
2
2
  [![PyPI version](https://badge.fury.io/py/sysetup.svg)](https://badge.fury.io/py/sysetup)
3
+ ![PyPI downloads](https://img.shields.io/pypi/dm/sysetup)
3
4
  ![Python version](https://img.shields.io/badge/python-3.10+-brightgreen)
4
5
  ![Operating system](https://img.shields.io/badge/os-linux-brightgreen)
5
6
  ![Coverage](https://img.shields.io/badge/coverage-66%25-brightgreen)
@@ -1,13 +1,13 @@
1
1
  [project]
2
2
  name = "sysetup"
3
- version = "1.2.1"
3
+ version = "1.3.dev0"
4
4
  description = "Personal system setup"
5
5
  authors = [{name = "Quinten Roets", email = "qdr2104@columbia.edu"}]
6
6
  license = {text = "MIT"}
7
7
  readme = "README.md"
8
8
  requires-python = ">=3.10"
9
9
  dependencies = [
10
- "backupmaster >=1.2.6, <2",
10
+ "backupmaster >=1.2.21, <2",
11
11
  "dbus-next >=0.2.3, <1",
12
12
  "package-utils[context] >=0.6.1, <1",
13
13
  "powercli >=0.3.1, <1",
@@ -62,9 +62,6 @@ ignore = [
62
62
  "S101", # assert used
63
63
  ]
64
64
 
65
- [tool.ruff.lint.isort]
66
- known-first-party = ["src"]
67
-
68
65
  [tool.ruff.lint.per-file-ignores]
69
66
  "__init__.py" = ["F401"]
70
67
 
@@ -9,6 +9,5 @@ from sysetup.utils import download_file
9
9
  def setup() -> None:
10
10
  download_file(Path("etc") / "environment")
11
11
  if "SUDO_ASKPASS" not in os.environ:
12
- path = Path.HOME / ".bask_profile"
13
- download_file(Path.HOME / ".bask_profile")
14
- load_dotenv(dotenv_path=Path.HOME / path)
12
+ download_file(Path.profile)
13
+ load_dotenv(dotenv_path=Path.profile)
@@ -6,10 +6,15 @@ from sysetup.utils import download_directory
6
6
 
7
7
 
8
8
  def setup() -> None:
9
- download_directory(Path.assets)
9
+ directories = (
10
+ Path.assets,
11
+ Path.HOME / ".local" / "share" / "kwalletd",
12
+ Path.assets.parent / "backup",
13
+ )
14
+ for directory in directories:
15
+ download_directory(directory)
10
16
  move_crontab()
11
17
  move_setup_files()
12
- download_directory(Path.assets.parent / "backup")
13
18
 
14
19
 
15
20
  def move_crontab() -> None:
@@ -41,5 +41,5 @@ def run_kde_script(script: str) -> None: # pragma: nocover
41
41
  command = (
42
42
  "qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript"
43
43
  )
44
- if not context.is_running_in_test:
44
+ if not context.is_running_in_test and cli.completes_successfully("which qdbus"):
45
45
  cli.run(command, script)
@@ -4,11 +4,15 @@ import cli
4
4
 
5
5
  from sysetup.context import context
6
6
  from sysetup.models import Path
7
+ from sysetup.utils import download_file
7
8
 
8
9
 
9
10
  def setup() -> None:
10
11
  install_chromium()
11
- install_jumpapp()
12
+ install_keyd()
13
+ download_file(Path("/") / "etc" / "systemd" / "system" / "ydotoold.service")
14
+ enable_service("ydotoold")
15
+ enable_service("ssh")
12
16
  install_language_support()
13
17
  install_linter_env()
14
18
  install_personal_git_repositories()
@@ -19,10 +23,10 @@ def install_personal_git_repositories() -> None:
19
23
  token = os.getenv("GITHUB", None)
20
24
  if token is not None:
21
25
  base_url = base_url.replace("github.com", f"{token}@github.com")
22
- if not Path.extensions.exists():
23
- command = f"git clone {base_url}/extensions.git"
24
- cli.run(command, Path.extensions)
25
- cli.run(f"pip install git+{base_url}/system.git")
26
+ if not Path.extensions.exists():
27
+ command = f"git clone {base_url}/extensions.git"
28
+ cli.run(command, Path.extensions)
29
+ cli.run(f"pip install git+{base_url}/system.git")
26
30
 
27
31
 
28
32
  def install_language_support() -> None:
@@ -60,8 +64,23 @@ def install_linter_env() -> None:
60
64
  cli.run(f"{python_path} -m pip install autoimport powertrace-hooks")
61
65
 
62
66
 
63
- def install_jumpapp() -> None:
64
- if not cli.capture_output("which jumpapp", check=False):
67
+ def install_keyd() -> None:
68
+ install_repository("keyd", "quintenroets/keyd", branch="support-scroll-mapping")
69
+ enable_service("keyd")
70
+
71
+
72
+ def enable_service(name: str) -> None:
73
+ if not context.is_running_in_test:
74
+ command = f"systemctl enable --now {name}"
75
+ cli.run(command, root=True)
76
+
77
+
78
+ def install_repository(name: str, repository: str, branch: str | None = None) -> None:
79
+ if not cli.capture_output("which", name, check=False):
80
+ url = f"https://github.com/{repository}"
81
+ command: tuple[str, ...] = "git clone", url
82
+ if branch is not None:
83
+ command = (*command, "-b", branch)
65
84
  with Path.tempdir() as directory:
66
- cli.run("git clone https://github.com/mkropat/jumpapp", directory)
85
+ cli.run(*command, directory)
67
86
  cli.run_commands("make", "sudo make install", cwd=directory)
@@ -19,6 +19,13 @@ def install_packages() -> None:
19
19
  packages: list[str] = path.yaml
20
20
  cli.install(*packages, install_command=command)
21
21
 
22
+ if not context.apt_is_installed:
23
+ commands = (
24
+ "sudo pacman -S --noconfirm python-pip base-devel",
25
+ "pip install wheel",
26
+ )
27
+ cli.run_commands(*commands)
28
+
22
29
 
23
30
  def update_package_manager() -> None:
24
31
  if context.apt_is_installed:
@@ -28,10 +35,10 @@ def update_package_manager() -> None:
28
35
 
29
36
 
30
37
  def update_apt() -> None:
31
- agree_eula_command = (
32
- "echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula"
33
- "select true | sudo debconf-set-selections"
38
+ value = (
39
+ "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true"
34
40
  )
41
+ agree_eula_command = f'echo "{value}" | sudo debconf-set-selections'
35
42
  commands = ["sudo apt-get update", agree_eula_command]
36
43
  cli.run_commands_in_shell(*commands)
37
44
  if not Path("/snap").exists():
@@ -39,16 +46,15 @@ def update_apt() -> None:
39
46
 
40
47
 
41
48
  def cleanup_after_install() -> None:
42
- after_install_command = (
43
- "sudo apt-get autoremove -y"
44
- if context.apt_is_installed
45
- else (
46
- "sudo pacman -S --noconfirm python-pip; sudo pacman -S --noconfirm"
47
- " base-devel; pip install wheel"
49
+ if context.apt_is_installed:
50
+ cli.run("sudo apt-get autoremove -y")
51
+ cli.run("tlp start", root=True)
52
+ if cli.completes_successfully("which qdbus"):
53
+ commands = (
54
+ "rm /usr/bin/qdbus",
55
+ "ln -s /usr/lib/qt6/bin/qdbus /usr/bin/qdbus",
48
56
  )
49
- )
50
- cli.run_commands_in_shell(after_install_command, "sudo tlp start")
51
- cli.run("systemctl enable ssh", root=True) # start ssh server before log in
57
+ cli.run_commands(*commands, root=True)
52
58
  delete = "apt purge -y" if context.apt_is_installed else "pacman -R --noconfirm"
53
59
  commands = (
54
60
  "auto-cpufreq --install", # Fails on VM
@@ -33,7 +33,7 @@ class Path(superpathlib.Path):
33
33
  @classmethod
34
34
  @classproperty
35
35
  def linter_env(cls: type[T]) -> T:
36
- path = Path.HOME / ".local" / "share" / "envs" / "linterenv"
36
+ path = cls.HOME / ".local" / "share" / "envs" / "linterenv"
37
37
  return cast(T, path)
38
38
 
39
39
  @classmethod
@@ -47,3 +47,9 @@ class Path(superpathlib.Path):
47
47
  def update_wallpaper_script(cls: type[T]) -> T:
48
48
  path = cls.source_root / "assets" / "scripts" / "update_wallpaper.js"
49
49
  return cast(T, path)
50
+
51
+ @classmethod
52
+ @classproperty
53
+ def profile(cls: type[T]) -> T:
54
+ path = cls.HOME / ".bash_profile"
55
+ return cast(T, path)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sysetup
3
- Version: 1.2.1
3
+ Version: 1.3.dev0
4
4
  Summary: Personal system setup
5
5
  Author-email: Quinten Roets <qdr2104@columbia.edu>
6
6
  License: MIT
@@ -8,7 +8,7 @@ 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.6
11
+ Requires-Dist: backupmaster<2,>=1.2.21
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
@@ -21,6 +21,7 @@ Requires-Dist: package-dev-utils<1,>=0.1.6; extra == "dev"
21
21
 
22
22
  # Sysetup
23
23
  [![PyPI version](https://badge.fury.io/py/sysetup.svg)](https://badge.fury.io/py/sysetup)
24
+ ![PyPI downloads](https://img.shields.io/pypi/dm/sysetup)
24
25
  ![Python version](https://img.shields.io/badge/python-3.10+-brightgreen)
25
26
  ![Operating system](https://img.shields.io/badge/os-linux-brightgreen)
26
27
  ![Coverage](https://img.shields.io/badge/coverage-66%25-brightgreen)
@@ -1,4 +1,4 @@
1
- backupmaster<2,>=1.2.6
1
+ backupmaster<2,>=1.2.21
2
2
  dbus-next<1,>=0.2.3
3
3
  package-utils[context]<1,>=0.6.1
4
4
  powercli<1,>=0.3.1
@@ -5,13 +5,14 @@ import cli
5
5
  import pytest
6
6
  from backup.context import context
7
7
  from backup.utils import setup
8
+
8
9
  from sysetup.main.files.settings import set_background
9
10
  from sysetup.models import Path
10
11
 
11
12
  plasma_config_path = Path.HOME / ".config" / "plasma-org.kde.plasma.desktop-appletsrc"
12
13
 
13
14
 
14
- @pytest.fixture()
15
+ @pytest.fixture
15
16
  def restore(path: Path) -> Callable[[Path], Iterator[None]]:
16
17
  def _restore(restored_path: Path) -> Iterator[None]:
17
18
  exists = restored_path.exists()
@@ -24,7 +25,7 @@ def restore(path: Path) -> Callable[[Path], Iterator[None]]:
24
25
  return _restore
25
26
 
26
27
 
27
- @pytest.fixture()
28
+ @pytest.fixture
28
29
  def restore_and_check(
29
30
  restore: Callable[[Path], Iterator[None]],
30
31
  ) -> Callable[[Path], Iterator[None]]:
@@ -48,7 +49,7 @@ def restore_and_check(
48
49
  return _restore_and_check
49
50
 
50
51
 
51
- @pytest.fixture()
52
+ @pytest.fixture
52
53
  def restore_config_path(
53
54
  restore_and_check: Callable[[Path], Iterator[None]],
54
55
  ) -> Iterator[None]:
@@ -1,6 +1,7 @@
1
1
  from unittest.mock import MagicMock, patch
2
2
 
3
3
  from package_dev_utils.tests.args import no_cli_args
4
+
4
5
  from sysetup import cli
5
6
 
6
7
 
@@ -1,6 +1,7 @@
1
1
  from unittest.mock import PropertyMock, patch
2
2
 
3
3
  import cli
4
+
4
5
  from sysetup.main.installations import install_linter_env
5
6
  from sysetup.models import Path
6
7
 
@@ -1,6 +1,7 @@
1
1
  from unittest.mock import MagicMock, patch
2
2
 
3
3
  from package_dev_utils.tests.args import no_cli_args
4
+
4
5
  from sysetup.main.main import main
5
6
 
6
7
 
File without changes
File without changes
File without changes
File without changes
File without changes