From 2604c74bdc2a6c5392550fac7490d9cae79fcf69 Mon Sep 17 00:00:00 2001 From: Allison Karlitskaya Date: Wed, 6 Sep 2023 10:47:25 +0200 Subject: [PATCH] modules: rename to vendor This is a lot more tab-complete-friendly and it's also closer to what many other packages do for similar situations. --- .github/workflows/pybridge-c8s.yml | 2 +- .github/workflows/tox.yaml | 2 +- .gitmodules | 6 +++--- containers/unit-tests/start | 2 +- modules/checkout | 9 --------- src/build_backend.py | 2 +- src/cockpit/_vendor/bei | 2 +- src/cockpit/_vendor/ferny | 2 +- src/cockpit/_vendor/systemd_ctypes | 2 +- {modules => vendor}/beipack | 0 vendor/checkout | 9 +++++++++ {modules => vendor}/ferny | 0 {modules => vendor}/systemd_ctypes | 0 13 files changed, 19 insertions(+), 19 deletions(-) delete mode 100755 modules/checkout rename {modules => vendor}/beipack (100%) create mode 100755 vendor/checkout rename {modules => vendor}/ferny (100%) rename {modules => vendor}/systemd_ctypes (100%) diff --git a/.github/workflows/pybridge-c8s.yml b/.github/workflows/pybridge-c8s.yml index 7c1f1a6f380..899d7ca1094 100644 --- a/.github/workflows/pybridge-c8s.yml +++ b/.github/workflows/pybridge-c8s.yml @@ -20,7 +20,7 @@ jobs: run: git config --global --add safe.directory /__w/cockpit/cockpit - name: Install submodules - run: modules/checkout + run: vendor/checkout - name: Check --help run: PYTHONPATH=src python3 -m cockpit.bridge --help diff --git a/.github/workflows/tox.yaml b/.github/workflows/tox.yaml index a5a08ff1049..b235c92ee85 100644 --- a/.github/workflows/tox.yaml +++ b/.github/workflows/tox.yaml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v3 - name: Checkout submodules - run: modules/checkout + run: vendor/checkout - name: Run venv tests run: runuser -u tox -- tox --colored=yes -m venv -- --color=yes diff --git a/.gitmodules b/.gitmodules index 55b3988b7fe..08dd6ce4a12 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,5 +1,5 @@ [submodule "modules/systemd_ctypes"] - path = modules/systemd_ctypes + path = vendor/systemd_ctypes url = https://github.com/allisonkarlitskaya/systemd_ctypes.git [submodule "node_modules"] path = node_modules @@ -9,9 +9,9 @@ url = https://github.com/cockpit-project/pixel-test-reference branch = empty [submodule "modules/ferny"] - path = modules/ferny + path = vendor/ferny url = https://github.com/allisonkarlitskaya/ferny [submodule "modules/beipack"] - path = modules/beipack + path = vendor/beipack url = https://github.com/allisonkarlitskaya/beipack branch = main diff --git a/containers/unit-tests/start b/containers/unit-tests/start index 1a3d2322af4..e01cb66370a 100755 --- a/containers/unit-tests/start +++ b/containers/unit-tests/start @@ -71,7 +71,7 @@ class SourceDirectory(PodmanTemporaryDirectory): else: opts = [] - git('clone', '--recurse-submodule=modules/*', *opts, '.', self.name) + git('clone', '--recurse-submodule=vendor/*', *opts, '.', self.name) if not args.head and not args.branch: if stash := git_output('stash', 'create'): diff --git a/modules/checkout b/modules/checkout deleted file mode 100755 index 4930253cb50..00000000000 --- a/modules/checkout +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -set -eu -cd "${0%/*}/.." - -# Nothing missing? Do nothing. -git submodule status modules | grep -q ^- || exit 0 - -git submodule update --init --checkout 'modules/*' diff --git a/src/build_backend.py b/src/build_backend.py index d8af9fae052..74dbab113dd 100644 --- a/src/build_backend.py +++ b/src/build_backend.py @@ -18,7 +18,7 @@ def find_sources(*, srcpkg: bool) -> Iterable[str]: try: - subprocess.check_call(['modules/checkout'], stdout=2) # Needed for git builds... + subprocess.check_call(['vendor/checkout'], stdout=2) # Needed for git builds... except FileNotFoundError: # ...but not present in tarball... pass # ...and not needed either, because... assert os.path.exists('src/cockpit/_vendor/ferny/__init__.py') # ...the code should exist there already. diff --git a/src/cockpit/_vendor/bei b/src/cockpit/_vendor/bei index 54fb1dcc02d..23a8bac0323 120000 --- a/src/cockpit/_vendor/bei +++ b/src/cockpit/_vendor/bei @@ -1 +1 @@ -../../../modules/beipack/src/bei \ No newline at end of file +../../../vendor/beipack/src/bei \ No newline at end of file diff --git a/src/cockpit/_vendor/ferny b/src/cockpit/_vendor/ferny index 059f6a872bf..5f299b3ab84 120000 --- a/src/cockpit/_vendor/ferny +++ b/src/cockpit/_vendor/ferny @@ -1 +1 @@ -../../../modules/ferny/src/ferny \ No newline at end of file +../../../vendor/ferny/src/ferny \ No newline at end of file diff --git a/src/cockpit/_vendor/systemd_ctypes b/src/cockpit/_vendor/systemd_ctypes index 19f1fbd6a93..0a3f9ef81d6 120000 --- a/src/cockpit/_vendor/systemd_ctypes +++ b/src/cockpit/_vendor/systemd_ctypes @@ -1 +1 @@ -../../../modules/systemd_ctypes/src/systemd_ctypes \ No newline at end of file +../../../vendor/systemd_ctypes/src/systemd_ctypes \ No newline at end of file diff --git a/modules/beipack b/vendor/beipack similarity index 100% rename from modules/beipack rename to vendor/beipack diff --git a/vendor/checkout b/vendor/checkout new file mode 100755 index 00000000000..fb922eee468 --- /dev/null +++ b/vendor/checkout @@ -0,0 +1,9 @@ +#!/bin/sh + +set -eu +cd "${0%/*}/.." + +# Nothing missing? Do nothing. +git submodule status vendor | grep -q ^- || exit 0 + +git submodule update --init --checkout 'vendor/*' diff --git a/modules/ferny b/vendor/ferny similarity index 100% rename from modules/ferny rename to vendor/ferny diff --git a/modules/systemd_ctypes b/vendor/systemd_ctypes similarity index 100% rename from modules/systemd_ctypes rename to vendor/systemd_ctypes