Skip to content

Commit

Permalink
🐍 Prepare for an initial release of python-hugo
Browse files Browse the repository at this point in the history
  • Loading branch information
agriyakhetarpal committed Jan 6, 2024
1 parent 7ec0e6e commit 6854fe1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 13 deletions.
1 change: 0 additions & 1 deletion HUGO_CHECKSUM

This file was deleted.

1 change: 0 additions & 1 deletion HUGO_VERSION

This file was deleted.

2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include licenses/LICENSE-hugo.txt
include HUGO_VERSION
include HUGO_CHECKSUM
include python_hugo/binaries/*
exclude python_hugo/binaries/hugo-*
3 changes: 1 addition & 2 deletions python_hugo/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
11 changes: 4 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"]},
Expand Down

0 comments on commit 6854fe1

Please sign in to comment.