From 7285fa9f22613d74f111087f797be0bfef099b50 Mon Sep 17 00:00:00 2001 From: Rhys-T <108157737+Rhys-T@users.noreply.github.com> Date: Mon, 16 Sep 2024 13:26:31 -0400 Subject: [PATCH 1/2] Remove dependency on deprecated distutils package --- bin/nur | 2 +- ci/nur/combine.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/nur b/bin/nur index 054e5794e..998edbeb0 100755 --- a/bin/nur +++ b/bin/nur @@ -1,5 +1,5 @@ #!/usr/bin/env nix-shell -#!nix-shell -p python3 -p nix-prefetch-git -p nix -i python3 -p python3Packages.distutils +#!nix-shell -p python3 -p nix-prefetch-git -p nix -i python3 import sys import os diff --git a/ci/nur/combine.py b/ci/nur/combine.py index 4003195d6..9cb7787e7 100644 --- a/ci/nur/combine.py +++ b/ci/nur/combine.py @@ -3,7 +3,6 @@ import os import shutil import subprocess from argparse import Namespace -from distutils.dir_util import copy_tree from pathlib import Path from tempfile import TemporaryDirectory from typing import Dict, List, Optional @@ -51,7 +50,7 @@ def commit_repo(repo: Repo, message: str, path: Path) -> Repo: assert tmp is not None try: - copy_tree(repo_source(repo.name), tmp.name, preserve_symlinks=1) + shutil.copytree(repo_source(repo.name), tmp.name, preserve_symlinks=1) shutil.rmtree(repo_path, ignore_errors=True) os.rename(tmp.name, repo_path) tmp = None @@ -160,7 +159,7 @@ def setup_combined() -> None: write_json_file(dict(repos={}), manifest_path) manifest_lib = "lib" - copy_tree(str(ROOT.joinpath("lib")), manifest_lib, preserve_symlinks=1) + shutil.copytree(str(ROOT.joinpath("lib")), manifest_lib, preserve_symlinks=1) default_nix = "default.nix" shutil.copy(ROOT.joinpath("default.nix"), default_nix) From 7ee4712a99a239cd57022e7b1d8ab91934682efe Mon Sep 17 00:00:00 2001 From: Rhys-T <108157737+Rhys-T@users.noreply.github.com> Date: Mon, 16 Sep 2024 13:48:34 -0400 Subject: [PATCH 2/2] ci/nur/combine.py: fix `copytree` calls to use correct `symlinks` argument --- ci/nur/combine.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/nur/combine.py b/ci/nur/combine.py index 9cb7787e7..5e0df2906 100644 --- a/ci/nur/combine.py +++ b/ci/nur/combine.py @@ -50,7 +50,7 @@ def commit_repo(repo: Repo, message: str, path: Path) -> Repo: assert tmp is not None try: - shutil.copytree(repo_source(repo.name), tmp.name, preserve_symlinks=1) + shutil.copytree(repo_source(repo.name), tmp.name, symlinks=True) shutil.rmtree(repo_path, ignore_errors=True) os.rename(tmp.name, repo_path) tmp = None @@ -159,7 +159,7 @@ def setup_combined() -> None: write_json_file(dict(repos={}), manifest_path) manifest_lib = "lib" - shutil.copytree(str(ROOT.joinpath("lib")), manifest_lib, preserve_symlinks=1) + shutil.copytree(str(ROOT.joinpath("lib")), manifest_lib, symlinks=True) default_nix = "default.nix" shutil.copy(ROOT.joinpath("default.nix"), default_nix)