From 46fe5b75900b74ce0172da628ad3608845cfa7b0 Mon Sep 17 00:00:00 2001 From: Emmanuel Leblond Date: Tue, 26 Mar 2024 00:11:18 +0100 Subject: [PATCH] Fix releaser.py import statement to be able to simply run it as `python misc/releaser.py` --- .github/workflows/_parse_version.yml | 10 ++-------- .github/workflows/_releaser_nightly_build.yml | 8 ++------ .github/workflows/docker-server.yml | 5 +---- .github/workflows/docker-testbed.yml | 5 +---- misc/releaser.py | 2 +- server/packaging/server/build.sh | 2 +- server/packaging/testbed-server/build.sh | 2 +- 7 files changed, 9 insertions(+), 25 deletions(-) diff --git a/.github/workflows/_parse_version.yml b/.github/workflows/_parse_version.yml index e95d7809876..6aa3e48edbe 100644 --- a/.github/workflows/_parse_version.yml +++ b/.github/workflows/_parse_version.yml @@ -84,18 +84,12 @@ jobs: id: version shell: bash run: >- - PYTHONPATH=. python3 - misc/releaser.py version - "${{ inputs.version || '--uniq-dev' }}" + python misc/releaser.py version "${{ inputs.version || '--uniq-dev' }}" | tee ${{ runner.temp }}/version.ini "$GITHUB_OUTPUT" timeout-minutes: 2 - name: Set version for patching - run: >- - PYTHONPATH=. python3 - misc/version_updater.py - --tool parsec - --version ${{ steps.version.outputs.full }} + run: python misc/version_updater.py --tool parsec --version ${{ steps.version.outputs.full }} timeout-minutes: 2 - name: Generate git patch diff --git a/.github/workflows/_releaser_nightly_build.yml b/.github/workflows/_releaser_nightly_build.yml index 0c923ad8bbf..199580ae559 100644 --- a/.github/workflows/_releaser_nightly_build.yml +++ b/.github/workflows/_releaser_nightly_build.yml @@ -35,9 +35,7 @@ jobs: timeout-minutes: 1 - name: Create nightly release - run: >- - PYTHONPATH=. python3 - misc/releaser.py build --nightly --yes --no-gpg-sign + run: python misc/releaser.py build --nightly --yes --no-gpg-sign timeout-minutes: 2 - name: Get commit for nightly tag @@ -47,7 +45,5 @@ jobs: - name: Parse version id: version - run: >- - PYTHONPATH=. python3 - misc/releaser.py version | tee -a $GITHUB_OUTPUT + run: python misc/releaser.py version | tee -a $GITHUB_OUTPUT timeout-minutes: 1 diff --git a/.github/workflows/docker-server.yml b/.github/workflows/docker-server.yml index d20eb3b700c..3215343124c 100644 --- a/.github/workflows/docker-server.yml +++ b/.github/workflows/docker-server.yml @@ -46,10 +46,7 @@ jobs: - name: Get current version id: version - run: >- - PYTHONPATH=. python3 - misc/releaser.py version --uniq-dev - | tee -a $GITHUB_OUTPUT + run: python misc/releaser.py version --uniq-dev | tee -a $GITHUB_OUTPUT timeout-minutes: 1 - name: Generate build metadata diff --git a/.github/workflows/docker-testbed.yml b/.github/workflows/docker-testbed.yml index 5e063705099..27481caf1f5 100644 --- a/.github/workflows/docker-testbed.yml +++ b/.github/workflows/docker-testbed.yml @@ -55,10 +55,7 @@ jobs: - name: Get current version id: version - run: >- - PYTHONPATH=. python3 - misc/releaser.py version --uniq-dev - | tee -a $GITHUB_OUTPUT + run: python misc/releaser.py version --uniq-dev | tee -a $GITHUB_OUTPUT timeout-minutes: 1 - name: Generate build metadata diff --git a/misc/releaser.py b/misc/releaser.py index 9ec6bf94d3c..30f0e8572b3 100755 --- a/misc/releaser.py +++ b/misc/releaser.py @@ -41,7 +41,7 @@ from pathlib import Path from typing import Any -import misc.version_updater as version_updater # type: ignore (pyright struggles with this when run from server folder) +import version_updater # type: ignore (pyright struggles with this when run from server folder) PYTHON_EXECUTABLE_PATH = sys.executable LICENSE_CONVERSION_DELAY = 4 * 365 * 24 * 3600 # 4 years diff --git a/server/packaging/server/build.sh b/server/packaging/server/build.sh index 81e95df7cac..3dfe7ca0093 100644 --- a/server/packaging/server/build.sh +++ b/server/packaging/server/build.sh @@ -9,7 +9,7 @@ SCRIPTDIR=${SCRIPTDIR:=$(dirname "$(realpath -s "$0")")} # Allow the user to overwrite `ROOTDIR` by exporting it beforehand. ROOTDIR=${ROOTDIR:=$(realpath -s "$SCRIPTDIR/../../..")} -UNIQ_TAG=$(PYTHONPATH=$ROOTDIR python $ROOTDIR/misc/releaser.py version --uniq-dev | sed -n 's/docker=\(.*\)$/\1/p') +UNIQ_TAG=$(python $ROOTDIR/misc/releaser.py version --uniq-dev | sed -n 's/docker=\(.*\)$/\1/p') # We use Github package repository to store our docker's container. PREFIX=ghcr.io/scille/parsec-cloud IMAGE_NAME=parsec-server diff --git a/server/packaging/testbed-server/build.sh b/server/packaging/testbed-server/build.sh index 843fc362060..3771114f72f 100755 --- a/server/packaging/testbed-server/build.sh +++ b/server/packaging/testbed-server/build.sh @@ -9,7 +9,7 @@ SCRIPTDIR=${SCRIPTDIR:=$(dirname "$(realpath -s "$0")")} # Allow the user to overwrite `ROOTDIR` by exporting it beforehand. ROOTDIR=${ROOTDIR:=$(realpath -s "$SCRIPTDIR/../../..")} -UNIQ_TAG=$(PYTHONPATH=$ROOTDIR python $ROOTDIR/misc/releaser.py version --uniq-dev | sed -n 's/docker=\(.*\)$/\1/p') +UNIQ_TAG=$(python $ROOTDIR/misc/releaser.py version --uniq-dev | sed -n 's/docker=\(.*\)$/\1/p') # We use Github package repository to store our docker's container. PREFIX=ghcr.io/scille/parsec-cloud