sysetup 1.3.4__tar.gz → 1.3.6__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.4/src/sysetup.egg-info → sysetup-1.3.6}/PKG-INFO +4 -4
  2. {sysetup-1.3.4 → sysetup-1.3.6}/README.md +2 -2
  3. {sysetup-1.3.4 → sysetup-1.3.6}/pyproject.toml +4 -5
  4. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup/context/context.py +3 -9
  5. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup/main/files/assets.py +7 -3
  6. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup/main/installations.py +11 -20
  7. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup/main/packages.py +5 -11
  8. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup/models/path.py +0 -6
  9. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup/utils/__init__.py +1 -0
  10. sysetup-1.3.6/src/sysetup/utils/installations.py +5 -0
  11. {sysetup-1.3.4 → sysetup-1.3.6/src/sysetup.egg-info}/PKG-INFO +4 -4
  12. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup.egg-info/SOURCES.txt +1 -1
  13. sysetup-1.3.4/tests/test_installer.py +0 -15
  14. {sysetup-1.3.4 → sysetup-1.3.6}/LICENSE +0 -0
  15. {sysetup-1.3.4 → sysetup-1.3.6}/bin/pw +0 -0
  16. {sysetup-1.3.4 → sysetup-1.3.6}/bin/pw-askpass +0 -0
  17. {sysetup-1.3.4 → sysetup-1.3.6}/setup.cfg +0 -0
  18. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup/__init__.py +0 -0
  19. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup/cli/__init__.py +0 -0
  20. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup/cli/entry_point.py +0 -0
  21. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup/context/__init__.py +0 -0
  22. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup/main/__init__.py +0 -0
  23. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup/main/environment.py +0 -0
  24. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup/main/files/__init__.py +0 -0
  25. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup/main/files/permissions.py +0 -0
  26. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup/main/files/settings.py +0 -0
  27. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup/main/files/setup.py +0 -0
  28. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup/main/main.py +0 -0
  29. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup/models/__init__.py +0 -0
  30. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup/models/action.py +0 -0
  31. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup/models/options.py +0 -0
  32. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup/py.typed +0 -0
  33. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup/utils/download.py +0 -0
  34. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup.egg-info/dependency_links.txt +0 -0
  35. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup.egg-info/entry_points.txt +0 -0
  36. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup.egg-info/requires.txt +0 -0
  37. {sysetup-1.3.4 → sysetup-1.3.6}/src/sysetup.egg-info/top_level.txt +0 -0
  38. {sysetup-1.3.4 → sysetup-1.3.6}/tests/test_background.py +0 -0
  39. {sysetup-1.3.4 → sysetup-1.3.6}/tests/test_cli_entry_point.py +0 -0
  40. {sysetup-1.3.4 → sysetup-1.3.6}/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.4
3
+ Version: 1.3.6
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
@@ -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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sysetup"
3
- version = "1.3.4"
3
+ version = "1.3.6"
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:
@@ -6,11 +6,15 @@ from sysetup.utils import download_directory
6
6
 
7
7
 
8
8
  def setup() -> None:
9
- download_directory(Path.assets)
10
- download_directory(Path.HOME / ".local" / "share" / "kwalletd")
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)
11
16
  move_crontab()
12
17
  move_setup_files()
13
- download_directory(Path.assets.parent / "backup")
14
18
 
15
19
 
16
20
  def move_crontab() -> None:
@@ -4,15 +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, is_installed
7
8
 
8
9
 
9
10
  def setup() -> None:
10
11
  install_chromium()
11
12
  install_keyd()
13
+ download_file(Path("/") / "etc" / "systemd" / "system" / "ydotoold.service")
12
14
  enable_service("ydotoold")
13
15
  enable_service("ssh")
14
16
  install_language_support()
15
- install_linter_env()
16
17
  install_personal_git_repositories()
17
18
 
18
19
 
@@ -21,10 +22,10 @@ def install_personal_git_repositories() -> None:
21
22
  token = os.getenv("GITHUB", None)
22
23
  if token is not None:
23
24
  base_url = base_url.replace("github.com", f"{token}@github.com")
24
- if not Path.extensions.exists():
25
- command = f"git clone {base_url}/extensions.git"
26
- cli.run(command, Path.extensions)
27
- cli.run(f"pip install git+{base_url}/system.git")
25
+ if not Path.extensions.exists():
26
+ command = f"git clone {base_url}/extensions.git"
27
+ cli.run(command, Path.extensions)
28
+ cli.run(f"uv pip install git+{base_url}/system.git")
28
29
 
29
30
 
30
31
  def install_language_support() -> None:
@@ -38,7 +39,7 @@ def install_language_support() -> None:
38
39
 
39
40
 
40
41
  def install_chromium() -> None:
41
- if not cli.capture_output("which chromium-browser", check=False):
42
+ if not is_installed("chromium-browser"):
42
43
  _install_chromium()
43
44
 
44
45
 
@@ -55,15 +56,8 @@ def _install_chromium() -> None:
55
56
  cli.run_commands(*commands, shell=True, root=True, check=check) # noqa: S604
56
57
 
57
58
 
58
- def install_linter_env() -> None:
59
- if not Path.linter_env.exists():
60
- cli.run("python -m venv", Path.linter_env.name, cwd=Path.linter_env.parent)
61
- python_path = Path.linter_env / "bin" / "python"
62
- cli.run(f"{python_path} -m pip install autoimport powertrace-hooks")
63
-
64
-
65
59
  def install_keyd() -> None:
66
- install_repository("keyd", "quintenroets/keyd", branch="support-scroll-mapping")
60
+ install_repository("keyd", "rvaiya/keyd")
67
61
  enable_service("keyd")
68
62
 
69
63
 
@@ -73,12 +67,9 @@ def enable_service(name: str) -> None:
73
67
  cli.run(command, root=True)
74
68
 
75
69
 
76
- def install_repository(name: str, repository: str, branch: str | None = None) -> None:
77
- if not cli.capture_output("which", name, check=False):
70
+ def install_repository(name: str, repository: str) -> None:
71
+ if not is_installed(name):
78
72
  url = f"https://github.com/{repository}"
79
- command: tuple[str, ...] = "git clone", url
80
- if branch is not None:
81
- command = (*command, "-b", branch)
82
73
  with Path.tempdir() as directory:
83
- cli.run(*command, directory)
74
+ cli.run("git clone", url, directory)
84
75
  cli.run_commands("make", "sudo make install", cwd=directory)
@@ -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
- "ls -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.4
3
+ Version: 1.3.6
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
@@ -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