Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
d031c07
Add template `meson.build`
agriyakhetarpal Apr 25, 2026
af44227
Delete setuptools-related files
agriyakhetarpal Apr 25, 2026
21577e7
Just make the binary "hugo" or "hugo.exe"
agriyakhetarpal Apr 25, 2026
4ae548f
Add Hugo version template + Python files
agriyakhetarpal Apr 25, 2026
7f805cb
Remove more setuptools metadata
agriyakhetarpal Apr 25, 2026
41a7b34
Add meson-python as build backend
agriyakhetarpal Apr 25, 2026
98540ae
Start script to build Hugo
agriyakhetarpal Apr 25, 2026
a25684e
Setup Zig, build Hugo, swap correct build date
agriyakhetarpal Apr 25, 2026
5533e50
Override meson-python for build backend
agriyakhetarpal Apr 25, 2026
9019d1b
Change location of Hugo cache storage
agriyakhetarpal Apr 25, 2026
f445608
Rename meson wrapper file
agriyakhetarpal Apr 25, 2026
1fb5b2d
Generate some cross files
agriyakhetarpal Apr 25, 2026
220b75c
Add config settings to use cross files + TODOs
agriyakhetarpal Apr 25, 2026
a7275ca
Fix path to build backend
agriyakhetarpal Apr 25, 2026
cb10e5e
Fix Hugo version update process
agriyakhetarpal Apr 25, 2026
0717760
Change submodule location
agriyakhetarpal Apr 25, 2026
76c8906
Delete wheel committed by error
agriyakhetarpal Apr 25, 2026
69c2715
Add submodule at new location
agriyakhetarpal Apr 25, 2026
f6d144d
Add a job to test editable installations
agriyakhetarpal Apr 25, 2026
cce6c65
Make the sdist smaller
agriyakhetarpal Apr 25, 2026
ba30349
Add use_zig mappings and Hugo custom_target
agriyakhetarpal Apr 25, 2026
42f441a
Update CLI paths for Hugo executable
agriyakhetarpal Apr 25, 2026
d0d09dc
Ignore generated version file
agriyakhetarpal Apr 25, 2026
a70288f
Try setting path to cross file
agriyakhetarpal Apr 25, 2026
e226c76
Stop meson-python from Windows internal libs check
agriyakhetarpal Apr 25, 2026
d361dd1
Test editable build with Python 3.14
agriyakhetarpal Apr 25, 2026
d414544
Point to generated cross files correctly
agriyakhetarpal Apr 25, 2026
4cef2a0
Fix win32 cross file + fix paths to cross files
agriyakhetarpal Apr 25, 2026
8c4ae9b
Try `github.workspace`
agriyakhetarpal Apr 25, 2026
f6e2f18
Work around Windows Meson cross file stuff...
agriyakhetarpal Apr 25, 2026
d15b18d
Fix lint
agriyakhetarpal Apr 25, 2026
0546e02
Try to resolve different Hugo executables
agriyakhetarpal Apr 25, 2026
943f122
Make editable session verbose
agriyakhetarpal Apr 25, 2026
3ce50f6
Fix Python 3.10 joinpath mess
agriyakhetarpal Apr 25, 2026
e34f372
Fix wrong zig-windows-amd64-to-arm64 wheel tag
agriyakhetarpal Apr 25, 2026
9a2f099
Try to make auditwheel happy
agriyakhetarpal Apr 26, 2026
dd20e6e
Force the platform tag in `get_platform_tag` to be correct
agriyakhetarpal Apr 26, 2026
d70881a
🪩 Automated fixes from https://pre-commit.ci
pre-commit-ci[bot] Apr 26, 2026
3150bcb
Merge branch 'main' into meson-python!
agriyakhetarpal Apr 26, 2026
202832a
Debug: try something
agriyakhetarpal Apr 26, 2026
3965988
Revert "Debug: try something"
agriyakhetarpal Apr 26, 2026
8d3d588
Revert "Try to make auditwheel happy"
agriyakhetarpal Apr 26, 2026
b0a80ac
Install binary to `datadir`, pick it using `sysconfig`
agriyakhetarpal Apr 26, 2026
d72d177
Update docs
agriyakhetarpal Apr 26, 2026
a2dba63
🪩 Automated fixes from https://pre-commit.ci
pre-commit-ci[bot] Apr 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
path: ./wheelhouse/*.whl
if-no-files-found: error

windows_arm64_wheels: # Not tested
windows_arm64_wheels: # TODO: for later: use windows-11-arm runners as they're available now
name: arm64-windows
runs-on: windows-latest
permissions:
Expand All @@ -108,21 +108,25 @@ jobs:
cache: false
check-latest: true

- name: Resolve Windows Meson cross file
id: meson-cross-file
shell: pwsh
run: |
$crossFile = (Resolve-Path (Join-Path $env:GITHUB_WORKSPACE 'meson_cross_files/windows-arm64.ini')).Path -replace '\\', '/'
"path=$crossFile" >> $env:GITHUB_OUTPUT

- name: Build binary distribution (wheel) on Windows (arm64)
# We need to use cibuildwheel because it has experimental support for cross-compiling
# to arm64 and setup-python does not have arm64 support on Windows right now
uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1
with:
package-dir: .
output-dir: wheelhouse
# Cross-compile for arm64 target via Zig toolchain
env:
USE_ZIG: "1"
GOOS: windows
GOARCH: arm64
CIBW_BUILD: "cp312-*"
CIBW_ARCHS_WINDOWS: ARM64
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
CIBW_CONFIG_SETTINGS_WINDOWS: "setup-args=--cross-file=${{ steps.meson-cross-file.outputs.path }}"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: delvewheel repair -w {dest_dir} {wheel}
CIBW_TEST_SKIP: "*-win_arm64"

Expand All @@ -149,21 +153,23 @@ jobs:
go-version: "1.26.1"
cache: false

# Note: cibuildwheel will manage installing 32-bit Python on Windows. We
# do not need to do that manually unless we use setup-python instead.
- name: Resolve Windows Meson cross file
id: meson-cross-file
shell: pwsh
run: |
$crossFile = (Resolve-Path (Join-Path $env:GITHUB_WORKSPACE 'meson_cross_files/windows-386.ini')).Path -replace '\\', '/'
"path=$crossFile" >> $env:GITHUB_OUTPUT

- name: Build binary distribution (wheel) on Windows (i686)
uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1
with:
package-dir: .
output-dir: wheelhouse
# Cross-compile for i686 target via Zig toolchain
env:
USE_ZIG: "1"
GOOS: windows
GOARCH: 386
CIBW_BUILD: "cp312-*"
CIBW_ARCHS_WINDOWS: x86
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
CIBW_CONFIG_SETTINGS_WINDOWS: "setup-args=--cross-file=${{ steps.meson-cross-file.outputs.path }}"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: delvewheel repair -w {dest_dir} {wheel}
CIBW_TEST_COMMAND: |
hugo version
Expand Down
72 changes: 53 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,42 @@ jobs:
- name: Run style checks
uses: j178/prek-action@53276d8b0d10f8b6672aa85b4588c6921d0370cc # v2.0.1

editable_install:
needs: [style]
name: editable-install-smoke
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: recursive

- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.14"

- name: Set up Go toolchain
id: setup-go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: "1.26.1"
cache: false
check-latest: true

- name: Restore Hugo builder cache
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: ~/.cache/hugo-go
key: editable-install-hugo-${{ runner.os }}-${{ steps.setup-go.outputs.go-version }}

- name: Install Python dependencies
run: python -m pip install nox[uv]

- name: Smoke test editable install entry points
run: nox -s editable

build_wheels:
needs: [style]
name: ${{ matrix.runs-on }}-python-${{ matrix.python-version }}
Expand Down Expand Up @@ -79,7 +115,7 @@ jobs:
- name: Restore Hugo builder cache
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: ./hugo_cache/
path: ~/.cache/hugo-go
key: ${{ matrix.runs-on }}-hugo-${{ steps.setup-go.outputs.go-version }}

- name: Install Python dependencies
Expand Down Expand Up @@ -136,40 +172,41 @@ jobs:
- name: Restore Hugo builder cache
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: ./hugo_cache/
path: ~/.cache/hugo-go
key: zig-${{ matrix.runs-on }}-${{ matrix.architecture}}-hugo-experimental-${{ steps.setup-go.outputs.go-version }}

- name: Install Python dependencies
run: python -m pip install build virtualenv nox auditwheel

- name: Build binary distribution (wheel) on Linux
if: matrix.runs-on == 'ubuntu-latest'
# Cross-compile for arm64 target via Zig toolchain
env:
USE_ZIG: 1
GOOS: linux
GOARCH: arm64
run: |
python -m build --wheel . --outdir wheelhouse/
run: python -m build --wheel . --outdir wheelhouse -Csetup-args=--cross-file="$GITHUB_WORKSPACE/meson_cross_files/linux-arm64.ini"
# can't repair arm64 wheels on Linux x86_64 right now
# auditwheel repair --plat manylinux_2_28_aarch64 -w wheelhouse/ dist/*.whl

- name: Resolve Windows Meson cross file
if: matrix.runs-on == 'windows-latest'
id: meson-cross-file
shell: pwsh
env:
MATRIX_ARCH: ${{ matrix.architecture }}
run: |
$crossFileName = if ($env:MATRIX_ARCH -eq 'arm64') { 'windows-arm64.ini' } else { 'windows-386.ini' }
$crossFile = (Resolve-Path (Join-Path $env:GITHUB_WORKSPACE "meson_cross_files/$crossFileName")).Path -replace '\\', '/'
"path=$crossFile" >> $env:GITHUB_OUTPUT

- name: Build binary distribution (wheel) on Windows (arm64)
if: matrix.runs-on == 'windows-latest' && matrix.architecture == 'arm64'
# We need to use cibuildwheel because it has experimental support for cross-compiling
# to arm64 and setup-python does not have arm64 support on Windows right now
# TODO: FIXME: use windows-11-arm runners as they're available now, and drop this
uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1
with:
package-dir: .
output-dir: wheelhouse
# Cross-compile for arm64 target via Zig toolchain
env:
USE_ZIG: "1"
GOOS: windows
GOARCH: arm64
CIBW_BUILD: "cp312-*"
CIBW_ARCHS_WINDOWS: ARM64
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
CIBW_CONFIG_SETTINGS_WINDOWS: "setup-args=--cross-file=${{ steps.meson-cross-file.outputs.path }}"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: delvewheel repair -w {dest_dir} {wheel}
CIBW_TEST_SKIP: "*-win_arm64"

Expand All @@ -181,14 +218,11 @@ jobs:
with:
package-dir: .
output-dir: wheelhouse
# Cross-compile for i686 target via Zig toolchain
env:
USE_ZIG: "1"
GOOS: windows
GOARCH: 386
CIBW_BUILD: "cp312-*"
CIBW_ARCHS_WINDOWS: x86
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
CIBW_CONFIG_SETTINGS_WINDOWS: "setup-args=--cross-file=${{ steps.meson-cross-file.outputs.path }}"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: delvewheel repair -w {dest_dir} {wheel}
CIBW_TEST_COMMAND: |
hugo version
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/update-hugo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: |
set -euo pipefail

CURRENT_VERSION=$(grep -oP 'HUGO_VERSION = "\K[0-9.]+' setup.py)
CURRENT_VERSION=$(grep -oP "version\s*:\s*'\K[0-9.]+" meson.build)
echo "Current version: $CURRENT_VERSION"

# Find the next Hugo release after our current version
Expand Down Expand Up @@ -60,8 +60,7 @@ jobs:
RELEASE_TYPE="patch"
fi

sed -i "s/HUGO_VERSION = \"$CURRENT_VERSION\"/HUGO_VERSION = \"$LATEST_VERSION\"/" setup.py
sed -i "s/HUGO_VERSION = \"$CURRENT_VERSION\"/HUGO_VERSION = \"$LATEST_VERSION\"/" src/hugo/cli.py
sed -i "s/version\s*:\s*'$CURRENT_VERSION'/version : '$LATEST_VERSION'/" meson.build

# Update the Hugo submodule to the new version tag
cd hugo
Expand All @@ -88,7 +87,7 @@ jobs:
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/$GITHUB_REPOSITORY"
git checkout -b "update-hugo-v${LATEST_VERSION}"
git add setup.py src/hugo/cli.py hugo
git add meson.build hugo
git commit -m "Update Hugo to v${LATEST_VERSION}"
git push origin "update-hugo-v${LATEST_VERSION}"
gh pr create \
Expand Down
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ src/hugo/binaries/*
# Hugo builder cache
hugo_cache/

# Hugo version file
hugo/VERSION

# Documentation
/docs/public
/docs/resources
*.lock

# Generated stamp file for sdist builds
hugo/.hugo_commit_date
hugo-src/.hugo_commit_date

# Generated by meson configure_file
src/hugo/_version.py
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "hugo"]
path = hugo
path = hugo-src
url = https://github.com/gohugoio/hugo.git
14 changes: 0 additions & 14 deletions MANIFEST.in

This file was deleted.

Loading
Loading