From 576ef895e0c6f61fdef64ac1e8a73772da9ac872 Mon Sep 17 00:00:00 2001 From: Max Mehl Date: Sun, 12 Jan 2025 12:11:58 +0100 Subject: [PATCH 01/13] make log file destination configurable --- seafile_mirror/seafile_mirror.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/seafile_mirror/seafile_mirror.py b/seafile_mirror/seafile_mirror.py index ceecb18..04f7558 100755 --- a/seafile_mirror/seafile_mirror.py +++ b/seafile_mirror/seafile_mirror.py @@ -27,6 +27,12 @@ from ._seafile import ( parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("-c", "--configdir", required=True, help="The config directory") +parser.add_argument( + "-l", + "--logfile", + required=True, + help="The path to the logfile. Default: /seafile_mirror.log", +) parser.add_argument( "-d", "--dry", @@ -59,7 +65,10 @@ def main(): # pylint: disable=too-many-locals, too-many-statements configdir = args.configdir.rstrip("/") + "/" configfile = configdir + "seafile_mirror.conf.yaml" cachefile = configdir + ".seafile_mirror.db.json" - logfile = configdir + "seafile_mirror.log" + if args.logfile: + logfile = args.logfile + else: + logfile = configdir + "seafile_mirror.log" # Logging log = logging.getLogger() -- 2.36.6 From 6eaf0a795de636e0bf7feb46695f98086514607a Mon Sep 17 00:00:00 2001 From: Max Mehl Date: Sun, 12 Jan 2025 12:23:58 +0100 Subject: [PATCH 02/13] fix poetry install in ubuntu 24.04 --- .gitea/actions/poetrybuild/action.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/actions/poetrybuild/action.yaml b/.gitea/actions/poetrybuild/action.yaml index 5dd150b..f9510bf 100644 --- a/.gitea/actions/poetrybuild/action.yaml +++ b/.gitea/actions/poetrybuild/action.yaml @@ -12,8 +12,10 @@ inputs: runs: using: "composite" steps: + - name: Set PATH + run: export PATH=$PATH:~/.local/bin - name: Install poetry - run: pip install poetry + run: pipx install poetry - name: Install poetry package run: poetry install --no-interaction ${{ inputs.poetry_install_args }} shell: bash -- 2.36.6 From 8a778247cafc5bde6ed5d6be8bdd723bc3f08360 Mon Sep 17 00:00:00 2001 From: Max Mehl Date: Sun, 12 Jan 2025 12:27:43 +0100 Subject: [PATCH 03/13] try CI fixes --- .gitea/actions/poetrybuild/action.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitea/actions/poetrybuild/action.yaml b/.gitea/actions/poetrybuild/action.yaml index f9510bf..6be592a 100644 --- a/.gitea/actions/poetrybuild/action.yaml +++ b/.gitea/actions/poetrybuild/action.yaml @@ -14,6 +14,8 @@ runs: steps: - name: Set PATH run: export PATH=$PATH:~/.local/bin + - name: Test + run: echo $PATH - name: Install poetry run: pipx install poetry - name: Install poetry package -- 2.36.6 From 069ffd94e3290fb4435e17d9563b033ec51ce786 Mon Sep 17 00:00:00 2001 From: Max Mehl Date: Sun, 12 Jan 2025 13:14:55 +0100 Subject: [PATCH 04/13] echo --- .gitea/actions/poetrybuild/action.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitea/actions/poetrybuild/action.yaml b/.gitea/actions/poetrybuild/action.yaml index 6be592a..f8ff69f 100644 --- a/.gitea/actions/poetrybuild/action.yaml +++ b/.gitea/actions/poetrybuild/action.yaml @@ -14,6 +14,8 @@ runs: steps: - name: Set PATH run: export PATH=$PATH:~/.local/bin + - run: echo "gitea $GITEA_PATH" + - run: echo "github $GITHUB_PATH" - name: Test run: echo $PATH - name: Install poetry -- 2.36.6 From 752c2a37ae51d47c451d5458b19396178c7c23ff Mon Sep 17 00:00:00 2001 From: Max Mehl Date: Sun, 12 Jan 2025 13:19:58 +0100 Subject: [PATCH 05/13] printenv --- .gitea/actions/poetrybuild/action.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitea/actions/poetrybuild/action.yaml b/.gitea/actions/poetrybuild/action.yaml index f8ff69f..968656b 100644 --- a/.gitea/actions/poetrybuild/action.yaml +++ b/.gitea/actions/poetrybuild/action.yaml @@ -12,10 +12,8 @@ inputs: runs: using: "composite" steps: - - name: Set PATH - run: export PATH=$PATH:~/.local/bin - run: echo "gitea $GITEA_PATH" - - run: echo "github $GITHUB_PATH" + - run: printenv - name: Test run: echo $PATH - name: Install poetry -- 2.36.6 From b5d635d92e567ab2f0e1d139a7db1828efabd00b Mon Sep 17 00:00:00 2001 From: Max Mehl Date: Sun, 12 Jan 2025 13:22:39 +0100 Subject: [PATCH 06/13] echo to path --- .gitea/actions/poetrybuild/action.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/actions/poetrybuild/action.yaml b/.gitea/actions/poetrybuild/action.yaml index 968656b..17a085a 100644 --- a/.gitea/actions/poetrybuild/action.yaml +++ b/.gitea/actions/poetrybuild/action.yaml @@ -12,10 +12,12 @@ inputs: runs: using: "composite" steps: - - run: echo "gitea $GITEA_PATH" - run: printenv + - run: echo /root/.local/bin >> $GITHUB_PATH + - run: echo /root/.local/bin >> $PATH - name: Test run: echo $PATH + - run: exit 1 - name: Install poetry run: pipx install poetry - name: Install poetry package -- 2.36.6 From 4dc7f8dc1534d12a2509a862e77bd43458cda9c0 Mon Sep 17 00:00:00 2001 From: Max Mehl Date: Sun, 12 Jan 2025 13:24:19 +0100 Subject: [PATCH 07/13] neu --- .gitea/actions/poetrybuild/action.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitea/actions/poetrybuild/action.yaml b/.gitea/actions/poetrybuild/action.yaml index 17a085a..adf976c 100644 --- a/.gitea/actions/poetrybuild/action.yaml +++ b/.gitea/actions/poetrybuild/action.yaml @@ -12,9 +12,9 @@ inputs: runs: using: "composite" steps: - - run: printenv - - run: echo /root/.local/bin >> $GITHUB_PATH - - run: echo /root/.local/bin >> $PATH + # - run: printenv + # - run: echo /root/.local/bin >> $GITHUB_PATH + - run: echo "/root/.local/bin" >> $PATH - name: Test run: echo $PATH - run: exit 1 -- 2.36.6 From dfd8f242e8a256bda4a4662b79ce30a98e9878c2 Mon Sep 17 00:00:00 2001 From: mxmehl Date: Sun, 12 Jan 2025 19:06:41 +0100 Subject: [PATCH 08/13] try copy paste --- .gitea/actions/poetrybuild/action.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitea/actions/poetrybuild/action.yaml b/.gitea/actions/poetrybuild/action.yaml index adf976c..a0d63f9 100644 --- a/.gitea/actions/poetrybuild/action.yaml +++ b/.gitea/actions/poetrybuild/action.yaml @@ -16,7 +16,10 @@ runs: # - run: echo /root/.local/bin >> $GITHUB_PATH - run: echo "/root/.local/bin" >> $PATH - name: Test - run: echo $PATH + - name: Add pipx to PATH + if: github.actor == 'nektos/act' + run: echo "/root/.local/bin" >> ${GITHUB_PATH} + - run: echo $PATH - run: exit 1 - name: Install poetry run: pipx install poetry -- 2.36.6 From 7ea7181947572e7d53e4f071aa580301c74d9255 Mon Sep 17 00:00:00 2001 From: Max Mehl Date: Sun, 12 Jan 2025 19:36:45 +0100 Subject: [PATCH 09/13] syntax --- .gitea/actions/poetrybuild/action.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.gitea/actions/poetrybuild/action.yaml b/.gitea/actions/poetrybuild/action.yaml index a0d63f9..6a69cb9 100644 --- a/.gitea/actions/poetrybuild/action.yaml +++ b/.gitea/actions/poetrybuild/action.yaml @@ -12,12 +12,7 @@ inputs: runs: using: "composite" steps: - # - run: printenv - # - run: echo /root/.local/bin >> $GITHUB_PATH - - run: echo "/root/.local/bin" >> $PATH - - name: Test - name: Add pipx to PATH - if: github.actor == 'nektos/act' run: echo "/root/.local/bin" >> ${GITHUB_PATH} - run: echo $PATH - run: exit 1 -- 2.36.6 From 553dffae1f379b68df4c19bdc81c74cbdee17681 Mon Sep 17 00:00:00 2001 From: Max Mehl Date: Sun, 12 Jan 2025 19:37:37 +0100 Subject: [PATCH 10/13] prod --- .gitea/actions/poetrybuild/action.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitea/actions/poetrybuild/action.yaml b/.gitea/actions/poetrybuild/action.yaml index 6a69cb9..9f2b0b6 100644 --- a/.gitea/actions/poetrybuild/action.yaml +++ b/.gitea/actions/poetrybuild/action.yaml @@ -14,8 +14,6 @@ runs: steps: - name: Add pipx to PATH run: echo "/root/.local/bin" >> ${GITHUB_PATH} - - run: echo $PATH - - run: exit 1 - name: Install poetry run: pipx install poetry - name: Install poetry package -- 2.36.6 From 4e87bd4a80fe4c25329716d1ac25b9c71c00640b Mon Sep 17 00:00:00 2001 From: Max Mehl Date: Sun, 12 Jan 2025 19:59:54 +0100 Subject: [PATCH 11/13] more --- .gitea/workflows/selftests.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/selftests.yaml b/.gitea/workflows/selftests.yaml index 2fffda0..e548666 100644 --- a/.gitea/workflows/selftests.yaml +++ b/.gitea/workflows/selftests.yaml @@ -17,8 +17,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Add pipx to PATH + run: echo "/root/.local/bin" >> ${GITHUB_PATH} - name: Install poetry - run: pip install poetry + run: pipx install poetry - name: Build package run: poetry build - name: Install package -- 2.36.6 From ae955140eba8ac204524391ad0bbabcfaab3bd2c Mon Sep 17 00:00:00 2001 From: Max Mehl Date: Sun, 12 Jan 2025 20:04:09 +0100 Subject: [PATCH 12/13] more fixes --- .gitea/workflows/selftests.yaml | 2 +- seafile_mirror/seafile_mirror.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitea/workflows/selftests.yaml b/.gitea/workflows/selftests.yaml index e548666..b2022d7 100644 --- a/.gitea/workflows/selftests.yaml +++ b/.gitea/workflows/selftests.yaml @@ -14,7 +14,7 @@ on: jobs: # Test building the package and installing it via pip3 test-build-install: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: Add pipx to PATH diff --git a/seafile_mirror/seafile_mirror.py b/seafile_mirror/seafile_mirror.py index 04f7558..ace87d1 100755 --- a/seafile_mirror/seafile_mirror.py +++ b/seafile_mirror/seafile_mirror.py @@ -30,7 +30,6 @@ parser.add_argument("-c", "--configdir", required=True, help="The config directo parser.add_argument( "-l", "--logfile", - required=True, help="The path to the logfile. Default: /seafile_mirror.log", ) parser.add_argument( -- 2.36.6 From 17a9208ea9269f157117f5ce2d743de30da932c8 Mon Sep 17 00:00:00 2001 From: Max Mehl Date: Sun, 12 Jan 2025 20:05:25 +0100 Subject: [PATCH 13/13] ignore too-many-branches --- seafile_mirror/seafile_mirror.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seafile_mirror/seafile_mirror.py b/seafile_mirror/seafile_mirror.py index ace87d1..e76e17f 100755 --- a/seafile_mirror/seafile_mirror.py +++ b/seafile_mirror/seafile_mirror.py @@ -57,7 +57,7 @@ parser.add_argument( parser.add_argument("--version", action="version", version="%(prog)s " + __version__) -def main(): # pylint: disable=too-many-locals, too-many-statements +def main(): # pylint: disable=too-many-locals, too-many-statements, too-many-branches """Main function""" args = parser.parse_args() # Set files depending on configdir -- 2.36.6