Package: hugo
hugo-python-distributionsClassifiersDescriptionBuildsPackageMetaBinaries for the extended version of the Hugo static site generator, installable viapipThis package provides wheels forHugoso that it can be used withpipon macOS, Linux, and Windows; for Python versions 3.8–3.12.[!WARNING]
Owing to the limitations of overall sizing available on PyPI forhugo, only the most recent (up to nine or ten) versions of Hugo are available for download throughpip. If you need an older version of Hugo, please consider using the wheels that have been uploaded to theGitHub releasespage or theofficial Hugo binaries.What is Hugo?Hugois a static site generator written inGo. 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 ofHugois currently not affiliated with the officialHugoproject. Please refer to theHugo documentationfor more information on Hugo.What version ofhugodo I install?This package,hugois versioned alongside the Hugo releases and is aligned with the versioning of Hugo itself, which usesSemVer– but is likely versioned according to0versoftware standards based on theirversioning history.Binaries forhugothrough these wheels are available for Hugo versions0.121.2and above. If you need an older version ofhugothat is not available through this package, please consider using theofficial Hugo binaries.Please refer to the section onSupported platformsfor a list of wheels available for supported platforms and architectures. If it does, jump to theQuickstartsection to get started.DocumentationQuickstartCreate a virtual environment and install the package (or install it globally on your system):python-mvirtualenvvenv# (or your preferred method of creating virtual environments)pipinstallhugoThis places ahugoinstallation with an executable in your virtual environment and adds an entry point to it in your virtual environment'sbindirectory. You can use thehugocommand as you would normally:hugoversion
hugoenv--logLevelinfoAlternatively, you can install the package globally on your system:python3.X-mpipinstallhugo# Unixpy-mpipinstallhugo# Windows[!TIP]
It is a great idea to usepipxto 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.,pipxinstallhugo# install and run Hugo through pipxorpipxrunhugo==0.121.2# run a specific version of Hugo through pipx, even if a different version is installed in whatever environment you are inPlease refer to thepipxdocumentationfor more information.Then, you can use thehugocommands as you would normally:hugoversion
hugoenv--logLevelinfoandhugonewsitemysite
hugo--printI18nWarningsserver# 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 sectionWhat version ofhugodo I install?for more information):pipinstall"hugo==0.121.2"For more information on using Hugo and its command-line interface, please refer to theHugo documentationandHugo CLI documentation.Supported platformsA subset of the platforms supported by Hugo itself are supported by these wheels forhugoviahugo-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:PlatformArchitectureSupportedmacOSx86_64 (Intel)✅macOSarm64 (Silicon)✅Linuxamd64✅Linuxarm64✅Windowsx86_64✅Windowsarm64💡 Probable[^3]Windowsi686❌ Will not receive support[^1]DragonFlyBSDamd64❌ Will not receive support[^2]FreeBSDamd64❌ Will not receive support[^2]OpenBSDamd64❌ Will not receive support[^2]NetBSDamd64❌ Will not receive support[^2]Solarisamd64❌ Will not receive support[^2][^1]: Windows 32-bit support is possible to include, but hasn't been included due to the diminishing popularity of i686 instruction set-based systems and the lack of resources to test and build for it. If you need support for Windows 32-bit, please consider either using the official Hugo binaries or compiling fromHugoReleaser.
[^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 theofficial Hugo binaries[^3]: Support for Windows ARM64 is possible to include, butcibuildwheelsupport for it is currently experimental. Hugo does not officially support Windows ARM64 at the moment, but it should be possible to build from source for it and can receive support in the future through this package.Building from sourceBuilding the extended version of Hugo from source requires the following dependencies:TheGotoolchainTheGitversion control systemA C/C++ compiler, such asGCCorClangWindows users can use theChocolatey package managerin order to use theMinGW compiler. After installing Chocolatey, run the following command in an elevated terminal prompt:chocoinstallmingwThen, clone the repository and run the build script:gitclonehttps://github.com/agriyakhetarpal/hugo-python-distributions@main
python-mvenvvenvsourcevenv/bin/activate# on Unix-based systemsvenv\Scripts\activate.bat# on Windowspipinstall-e.# editable installationpipinstall.# regular installationCross-compiling for different architectures[!NOTE]
This functionality is implemented just for macOS at the moment, but it can be extended to other platforms as well in the near future.This package is capable of cross-compiling Hugo binaries for the same platform but different architectures and it can be used as follows.Say, on an Intel-based (x86_64) macOS machine:exportGOARCH="arm64"pipinstall.# 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 thetargetIntel-based (x86_64) macOS platform on thehostApple Silicon-based (arm64) macOS machine, you can use the following command:exportGOARCH="amd64"pipinstall.# or pip install -e .BackgroundBinaries for the Hugo static site generator are available for download from theHugo 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 package provides wheels for Hugo to be used withpipon 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 casesThis package 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 binariesYou 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 reasonYou 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 installationPython wheels allow for incredibly fast installation, in comparison to using other methods of installing Hugo such as system package managersEasy updates to the latest version of Hugo through the use of thepip install --upgrade hugocommand, and automatic updates possible too if you use a package manager such asPoetryorPDMto manage your Python dependencies or a tool such aspipxto manage your command-line tools...and more!(Known) limitationsIt is difficult to provide wheels for all platforms and architectures (seeSupported platforms), so this package 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 theBuilding from sourcesection or consider using theofficial Hugo binariesfor your purpose.This package 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 package to provide one. If you need a Python API for Hugo, please refer to theHugo documentationfor further resources on how to use Hugo programmatically as needed.LicensingThis project is licensed under the terms of theApache 2.0 license. Hugo is available under Apache 2.0 (seethe Hugo license) as well.FootnotesThis project is currently not affiliated with the official Hugo project. Please refer to theHugo documentationfor more information on Hugo.The author of this project: @agriyakhetarpal, would like to express a token of gratitude to the owner of theHugopackage 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.