Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 22 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: recursive

- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
Expand All @@ -34,6 +35,18 @@ jobs:
- name: Build source distribution
run: pipx run build --sdist --outdir dist/

- name: Check sdist size, fail if it exceeds 10 MiB
run: |
MAX_SIZE_MB=10
SDIST=$(ls dist/*.tar.gz)
SIZE=$(stat --format=%s "$SDIST")
SIZE_MB=$(awk "BEGIN {printf \"%.2f\", $SIZE / 1048576}")
echo "sdist size: ${SIZE_MB} MB"
if [ "$SIZE" -gt $((MAX_SIZE_MB * 1048576)) ]; then
echo "::error::sdist is ${SIZE_MB} MB, exceeding the ${MAX_SIZE_MB} MB limit"
exit 1
fi

- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: source_distribution
Expand All @@ -49,6 +62,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: recursive

- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
Expand Down Expand Up @@ -86,6 +100,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: recursive

- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
Expand Down Expand Up @@ -127,6 +142,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: recursive

- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
Expand Down Expand Up @@ -169,6 +185,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: recursive

- uses: pypa/cibuildwheel@298ed2fb2c105540f5ed055e8a6ad78d82dd3a7e # v3.3.1
with:
Expand Down Expand Up @@ -205,6 +222,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: recursive

- uses: pypa/cibuildwheel@298ed2fb2c105540f5ed055e8a6ad78d82dd3a7e # v3.3.1
with:
Expand Down Expand Up @@ -241,6 +259,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: recursive

- uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
with:
Expand Down Expand Up @@ -286,6 +305,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: recursive

- uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
with:
Expand Down Expand Up @@ -331,6 +351,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: recursive

- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
Expand Down Expand Up @@ -364,6 +385,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: recursive

- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: recursive

- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
Expand Down Expand Up @@ -58,6 +59,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: recursive

- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
Expand Down Expand Up @@ -118,6 +120,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: recursive

- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
Expand Down Expand Up @@ -207,6 +210,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: recursive

- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
Expand All @@ -217,6 +221,18 @@ jobs:
pipx run build --sdist --wheel . --outdir dist/
pipx run twine check dist/* --strict

- name: Check sdist size, fail if it exceeds 10 MiB
run: |
MAX_SIZE_MB=10
SDIST=$(ls dist/*.tar.gz)
SIZE=$(stat --format=%s "$SDIST")
SIZE_MB=$(awk "BEGIN {printf \"%.2f\", $SIZE / 1048576}")
echo "sdist size: ${SIZE_MB} MB"
if [ "$SIZE" -gt $((MAX_SIZE_MB * 1048576)) ]; then
echo "::error::sdist is ${SIZE_MB} MB, exceeding the ${MAX_SIZE_MB} MB limit"
exit 1
fi

- name: Build, inspect, and display contents of distributions
shell: bash
run: |
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/update-hugo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: recursive
- name: Check for new Hugo release, and apply updates
id: check-hugo-release
env:
Expand Down Expand Up @@ -60,7 +61,13 @@ jobs:
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\"/" hugo/cli.py
sed -i "s/HUGO_VERSION = \"$CURRENT_VERSION\"/HUGO_VERSION = \"$LATEST_VERSION\"/" src/hugo/cli.py

# Update the Hugo submodule to the new version tag
cd hugo
git fetch origin tag "v$LATEST_VERSION" --no-tags
git checkout "v$LATEST_VERSION"
cd ..

echo "updated=true" >> "$GITHUB_OUTPUT"
echo "latest_version=$LATEST_VERSION" >> "$GITHUB_OUTPUT"
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,13 @@ go.work
.DS_Store

# Binaries
hugo/binaries/*
src/hugo/binaries/*

# ruff cache
.ruff_cache/

# Hugo builder cache
hugo_cache/

# Generated stamp file for sdist builds
hugo/.hugo_commit_date
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "hugo"]
path = hugo
url = https://github.com/gohugoio/hugo.git
11 changes: 9 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
graft src/hugo
graft hugo

include LICENSE LICENSE-hugo.txt README.md CODE_OF_CONDUCT.md SECURITY.md pyproject.toml setup.py setup.cfg
exclude hugo/binaries/hugo-*
exclude src/hugo/binaries/hugo-*

global-exclude __pycache__ *.py[cod] *.so *.dylib .DS_Store .venv
# Exclude some files from the Hugo submodule that are too large that they
# inflate the sdist. They are not needed for building.
prune hugo/docs
prune hugo/testscripts
recursive-exclude hugo testdata/*

global-exclude __pycache__ *.py[cod] *.so *.dylib .DS_Store .venv .git
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ Windows users can use the [Chocolatey package manager](https://chocolatey.org/)
choco install mingw
```

Then, clone the repository and run the build script:
Then, clone the repository (with submodules) and run the build script:

```bash
git clone https://github.com/agriyakhetarpal/hugo-python-distributions@main
git clone --recurse-submodules 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
Expand Down
1 change: 1 addition & 0 deletions hugo
Submodule hugo added at d8c0df
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,14 @@ Issues = "https://github.com/agriyakhetarpal/hugo-python-distributions/issues"
Changelog = "https://github.com/agriyakhetarpal/hugo-python-distributions/releases"

[tool.setuptools.packages.find]
where = ["src"]
include = ["hugo", "hugo.*"]

[project.scripts]
hugo = "hugo.cli:__call"

[tool.ruff]
src = ["hugo"]
src = ["src"]
lint.extend-select = [
"B", # flake8-bugbear
"I", # isort
Expand Down
Loading
Loading