sysetup 1.3.5__tar.gz → 1.3.7__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 (40) hide show
  1. {sysetup-1.3.5/src/sysetup.egg-info → sysetup-1.3.7}/PKG-INFO +4 -5
  2. {sysetup-1.3.5 → sysetup-1.3.7}/README.md +2 -3
  3. {sysetup-1.3.5 → sysetup-1.3.7}/pyproject.toml +4 -5
  4. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup/context/context.py +3 -9
  5. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup/main/files/assets.py +4 -3
  6. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup/main/installations.py +18 -19
  7. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup/main/packages.py +5 -11
  8. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup/models/path.py +0 -6
  9. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup/utils/__init__.py +1 -0
  10. sysetup-1.3.7/src/sysetup/utils/installations.py +5 -0
  11. {sysetup-1.3.5 → sysetup-1.3.7/src/sysetup.egg-info}/PKG-INFO +4 -5
  12. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup.egg-info/SOURCES.txt +1 -1
  13. sysetup-1.3.5/tests/test_installer.py +0 -15
  14. {sysetup-1.3.5 → sysetup-1.3.7}/LICENSE +0 -0
  15. {sysetup-1.3.5 → sysetup-1.3.7}/bin/pw +0 -0
  16. {sysetup-1.3.5 → sysetup-1.3.7}/bin/pw-askpass +0 -0
  17. {sysetup-1.3.5 → sysetup-1.3.7}/setup.cfg +0 -0
  18. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup/__init__.py +0 -0
  19. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup/cli/__init__.py +0 -0
  20. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup/cli/entry_point.py +0 -0
  21. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup/context/__init__.py +0 -0
  22. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup/main/__init__.py +0 -0
  23. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup/main/environment.py +0 -0
  24. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup/main/files/__init__.py +0 -0
  25. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup/main/files/permissions.py +0 -0
  26. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup/main/files/settings.py +0 -0
  27. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup/main/files/setup.py +0 -0
  28. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup/main/main.py +0 -0
  29. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup/models/__init__.py +0 -0
  30. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup/models/action.py +0 -0
  31. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup/models/options.py +0 -0
  32. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup/py.typed +0 -0
  33. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup/utils/download.py +0 -0
  34. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup.egg-info/dependency_links.txt +0 -0
  35. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup.egg-info/entry_points.txt +0 -0
  36. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup.egg-info/requires.txt +0 -0
  37. {sysetup-1.3.5 → sysetup-1.3.7}/src/sysetup.egg-info/top_level.txt +0 -0
  38. {sysetup-1.3.5 → sysetup-1.3.7}/tests/test_background.py +0 -0
  39. {sysetup-1.3.5 → sysetup-1.3.7}/tests/test_cli_entry_point.py +0 -0
  40. {sysetup-1.3.5 → sysetup-1.3.7}/tests/test_main.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: sysetup
3
- Version: 1.3.5
3
+ Version: 1.3.7
4
4
  Summary: Personal system setup
5
5
  Author-email: Quinten Roets <qdr2104@columbia.edu>
6
6
  License: MIT
@@ -25,14 +25,14 @@ Requires-Dist: package-dev-utils<1,>=0.1.6; extra == "dev"
25
25
  ![Python version](https://img.shields.io/badge/python-3.10+-brightgreen)
26
26
  ![Operating system](https://img.shields.io/badge/os-linux-brightgreen)
27
27
  ![Coverage](https://img.shields.io/badge/coverage-66%25-brightgreen)
28
- ## [Plasma](https://kde.org/plasma-desktop/) 5.22 required
28
+ ## [Plasma](https://kde.org/plasma-desktop/) 6 required
29
29
 
30
30
  [Setup info](docs/setup-plasma.md)
31
31
 
32
32
  ## Setup steps
33
33
  1) Run
34
34
  ```shell
35
- wget -O - https://raw.githubusercontent.com/quintenroets/sysetup/main/bin/setup | bash
35
+ wget -O - sysetup.quintenroets.com | bash
36
36
  ```
37
37
  give rclone password when prompted
38
38
  2) Appearance
@@ -46,7 +46,6 @@ Requires-Dist: package-dev-utils<1,>=0.1.6; extra == "dev"
46
46
  * Click experimental: enable tab groups save and sync
47
47
  5) Login to
48
48
  * Pycharm professional
49
- * VNC Server
50
49
  6) For new device: set touchpad scroll direction and click on touch
51
50
 
52
51
  ## Installation
@@ -4,14 +4,14 @@
4
4
  ![Python version](https://img.shields.io/badge/python-3.10+-brightgreen)
5
5
  ![Operating system](https://img.shields.io/badge/os-linux-brightgreen)
6
6
  ![Coverage](https://img.shields.io/badge/coverage-66%25-brightgreen)
7
- ## [Plasma](https://kde.org/plasma-desktop/) 5.22 required
7
+ ## [Plasma](https://kde.org/plasma-desktop/) 6 required
8
8
 
9
9
  [Setup info](docs/setup-plasma.md)
10
10
 
11
11
  ## Setup steps
12
12
  1) Run
13
13
  ```shell
14
- wget -O - https://raw.githubusercontent.com/quintenroets/sysetup/main/bin/setup | bash
14
+ wget -O - sysetup.quintenroets.com | bash
15
15
  ```
16
16
  give rclone password when prompted
17
17
  2) Appearance
@@ -25,7 +25,6 @@
25
25
  * Click experimental: enable tab groups save and sync
26
26
  5) Login to
27
27
  * Pycharm professional
28
- * VNC Server
29
28
  6) For new device: set touchpad scroll direction and click on touch
30
29
 
31
30
  ## Installation
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sysetup"
3
- version = "1.3.5"
3
+ version = "1.3.7"
4
4
  description = "Personal system setup"
5
5
  authors = [{name = "Quinten Roets", email = "qdr2104@columbia.edu"}]
6
6
  license = {text = "MIT"}
@@ -55,11 +55,10 @@ fix = true
55
55
  [tool.ruff.lint]
56
56
  select = ["ALL"]
57
57
  ignore = [
58
- "ANN101", # annotate self
59
- "ANN102", # annotate cls
60
58
  "ANN401", # annotated with Any
61
- "D", # docstrings
62
- "S101", # assert used
59
+ "D", # docstrings
60
+ "G004", # logging f-string
61
+ "S101", # assert used
63
62
  ]
64
63
 
65
64
  [tool.ruff.lint.per-file-ignores]
@@ -1,23 +1,17 @@
1
1
  import os
2
- from collections.abc import Iterator
3
2
  from functools import cached_property
4
3
 
5
- import cli
6
4
  from package_utils.context import Context as Context_
7
5
 
8
6
  from sysetup.models import Options
7
+ from sysetup.utils import is_installed
9
8
 
10
9
 
11
10
  class Context(Context_[Options, None, None]):
12
11
  @cached_property
13
12
  def package_manager(self) -> str:
14
- def generate_package_manager() -> Iterator[str]:
15
- package_managers = "apt-get", "pacman"
16
- for package_manager in package_managers:
17
- if cli.completes_successfully("which", package_manager):
18
- yield package_manager
19
-
20
- return next(generate_package_manager())
13
+ options = "apt-get", "pacman"
14
+ return next(option for option in options if is_installed(option))
21
15
 
22
16
  @cached_property
23
17
  def apt_is_installed(self) -> bool:
@@ -33,11 +33,12 @@ def move_setup_files() -> None:
33
33
  else:
34
34
  archived_setup_files.append(path)
35
35
 
36
- backup = cache.Backup(paths=setup_files)
37
- backup.pull()
36
+ if setup_files:
37
+ cache.Backup(paths=setup_files).pull()
38
38
 
39
+ source = cache.Backup().source
39
40
  for path in archived_setup_files:
40
- dest = (backup.source / path.relative_to(setup_files_root)).parent
41
+ dest = (source / path.relative_to(setup_files_root)).parent
41
42
  if dest.is_root and not dest.exists():
42
43
  cli.run("mkdir -p", dest, root=True)
43
44
  else:
@@ -4,17 +4,16 @@ 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
+ from sysetup.utils import download_file, is_installed
8
8
 
9
9
 
10
10
  def setup() -> None:
11
11
  install_chromium()
12
12
  install_keyd()
13
+ install_ydotool()
13
14
  download_file(Path("/") / "etc" / "systemd" / "system" / "ydotoold.service")
14
- enable_service("ydotoold")
15
15
  enable_service("ssh")
16
16
  install_language_support()
17
- install_linter_env()
18
17
  install_personal_git_repositories()
19
18
 
20
19
 
@@ -26,7 +25,7 @@ def install_personal_git_repositories() -> None:
26
25
  if not Path.extensions.exists():
27
26
  command = f"git clone {base_url}/extensions.git"
28
27
  cli.run(command, Path.extensions)
29
- cli.run(f"pip install git+{base_url}/system.git")
28
+ cli.run(f"uv pip install git+{base_url}/system.git")
30
29
 
31
30
 
32
31
  def install_language_support() -> None:
@@ -40,7 +39,7 @@ def install_language_support() -> None:
40
39
 
41
40
 
42
41
  def install_chromium() -> None:
43
- if not cli.capture_output("which chromium-browser", check=False):
42
+ if not is_installed("chromium-browser"):
44
43
  _install_chromium()
45
44
 
46
45
 
@@ -57,15 +56,8 @@ def _install_chromium() -> None:
57
56
  cli.run_commands(*commands, shell=True, root=True, check=check) # noqa: S604
58
57
 
59
58
 
60
- def install_linter_env() -> None:
61
- if not Path.linter_env.exists():
62
- cli.run("python -m venv", Path.linter_env.name, cwd=Path.linter_env.parent)
63
- python_path = Path.linter_env / "bin" / "python"
64
- cli.run(f"{python_path} -m pip install autoimport powertrace-hooks")
65
-
66
-
67
59
  def install_keyd() -> None:
68
- install_repository("keyd", "quintenroets/keyd", branch="support-scroll-mapping")
60
+ install_repository("keyd", "rvaiya/keyd")
69
61
  enable_service("keyd")
70
62
 
71
63
 
@@ -75,12 +67,19 @@ def enable_service(name: str) -> None:
75
67
  cli.run(command, root=True)
76
68
 
77
69
 
78
- def install_repository(name: str, repository: str, branch: str | None = None) -> None:
79
- if not cli.capture_output("which", name, check=False):
70
+ def install_repository(name: str, repository: str) -> None:
71
+ if not is_installed(name):
80
72
  url = f"https://github.com/{repository}"
81
- command: tuple[str, ...] = "git clone", url
82
- if branch is not None:
83
- command = (*command, "-b", branch)
84
73
  with Path.tempdir() as directory:
85
- cli.run(*command, directory)
74
+ cli.run("git clone", url, directory)
75
+ if (directory / "CMakeLists.txt").exists():
76
+ cli.run("apt-get install cmake", root=True)
77
+ cli.run("cmake .")
86
78
  cli.run_commands("make", "sudo make install", cwd=directory)
79
+
80
+
81
+ def install_ydotool() -> None:
82
+ if not is_installed("ydotool"):
83
+ cli.run("apt-get install scdoc")
84
+ install_repository("ydotool", "ReimuNotMoe/ydotool")
85
+ enable_service("ydotoold")
@@ -2,7 +2,7 @@ import cli
2
2
 
3
3
  from sysetup.context import context
4
4
  from sysetup.models import Path
5
- from sysetup.utils import download_directory
5
+ from sysetup.utils import download_directory, is_installed
6
6
 
7
7
 
8
8
  def setup() -> None:
@@ -20,10 +20,7 @@ def install_packages() -> None:
20
20
  cli.install(*packages, install_command=command)
21
21
 
22
22
  if not context.apt_is_installed:
23
- commands = (
24
- "sudo pacman -S --noconfirm python-pip base-devel",
25
- "pip install wheel",
26
- )
23
+ commands = "sudo pacman -S --noconfirm base-devel", "uv pip install wheel"
27
24
  cli.run_commands(*commands)
28
25
 
29
26
 
@@ -39,7 +36,7 @@ def update_apt() -> None:
39
36
  "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true"
40
37
  )
41
38
  agree_eula_command = f'echo "{value}" | sudo debconf-set-selections'
42
- commands = ["sudo apt-get update", agree_eula_command]
39
+ commands = "sudo apt-get update", agree_eula_command
43
40
  cli.run_commands_in_shell(*commands)
44
41
  if not Path("/snap").exists():
45
42
  cli.run("ln -s /var/lib/snapd/snap /snap", root=True)
@@ -49,11 +46,8 @@ def cleanup_after_install() -> None:
49
46
  if context.apt_is_installed:
50
47
  cli.run("sudo apt-get autoremove -y")
51
48
  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",
56
- )
49
+ if is_installed("qdbus"):
50
+ commands = "rm /usr/bin/qdbus", "ln -s /usr/lib/qt6/bin/qdbus /usr/bin/qdbus"
57
51
  cli.run_commands(*commands, root=True)
58
52
  delete = "apt purge -y" if context.apt_is_installed else "pacman -R --noconfirm"
59
53
  commands = (
@@ -30,12 +30,6 @@ class Path(superpathlib.Path):
30
30
  path = cls.assets / "packages"
31
31
  return cast(T, path)
32
32
 
33
- @classmethod
34
- @classproperty
35
- def linter_env(cls: type[T]) -> T:
36
- path = cls.HOME / ".local" / "share" / "envs" / "linterenv"
37
- return cast(T, path)
38
-
39
33
  @classmethod
40
34
  @classproperty
41
35
  def extensions(cls: type[T]) -> T:
@@ -1 +1,2 @@
1
1
  from .download import download_directory, download_file
2
+ from .installations import is_installed
@@ -0,0 +1,5 @@
1
+ import cli
2
+
3
+
4
+ def is_installed(package: str) -> bool:
5
+ return cli.completes_successfully("which", package)
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: sysetup
3
- Version: 1.3.5
3
+ Version: 1.3.7
4
4
  Summary: Personal system setup
5
5
  Author-email: Quinten Roets <qdr2104@columbia.edu>
6
6
  License: MIT
@@ -25,14 +25,14 @@ Requires-Dist: package-dev-utils<1,>=0.1.6; extra == "dev"
25
25
  ![Python version](https://img.shields.io/badge/python-3.10+-brightgreen)
26
26
  ![Operating system](https://img.shields.io/badge/os-linux-brightgreen)
27
27
  ![Coverage](https://img.shields.io/badge/coverage-66%25-brightgreen)
28
- ## [Plasma](https://kde.org/plasma-desktop/) 5.22 required
28
+ ## [Plasma](https://kde.org/plasma-desktop/) 6 required
29
29
 
30
30
  [Setup info](docs/setup-plasma.md)
31
31
 
32
32
  ## Setup steps
33
33
  1) Run
34
34
  ```shell
35
- wget -O - https://raw.githubusercontent.com/quintenroets/sysetup/main/bin/setup | bash
35
+ wget -O - sysetup.quintenroets.com | bash
36
36
  ```
37
37
  give rclone password when prompted
38
38
  2) Appearance
@@ -46,7 +46,6 @@ Requires-Dist: package-dev-utils<1,>=0.1.6; extra == "dev"
46
46
  * Click experimental: enable tab groups save and sync
47
47
  5) Login to
48
48
  * Pycharm professional
49
- * VNC Server
50
49
  6) For new device: set touchpad scroll direction and click on touch
51
50
 
52
51
  ## Installation
@@ -31,7 +31,7 @@ src/sysetup/models/options.py
31
31
  src/sysetup/models/path.py
32
32
  src/sysetup/utils/__init__.py
33
33
  src/sysetup/utils/download.py
34
+ src/sysetup/utils/installations.py
34
35
  tests/test_background.py
35
36
  tests/test_cli_entry_point.py
36
- tests/test_installer.py
37
37
  tests/test_main.py
@@ -1,15 +0,0 @@
1
- from unittest.mock import PropertyMock, patch
2
-
3
- import cli
4
-
5
- from sysetup.main.installations import install_linter_env
6
- from sysetup.models import Path
7
-
8
-
9
- def test_linter_env() -> None:
10
- with Path.tempfile(create=False) as path:
11
- mocked_path = PropertyMock(return_value=path)
12
- with patch.object(Path, "linter_env", new_callable=mocked_path):
13
- install_linter_env()
14
- python_path = Path.linter_env / "bin" / "python"
15
- cli.run(f"{python_path} -m pip show autoimport")
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes