Skip to content

Commit

Permalink
Erweitere Pythonunterstützung auf 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxG87 committed Dec 22, 2023
2 parents f128b59 + 354cfd3 commit dd787ea
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
dependency-extras: ["", "-E all"]

steps:
Expand Down
30 changes: 16 additions & 14 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ authors = ["Max Görner <[email protected]>"]
license = "GPL-3.0-or-later"

[tool.poetry.dependencies]
python = ">=3.8.1,<3.12"
python = ">=3.8.1,<3.13"
typer = "^0.9.0"
pydantic = "<2.0"
loguru = "^0.7.0"
shell-interface = "^0.10.0"
storage-device-managers = "^0.11.1"
shell-interface = "^0.13.0"
storage-device-managers = "^0.14.0"
rich = {version = "^13.5.2", optional = true}

[tool.poetry.extras]
Expand Down
16 changes: 10 additions & 6 deletions src/butter_backup/device_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,16 @@ def prepare_device_for_resticbackend(device: Path) -> cp.ResticConfig:
sdm.mkfs_btrfs(decrypted)
with sdm.mounted_device(decrypted) as mounted:
backup_repo = mounted / backup_repository_folder
cmd: sh.StrPathList = ["sudo", "mkdir", backup_repo]
sh.run_cmd(cmd=cmd)
sh.pipe_pass_cmd_to_real_cmd(
repository_passcmd,
["sudo", "restic", "init", "-r", backup_repo],
)
mkdir_repo: sh.StrPathList = ["sudo", "mkdir", backup_repo]
restic_init: sh.StrPathList = [
"sudo",
"restic",
"init",
"-r",
backup_repo,
]
sh.run_cmd(cmd=mkdir_repo)
sh.pipe_pass_cmd_to_real_cmd(repository_passcmd, restic_init)
sdm.chown(mounted, user, group, recursive=True)
config = cp.ResticConfig(
BackupRepositoryFolder=backup_repository_folder,
Expand Down
22 changes: 10 additions & 12 deletions tests/test_backup_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,16 @@ def get_result_content_for_restic(
config: cp.ResticConfig, mounted: Path
) -> Counter[bytes]:
with TemporaryDirectory() as restore_dir:
sh.pipe_pass_cmd_to_real_cmd(
config.RepositoryPassCmd,
[
"restic",
"-r",
mounted / config.BackupRepositoryFolder,
"restore",
"latest",
"--target",
restore_dir,
],
)
restore_cmd: sh.StrPathList = [
"restic",
"-r",
mounted / config.BackupRepositoryFolder,
"restore",
"latest",
"--target",
restore_dir,
]
sh.pipe_pass_cmd_to_real_cmd(config.RepositoryPassCmd, restore_cmd)
return Counter(
file.read_bytes() for file in list_files_recursively(Path(restore_dir))
)
Expand Down

0 comments on commit dd787ea

Please sign in to comment.