From 3c07f314c3303a6bbb87747dbcd139d06c47615d Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Thu, 21 Nov 2024 13:10:32 +0000 Subject: [PATCH] More packaging (#5) --- .github/workflows/linux_wheel.yaml | 1 + packaging/post_build_script.sh | 8 ++++++++ setup.py | 2 ++ version.txt | 2 +- 4 files changed, 12 insertions(+), 1 deletion(-) create mode 100755 packaging/post_build_script.sh diff --git a/.github/workflows/linux_wheel.yaml b/.github/workflows/linux_wheel.yaml index ec048db..059d072 100644 --- a/.github/workflows/linux_wheel.yaml +++ b/.github/workflows/linux_wheel.yaml @@ -50,5 +50,6 @@ jobs: test-infra-ref: main build-matrix: ${{ needs.generate-matrix.outputs.matrix }} pre-script: packaging/pre_build_script.sh + post-script: packaging/post_build_script.sh package-name: torchvision_extra_decoders trigger-event: ${{ github.event_name }} diff --git a/packaging/post_build_script.sh b/packaging/post_build_script.sh new file mode 100755 index 0000000..2386988 --- /dev/null +++ b/packaging/post_build_script.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -ex + +old="linux_x86_64" +new="manylinux_2_17_x86_64.manylinux2014_x86_64" +echo "Replacing ${old} with ${new} in wheel name" +mv dist/*${old}*.whl $(echo dist/*${old}*.whl | sed "s/${old}/${new}/") diff --git a/setup.py b/setup.py index cc505fc..1455d7b 100644 --- a/setup.py +++ b/setup.py @@ -35,6 +35,8 @@ def get_and_write_version(): elif sha != "Unknown": version += "+" + sha[:7] + version = version.replace("+cpu", "") + with open(ROOT_DIR / "torchvision_extra_decoders/version.py", "w") as f: f.write(f"__version__ = '{version}'\n") f.write(f"git_version = {repr(sha)}\n") diff --git a/version.txt b/version.txt index 9138b7e..8ea4f48 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.0.1.0a +0.0.1a0