From 6854fe1b1034d85e79beaff7730a6e98cba3bfdd Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Sat, 6 Jan 2024 23:21:02 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=8D=20Prepare=20for=20an=20initial=20r?= =?UTF-8?q?elease=20of=20`python-hugo`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HUGO_CHECKSUM | 1 - HUGO_VERSION | 1 - MANIFEST.in | 2 -- python_hugo/cli.py | 3 +-- setup.py | 11 ++++------- 5 files changed, 5 insertions(+), 13 deletions(-) delete mode 100644 HUGO_CHECKSUM delete mode 100644 HUGO_VERSION diff --git a/HUGO_CHECKSUM b/HUGO_CHECKSUM deleted file mode 100644 index a809547..0000000 --- a/HUGO_CHECKSUM +++ /dev/null @@ -1 +0,0 @@ -fd16b6723365e2d60bef9dd2c0a12a0b046185b033973a85eae7e5979693b799 \ No newline at end of file diff --git a/HUGO_VERSION b/HUGO_VERSION deleted file mode 100644 index ad0e098..0000000 --- a/HUGO_VERSION +++ /dev/null @@ -1 +0,0 @@ -0.121.1 \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in index 673189e..5cb5869 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,3 @@ include licenses/LICENSE-hugo.txt -include HUGO_VERSION -include HUGO_CHECKSUM include python_hugo/binaries/* exclude python_hugo/binaries/hugo-* diff --git a/python_hugo/cli.py b/python_hugo/cli.py index 42daaa7..b3c0ae4 100644 --- a/python_hugo/cli.py +++ b/python_hugo/cli.py @@ -12,8 +12,7 @@ from pathlib import Path from functools import lru_cache -# Read Hugo version from VERSION file in repository root -HUGO_VERSION = Path(__file__).parent.parent.joinpath("HUGO_VERSION").read_text().strip() +HUGO_VERSION = "0.121.1" FILE_EXT = ".exe" if sys.platform == "win32" else "" HUGO_PLATFORM = { diff --git a/setup.py b/setup.py index 27470b8..3a9506e 100644 --- a/setup.py +++ b/setup.py @@ -13,18 +13,15 @@ from wheel.bdist_wheel import bdist_wheel, get_platform from wheel.macosx_libfile import calculate_macosx_platform_tag -# Keep in sync with pyproject.toml and update SHA-256 hashes accordingly - -# read Hugo version from VERSION file -HUGO_VERSION = Path("HUGO_VERSION").read_text().strip() +# Has to be kept in sync with the version in python_hugo/cli.py +HUGO_VERSION = "0.121.1" HUGO_RELEASE = ( f"https://github.com/gohugoio/hugo/archive/refs/tags/v{HUGO_VERSION}.tar.gz" ) - # The pooch tool will download the tarball into the hugo_cache/ directory. # We will point the build command to that location to build Hugo from source HUGO_CACHE_DIR = "hugo_cache" -HUGO_SHA256 = Path("HUGO_CHECKSUM").read_text().strip() +HUGO_SHA256 = "fd16b6723365e2d60bef9dd2c0a12a0b046185b033973a85eae7e5979693b799" FILE_EXT = ".exe" if sys.platform == "win32" else "" # Normalise platform strings to match the Go toolchain @@ -300,7 +297,7 @@ def run(self): "python_hugo": [ f"binaries/hugo-{HUGO_VERSION}-{HUGO_PLATFORM}-{os.environ.get('GOARCH', HUGO_ARCH)}" + FILE_EXT - ] + ], }, include_package_data=True, entry_points={"console_scripts": ["hugo=python_hugo.cli:__call"]},