Skip to main content

Binaries for the 'extended + withdeploy' edition of the Hugo static site generator, installable with pip

Project description

hugo-python-distributions

Classifiers Description
Builds Actions Status for CI Actions status for CD pre-commit.ci status
Package PyPI version PyPI - Python Version Downloads Downloads per month Downloads
Meta License Hugo version Documentation pre-commit Ruff

Binaries for the extended + withdeploy edition of the Hugo static site generator, installable via pip

This project provides wheels for Hugo so that it can be used with pip on macOS, Linux, and Windows; for Python 3.9 and later.

[!NOTE] Only the latest, stable, and to-be EOL Python versions are tested regularly. If you encounter any issues with the package on a specific Python version, please feel free to open an issue.

What is Hugo?

Hugo is a static site generator written in Go. It is designed to be fast and flexible, and it is used by many people and organizations for their websites, documentation, and personal blogs.

[!NOTE] This distribution of Hugo is currently not affiliated with the official Hugo project. Please refer to the Hugo documentation for more information on Hugo.

What version of hugo do I install?

This project, hugo is versioned alongside the Hugo releases and is aligned with the versioning of Hugo itself, which uses SemVer – but is likely versioned according to 0ver software standards based on their versioning history.

Binaries for hugo through these wheels are available for Hugo versions 0.121.2 and above, through PyPI or through releases on GitHub. If you need an older version of hugo that is not available through this package, please consider using the official Hugo binaries.

Please refer to the section on Supported platforms for a list of wheels available for supported platforms and architectures. If it does, jump to the Quickstart section to get started.

[!WARNING] Owing to the limitations of overall sizing available on PyPI for hugo, only the most recent versions of Hugo are available for download through pip, and older versions of these wheels will be deleted to make space for newer releases. If you need an older version of Hugo, please consider using the wheels that have been uploaded to the GitHub releases page or the official Hugo binaries. The former can be done via pip by downloading the .whl file, or through pipx using the URL directly (recommended). For example, if you need Hugo 0.122.0, you can run pipx install "https://github.com/agriyakhetarpal/hugo-python-distributions/releases/download/v0.122.0/hugo-0.122.0-cp311-cp311-win_amd64.whl" to download and install the wheel for Hugo 0.122.0 on Windows for Python 3.11.

Documentation

Quickstart

Create a virtual environment and install the package (or install it globally on your system):

python -m virtualenv venv  # (or your preferred method of creating virtual environments)
pip install hugo

This places a hugo installation with an executable in your virtual environment and adds an entry point to it in your virtual environment's bin directory. You can use the hugo command as you would normally:

hugo version
hugo env --logLevel info

Alternatively, you can install the package globally on your system:

python3.X -m pip install hugo  # Unix
py -m pip install hugo         # Windows

[!TIP] It is a great idea to use pipx to install or use Hugo in an isolated location without having to create a virtual environment, which will allow you to run Hugo as a command-line tool without having to install it globally on your system. i.e.,

pipx install hugo      # install and run Hugo through pipx

or

pipx run hugo==0.121.2 # run a specific version of Hugo through pipx, even if a different version is installed in whatever environment you are in

Please refer to the pipx documentation for more information.

Then, you can use the hugo commands as you would normally:

hugo version
hugo env --logLevel info

and

hugo new site mysite
hugo --printI18nWarnings server
# and so on
...

Standard virtual environments can allow multiple versions of Hugo to be installed and used side-by-side. To use a specific version of Hugo, you can specify the version when installing the package (please refer to the section What version of hugo do I install? for more information):

pip install "hugo==0.X.Y"

For more information on using Hugo and its command-line interface, please refer to the Hugo documentation and Hugo CLI documentation.

Supported platforms

A subset of the platforms supported by Hugo itself are supported by these wheels for hugo via hugo-python-distributions. The plan is to support as many platforms as possible with Python wheels and platform tags. Please refer to the following table for a list of supported platforms and architectures:

Platform Architecture Support
macOS x86_64 (Intel) ✅ macOS 10.13 (High Sierra) and later
macOS arm64 (Silicon) ✅ macOS 11.0 (Big Sur) and later
Linux amd64 ✅ glibc 2.24 and later
Linux arm64 ✅ glibc 2.24 and later
Linux s390x ✅ glibc 2.17 and later
Linux ppc64le ✅ glibc 2.17 and later
Windows x86_64
Windows arm64 ✅💡 Experimental support [^1]
Windows x86 ✅💡 Experimental support [^1]
DragonFlyBSD amd64 ❌ Will not receive support[^2]
FreeBSD amd64 ❌ Will not receive support[^2]
OpenBSD amd64 ❌ Will not receive support[^2]
NetBSD amd64 ❌ Will not receive support[^2]
Solaris amd64 ❌ Will not receive support[^2]

[^1]: Support for 32-bit (i686) and arm64 architectures on Windows is made possible through the use of the Zig compiler toolchain that uses the LLVM ecosystem. These wheels are experimental owing to the use of cross-compilation and may not be stable or reliable for all use cases, and are not officially supported by the Hugo project at this time. Hence, while these are published to PyPI for general availability, they are considered experimental. Please refer to the Building from source section for more information on how to build Hugo for these platforms and architectures locally. If you need official support for these platforms or face any bugs, please consider contacting the Hugo authors by [https://github.com/gohugoio/hugo/issues/new](opening an issue).

[^2]: Support for these platforms is not possible to include because of i. the lack of resources to test and build for them and ii. the lack of support for these platform specifications in Python packaging standards and tooling. If you need support for these platforms, please consider downloading the official Hugo binaries for their non-extended editions.

Building from source

Building the extended + withdeploy edition of Hugo from source requires the following dependencies:

  • The Go toolchain
  • The Git version control system
  • A C/C++ compiler, such as GCC or Clang

Windows users can use the Chocolatey package manager in order to use the MinGW compiler. After installing Chocolatey, run the following command in an elevated terminal prompt:

choco install mingw

Then, clone the repository and run the build script:

git clone https://github.com/agriyakhetarpal/hugo-python-distributions@main
python -m venv venv
source venv/bin/activate      # on Unix-based systems
venv\Scripts\activate.bat     # on Windows
pip install -e .              # editable installation
pip install .                 # regular installation

Cross-compiling for different architectures

[!NOTE] Cross-compilation is experimental and may not be stable or reliable for all use cases. If you encounter any issues with cross-compilation, please feel free to open an issue.

This project is capable of cross-compiling Hugo binaries for various platforms and architectures and it can be used as follows. Cross-compilation is provided for the following platforms:

  1. macOS; for the arm64 and amd64 architectures via the Xcode toolchain,
  2. Linux; for the arm64, amd64, s390x, and ppc64le architectures via the Zig toolchain, and
  3. Windows; for the amd64, arm64, and x86 architectures via the Zig toolchain.

Please refer to the examples below for more information on how to cross-compile Hugo for different architectures:

macOS

Say, on an Intel-based (x86_64) macOS machine:

export GOARCH="arm64"
pip install .  # or pip install -e .

This will build a macOS arm64 binary distribution of Hugo that can be used on Apple Silicon-based (arm64) macOS machines. To build a binary distribution for the target Intel-based (x86_64) macOS platform on the host Apple Silicon-based (arm64) macOS machine, you can use the following command:

export GOARCH="amd64"
pip install .  # or pip install -e .
Linux

First, install Zig on your Linux machine, and set the USE_ZIG, GOOS, and GOARCH environment variable prior to installing the package:

Say, on an amd64 Linux machine:

export USE_ZIG="1"
export GOOS="linux"
export GOARCH="arm64"
pip install .  # or pip install -e .

will cross-compile a Linux arm64 binary distribution of Hugo that can be used on the targeted arm64 Linux machines. To build a binary distribution for the target amd64 Linux platform on the host arm64 Linux machine, set the targets differently:

export USE_ZIG="1"
export GOOS="linux"
export GOARCH="amd64"
pip install .  # or pip install -e .

This creates dynamic linkage for the built Hugo binary with a system-provided GLIBC. If you wish to statically link the binary with MUSL, change the CC and CXX environment variables as follows:

export CC="zig cc -target x86_64-linux-musl"
export CXX="zig c++ -target x86_64-linux-musl"

Linkage against MUSL is not tested in CI at this time, but it should work in theory. The official Hugo binaries do not link against MUSL for a variety of reasons including but not limited to the size of the binary and the popularity of the GLIBC C standard library and its conventions.

Windows

First, install Zig on your Windows machine, and set these environment variables prior to installing the package:

Say, on an amd64 Windows machine:

set USE_ZIG="1"
set GOOS="windows"
set GOARCH="arm64"
pip install .  # or pip install -e .

will cross-compile a Windows arm64 binary distribution of Hugo that can be used on the targeted arm64 Windows machines (note the use of set instead of export on Windows), and so on for the x86 architecture:

set USE_ZIG="1"
set GOOS="windows"
set GOARCH="386"
pip install .  # or pip install -e .

For a list of supported distributions for Go, please run the go tool dist list command on your system. For a list of supported targets for Zig, please refer to the Zig documentation for more information or run the zig targets command on your system.

[!TIP] Cross-compilation for a target platform and architecture from a different host platform and architecture is also possible, but it remains largely untested at this time. Currently, the Zig compiler toolchain is known to work for cross-platform, cross-architecture compilation.

Background

Binaries for the Hugo static site generator are available for download from the Hugo releases page. These binaries have to be downloaded and placed in an appropriate location on the system manually and the PATH environment variable has to be updated to include said location.

This project provides wheels for Hugo to be used with pip on macOS, Linux, and Windows. This allows Hugo to be installed and used in a virtual environment, which allows multiple versions of Hugo to be installed and used side-by-side in different virtual environments, where Hugo can be used as a command-line tool (a Python API is not provided at this time given the lack of such a demand for it).

Use cases

This project is designed to be used in the following scenarios:

  • You want to use Hugo as a command-line tool, but you don't want it to be installed globally on your system or do not have the necessary permissions to do so.
  • You cannot or do not want to use the official Hugo binaries
  • You want to use Hugo in a virtual environment that is isolated from the rest of your system – this also allows you to install and use multiple versions of Hugo side-by-side if needed for any reason
  • You want to use Hugo in a Python-based project, such as a static site generator that uses Hugo as a backend?
  • You want to test a new version of Hugo without having to install it globally on your system or affecting your existing Hugo installation
  • Python wheels allow for incredibly fast installation, in comparison to using other methods of installing Hugo such as system package managers
  • Easy updates to the latest version of Hugo through the use of the pip install --upgrade hugo command, and automatic updates possible too if you use a package manager such as Poetry or PDM to manage your Python dependencies or a tool such as pipx to manage your command-line tools
  • ...and more!

(Known) limitations

  • It is difficult to provide wheels for all platforms and architectures (see Supported platforms), so this project only provides wheels for the most common ones—those supported by Python platform tags, packaging standards and tooling—it is not reasonable to do so and provide releases for other platforms owing to the limited resources available on CI systems, in this case, GitHub Actions runners. For extra platforms and architectures, please refer to the Building from source section or consider using the official Hugo binaries for your purpose.
  • This project does not provide a Python API for Hugo, it just wraps its own command-line interface. The packaging infrastructure for this Python package is not designed to provide a Python API for Hugo, and it is not the goal of this project to provide one. If you need a Python API for Hugo, please refer to the Hugo documentation for further resources on how to use Hugo programmatically as needed.

Licensing

This project is licensed under the terms of the Apache 2.0 license. Hugo is available under Apache 2.0 (see the Hugo license) as well.

Security

Please refer to the Security policy for this project for more information.

Code of Conduct

This repository aims to follow the Hugo project in striving to provide a welcoming and inclusive environment for all contributors, regardless of their background and identity. Please refer to the Code of Conduct for more information that applies to all interactions in this repository and its associated spaces. It is reliant on the Contributor Covenant for its guidelines and conforms to version 2.1.

For requesting help, reporting bugs, or requesting features that are specific to Hugo's functionalities, please refer to the Hugo Discourse forum. For requesting help for hugo-python-distributions, please feel free to open an issue in this repository.

Footnotes

  • This project is currently not affiliated with the official Hugo project. Please refer to the Hugo documentation for more information on Hugo.
  • The author of this project: @agriyakhetarpal, would like to express a token of gratitude to the owner of the Hugo package on PyPI (@nariman) for their kind gesture of granting access to take over the package name with the underlying provisions of PEP 541. This way, it allows users to install the package using the same name as the official Hugo project, which undoubtedly provides for a better user experience and convenience to users of this package when compared to the previous package name, python-hugo.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hugo-0.139.1.tar.gz (28.5 kB view details)

Uploaded Source

Built Distributions

hugo-0.139.1-py3-none-win_arm64.whl (21.9 MB view details)

Uploaded Python 3 Windows ARM64

hugo-0.139.1-py3-none-win_amd64.whl (24.4 MB view details)

Uploaded Python 3 Windows x86-64

hugo-0.139.1-py3-none-win32.whl (22.4 MB view details)

Uploaded Python 3 Windows x86

hugo-0.139.1-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (23.6 MB view details)

Uploaded Python 3 manylinux: glibc 2.24+ x86-64 manylinux: glibc 2.28+ x86-64

hugo-0.139.1-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (21.6 MB view details)

Uploaded Python 3 manylinux: glibc 2.24+ ARM64 manylinux: glibc 2.28+ ARM64

hugo-0.139.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (23.0 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ s390x

hugo-0.139.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (20.8 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ ppc64le

hugo-0.139.1-py3-none-macosx_11_0_arm64.whl (22.3 MB view details)

Uploaded Python 3 macOS 11.0+ ARM64

hugo-0.139.1-py3-none-macosx_10_13_x86_64.whl (23.7 MB view details)

Uploaded Python 3 macOS 10.13+ x86-64

File details

Details for the file hugo-0.139.1.tar.gz.

File metadata

  • Download URL: hugo-0.139.1.tar.gz
  • Upload date:
  • Size: 28.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for hugo-0.139.1.tar.gz
Algorithm Hash digest
SHA256 7cc779067b2c41d8e997658d8929dd6d0f1ad5d91a1ee11a7f0f0576f7ba592d
MD5 515f7c79a4336881743e18d14c2ce687
BLAKE2b-256 d6d7a4b1483879fe93e806abd941788d6394a35a1ee59cdbc05ba0304d1381b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for hugo-0.139.1.tar.gz:

Publisher: cd.yml on agriyakhetarpal/hugo-python-distributions

Attestations:

File details

Details for the file hugo-0.139.1-py3-none-win_arm64.whl.

File metadata

  • Download URL: hugo-0.139.1-py3-none-win_arm64.whl
  • Upload date:
  • Size: 21.9 MB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for hugo-0.139.1-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 49cebb5d5955c8fe101cc1d44521b74181aabe3920aa058c9c90b50216d00b83
MD5 e56176125d750451d103b36813447fb3
BLAKE2b-256 02102003a43784f1d52824575067f84eb5be1a58a6f670a4b8b3ac1a30b219d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for hugo-0.139.1-py3-none-win_arm64.whl:

Publisher: cd.yml on agriyakhetarpal/hugo-python-distributions

Attestations:

File details

Details for the file hugo-0.139.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: hugo-0.139.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 24.4 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for hugo-0.139.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 47c4880143cf0d09c6704af2a6a8a477952a774ee20ac024f9b2f1cfacc76bf1
MD5 2cad9ad0401a7eca5d81d6ff8a2075a1
BLAKE2b-256 14fa53be0b9199cfb5276949cd2cbd6a37591528c66dca8fdc3bd77c522e4a5c

See more details on using hashes here.

Provenance

The following attestation bundles were made for hugo-0.139.1-py3-none-win_amd64.whl:

Publisher: cd.yml on agriyakhetarpal/hugo-python-distributions

Attestations:

File details

Details for the file hugo-0.139.1-py3-none-win32.whl.

File metadata

  • Download URL: hugo-0.139.1-py3-none-win32.whl
  • Upload date:
  • Size: 22.4 MB
  • Tags: Python 3, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for hugo-0.139.1-py3-none-win32.whl
Algorithm Hash digest
SHA256 3c39bf518eebe64e4f4e6d4cd953c4a447685e13f9b3dc303dfeea1781e87a71
MD5 b890b7e28627e70e493a170cff74f6b4
BLAKE2b-256 d314afe531478c5f893aa34d19796ed256e976d7418f8f888655e1280ffd0daa

See more details on using hashes here.

Provenance

The following attestation bundles were made for hugo-0.139.1-py3-none-win32.whl:

Publisher: cd.yml on agriyakhetarpal/hugo-python-distributions

Attestations:

File details

Details for the file hugo-0.139.1-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for hugo-0.139.1-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6ccb53767cc856038d1ec6f065cb339eb838947aa5c878c52816e6b5b0e9dc7b
MD5 b9d826935b7c96e98834fcb7e4fd307a
BLAKE2b-256 7ea0c8f1d164e798da044574d9aba48a6b9eda552c7922a23a8e8c9e6df97daa

See more details on using hashes here.

Provenance

The following attestation bundles were made for hugo-0.139.1-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: cd.yml on agriyakhetarpal/hugo-python-distributions

Attestations:

File details

Details for the file hugo-0.139.1-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for hugo-0.139.1-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8ccbfb23cbc36926584ea731e7d03868702ef8dd8edc5950a706106d316311c8
MD5 ab57149f0e9fb3e3b2c3e621c834a0bb
BLAKE2b-256 e9e6e4ab122e86b6e8aac99cf37e7c006b012ccec811444c436a6d7bf66284bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for hugo-0.139.1-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl:

Publisher: cd.yml on agriyakhetarpal/hugo-python-distributions

Attestations:

File details

Details for the file hugo-0.139.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for hugo-0.139.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 602a5db064a57af27b55ef4793e7c82eb768b5cf0775a08fd7e2c761a76e8cae
MD5 ca91ef86549136b6a8ca0588bc229fba
BLAKE2b-256 671fdf81e17e37cc7a0ec03b9c06c49d00d06ffc5dc6d4ba088abe97ccaa787d

See more details on using hashes here.

Provenance

The following attestation bundles were made for hugo-0.139.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl:

Publisher: cd.yml on agriyakhetarpal/hugo-python-distributions

Attestations:

File details

Details for the file hugo-0.139.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for hugo-0.139.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 57730d3fe30585f592c4ac20387f252d3cece06e5df48de9ba11af0a38575acf
MD5 76b1bad9523da0b26afa2faf00b93340
BLAKE2b-256 e591072fd46ad49d4f24b54c217fa6acfb5149e99934f029b82ba42a51691cd4

See more details on using hashes here.

Provenance

The following attestation bundles were made for hugo-0.139.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl:

Publisher: cd.yml on agriyakhetarpal/hugo-python-distributions

Attestations:

File details

Details for the file hugo-0.139.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for hugo-0.139.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7e2e1a63e67cde7b941b3a0fc6e4d2fb7f9a4677abce464abd06701418802e8b
MD5 78bf1789199052efc943b03ee59665cc
BLAKE2b-256 1b42ea55b5336aa05ea3130499dc36f04b85d54b7a2d8f2e19757b232a2690f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for hugo-0.139.1-py3-none-macosx_11_0_arm64.whl:

Publisher: cd.yml on agriyakhetarpal/hugo-python-distributions

Attestations:

File details

Details for the file hugo-0.139.1-py3-none-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for hugo-0.139.1-py3-none-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 9922a616cbb724d610e22539d20e10a95e50545fbe9652485643274f8ff31ba2
MD5 1b96a37038e12d1140c29e8b3f16a0e5
BLAKE2b-256 414b9855a2e1da4cf88645043e0de6e9484f21a96257605d9dba86e24a322f8e

See more details on using hashes here.

Provenance

The following attestation bundles were made for hugo-0.139.1-py3-none-macosx_10_13_x86_64.whl:

Publisher: cd.yml on agriyakhetarpal/hugo-python-distributions

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page