Skip to content

Commit d1bcf41

Browse files
Rename project from python-hugo to hugo
Closes #20
2 parents eb685b0 + 31e9fc3 commit d1bcf41

File tree

9 files changed

+59
-55
lines changed

9 files changed

+59
-55
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ go.work
174174
.DS_Store
175175

176176
# Binaries
177-
python_hugo/binaries/*
177+
hugo/binaries/*
178178

179179
# ruff cache
180180
.ruff_cache/

MANIFEST.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
include licenses/LICENSE-hugo.txt
2-
include python_hugo/binaries/*
3-
exclude python_hugo/binaries/hugo-*
2+
include hugo/binaries/*
3+
exclude hugo/binaries/hugo-*

README.md

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22

33
[actions-badge]: https://github.com/agriyakhetarpal/hugo-python-distributions/workflows/CI/badge.svg
44
[actions-link]: https://github.com/agriyakhetarpal/hugo-python-distributions/actions
5-
[pypi-link]: https://pypi.org/project/python-hugo/
6-
[pypi-platforms]: https://img.shields.io/pypi/pyversions/python-hugo/
7-
[pypi-version]: https://img.shields.io/pypi/v/python-hugo/
8-
[pypi-downloads-total]: https://img.shields.io/pypi/dd/python-hugo/
9-
[pypi-downloads-monthly]: https://img.shields.io/pypi/dm/python-hugo/
10-
[license-badge]: https://img.shields.io/pypi/l/python-hugo?color=lavender
5+
[pypi-link]: https://pypi.org/project/hugo/
6+
[pypi-platforms]: https://img.shields.io/pypi/pyversions/hugo/
7+
[pypi-version]: https://img.shields.io/pypi/v/hugo/
8+
[pypi-downloads-total]: https://static.pepy.tech/badge/hugo/
9+
[pypi-downloads-monthly]: https://static.pepy.tech/badge/hugo/month/
10+
[license-badge]: https://img.shields.io/pypi/l/hugo?color=lavender
1111
[license-link]: https://apache.org/licenses/LICENSE-2.0
1212
[hugo-badge]: https://img.shields.io/badge/hugo-extended-pink.svg?style=flat&logo=hugo
1313
[hugo-link]: https://gohugo.io/
1414
[docs-link]: https://github.com/agriyakhetarpal/hugo-python-distributions/
1515
[docs-badge]: https://img.shields.io/badge/docs-read%20on%20GitHub-blue.svg?style=flat&logo=github
1616

17+
1718
| Classifiers | Description |
1819
| ------ | ----------- |
1920
| Builds | [![Actions Status][actions-badge]][actions-link] |
@@ -22,32 +23,22 @@
2223

2324
Binaries for the extended version of the Hugo static site generator, installable via `pip`
2425

25-
This package provides wheels for [Hugo](https://gohugo.io/) to be used with `pip` on macOS, Linux, and Windows; for Python versions 3.8–3.12.
26+
This package provides wheels for [Hugo](https://gohugo.io/) so that it can be used with `pip` on macOS, Linux, and Windows; for Python versions 3.8–3.12.
2627

2728
## What is Hugo?
2829

2930
[Hugo](https://gohugo.io/) is a static site generator written in [Go](https://golang.org/). It is designed to be fast and flexible, and it is used by many people and organizations for their websites, documentation, and personal blogs.
3031

31-
## What version of `python-hugo` do I install?
32-
33-
This package, `python-hugo` is versioned separately and will adhere to an [amalgamation](https://jacobtomlinson.dev/posts/2023/sometimes-i-regret-using-calver/) of [CalVer](https://calver.org/) (calendar versioning) and [SemVer](https://semver.org/) (semantic versioning) software standards, which is subject to change if deemed absolutely necessary. A release for `python-hugo` will be versioned as `YY.M.PATCH` where `YY` is the year, `M` is the month, and `PATCH` is the patch number of the release. For example, `31.8.2` shall be the release for `python-hugo` on August 2031, patch number 2. This is done to avoid confusion with the versioning of Hugo itself, which uses `SemVer` – but is likely versioned according to [0ver](https://0ver.org/) software standards based on their [versioning history](https://github.com/gohugoio/hugo/releases). A bump in the `python-hugo` version does not necessarily mean a bump in the Hugo version, and vice versa, but it is likely that a bump in the PATCH number of `python-hugo` will correspond to a new release of Hugo, as mentioned in the table below.
34-
35-
The version of `python-hugo` you install will correspond to a particular version of Hugo as listed in the following table in ascending order of `python-hugo` version.
36-
37-
<!-- NOTE: add versions to this table as we go along with releases. -->
38-
39-
| `python-hugo` version | Hugo (extended) version |
40-
| --------------------- | ------------------------------------------------------------------- |
41-
| `24.1.0` | [`0.121.1`](https://github.com/gohugoio/hugo/releases/tag/v0.121.1) |
42-
| `24.1.1` | [`0.121.2`](https://github.com/gohugoio/hugo/releases/tag/v0.121.2) |
32+
> [!NOTE]
33+
> This distribution of `Hugo` is currently not affiliated with the official `Hugo` project. Please refer to the [Hugo documentation](https://gohugo.io/documentation/) for more information on Hugo.
4334
44-
<!-- NOTE: add versions to this table as we go along with releases. -->
35+
## What version of `hugo` do I install?
4536

46-
If you would like to use any available version of Hugo, you don't need to worry about this and you can just install the latest version of `python-hugo` on PyPI.
37+
This package, `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](https://0ver.org/) software standards based on their [versioning history](https://github.com/gohugoio/hugo/releases).
4738

48-
If you would like to use a specific version of Hugo, you can install the corresponding version of `python-hugo` as listed in the table above.
39+
Binaries for `hugo` through these wheels are available for Hugo versions **0.121.2** and above. If you need an older version of `hugo` that is not available through this package, please consider using the [official Hugo binaries](https://github.com/gohugoio/hugo/releases).
4940

50-
Please refer to the section on [Supported platforms](#supported-platforms) for a list of `python-hugo`'s supported platforms and architectures. If it does, jump to the [Quickstart](#quickstart) section to get started.
41+
Please refer to the section on [Supported platforms](#supported-platforms) for a list of wheels available for supported platforms and architectures. If it does, jump to the [Quickstart](#quickstart) section to get started.
5142

5243
## Documentation
5344

@@ -57,20 +48,20 @@ Create a virtual environment and install the package (or install it globally on
5748

5849
```bash
5950
python -m virtualenv venv # (or your preferred method of creating virtual environments)
60-
pip install python-hugo
51+
pip install hugo
6152
```
6253

6354
This places a `hugo` executable in a `binaries` directory in your virtual environment and adds an entry point to it.
6455

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

6758
```bash
68-
python3.X -m pip install python-hugo # Unix
69-
py -m pip install python-hugo # Windows
59+
python3.X -m pip install hugo # Unix
60+
py -m pip install hugo # Windows
7061
```
7162

7263
> [!TIP]
73-
> It is a great idea to use [`pipx`](https://github.com/pypa/pipx) to install Hugo in an isolated location without having to create a virtual environment, which will allow you to use Hugo as a command-line tool without having to install it globally on your system. Please refer to the [`pipx` documentation](https://pipx.pypa.io/stable/) for more information.
64+
> It is a great idea to use [`pipx`](https://github.com/pypa/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. Please refer to the [`pipx` documentation](https://pipx.pypa.io/stable/) for more information.
7465
7566
Then, you can use the `hugo` commands as you would normally:
7667

@@ -79,24 +70,26 @@ hugo version
7970
hugo env --logLevel info
8071
```
8172

73+
and
74+
8275
```bash
8376
hugo new site mysite
8477
hugo --printI18nWarnings server
8578
# and so on
8679
...
8780
```
8881

89-
Virtual environments 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 [What version of `python-hugo` do I install?](#what-version-of-python-hugo-do-i-install) for more information):
82+
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?_](#what-version-of-hugo-do-i-install) for more information):
9083

9184
```bash
92-
pip install "python-hugo==24.1.1"
85+
pip install "hugo==0.121.2"
9386
```
9487

9588
For more information on using Hugo and its command-line interface, please refer to the [Hugo documentation](https://gohugo.io/documentation/) and [Hugo CLI documentation](https://gohugo.io/commands/).
9689

9790
### Supported platforms
9891

99-
A subset of the platforms supported by Hugo itself are supported by `python-hugo`. 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:
92+
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:
10093

10194
| Platform | Architecture | Supported |
10295
| -------- | --------------- | ------------------------------- |
@@ -179,8 +172,8 @@ This package is designed to be used in the following scenarios:
179172
- You want to use Hugo in a Python-based project, such as a static site generator that uses Hugo as a backend?
180173
- You want to test a new version of Hugo without having to install it globally on your system or affecting your existing Hugo installation
181174
- Python wheels allow for incredibly fast installation, in comparison to using other methods of installing Hugo such as system package managers
182-
- Easier updates to the latest version of Hugo through the use of the `pip install --upgrade python-hugo` command, and automatic updates if you use a package manager such as [Poetry](https://python-poetry.org/) or [PDM](https://pdm.fming.dev/) to manage your Python dependencies or a tool such as [pipx](https://pipxproject.github.io/pipx/) to manage your command-line tools
183-
- ...and so on
175+
- 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](https://python-poetry.org/) or [PDM](https://pdm.fming.dev/) to manage your Python dependencies or a tool such as [pipx](https://pipxproject.github.io/pipx/) to manage your command-line tools
176+
- ...and more!
184177

185178
#### (Known) limitations
186179

@@ -190,3 +183,8 @@ This package is designed to be used in the following scenarios:
190183
### Licensing
191184

192185
This project is licensed under the terms of the [Apache 2.0 license](LICENSE). Hugo is available under Apache 2.0 (see [the Hugo license](licenses/LICENSE-hugo.txt)) as well.
186+
187+
### Footnotes
188+
189+
- This project is currently not affiliated with the official Hugo project. Please refer to the [Hugo documentation](https://gohugo.io/documentation/) for more information on Hugo.
190+
- 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`.

python_hugo/__init__.py renamed to hugo/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"""
22
Copyright (c) 2023 Agriya Khetarpal. All rights reserved.
33
4-
python-hugo: Binaries for the Hugo static site generator, installable with pip
4+
hugo: Binaries for the Hugo static site generator, installable with pip
55
"""
66

77
from __future__ import annotations
88

9-
from python_hugo.cli import __call
9+
from hugo.cli import __call
1010

1111
# Hugo binary entry point caller
1212
if __name__ == "__main__":
File renamed without changes.

python_hugo/cli.py renamed to hugo/cli.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Copyright (c) 2023 Agriya Khetarpal. All rights reserved.
33
4-
python-hugo: Binaries for the Hugo static site generator, installable with pip
4+
hugo: Binaries for the Hugo static site generator, installable with pip
55
"""
66

77
from __future__ import annotations
@@ -44,16 +44,19 @@ def hugo_executable():
4444
)
4545

4646

47-
MESSAGE = f"Running Hugo {HUGO_VERSION} via python-hugo at {hugo_executable()}"
47+
MESSAGE = (
48+
f"Running Hugo {HUGO_VERSION} via hugo-python-distributions at {hugo_executable()}"
49+
)
4850

4951

5052
def __call():
5153
"""
5254
Hugo binary entry point. Passes all command-line arguments to Hugo.
5355
"""
54-
print(MESSAGE)
5556
if sysplatform == "win32":
5657
# execvp broken on Windows, use subprocess instead to not launch a new shell
58+
print(f"\033[95m{MESSAGE}\033[0m")
5759
check_call([hugo_executable(), *argv[1:]])
5860
else:
61+
print(f"\033[95m{MESSAGE}\033[0m")
5962
execvp(hugo_executable(), ["hugo", *argv[1:]])

pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["setuptools>=64", "pooch", "tqdm", "wheel==0.42.0"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
6-
name = "python-hugo"
6+
name = "hugo"
77
authors = [
88
{ name = "Agriya Khetarpal", email = "[email protected]" },
99
]
@@ -12,10 +12,9 @@ maintainers = [
1212
]
1313
description = "Binaries for the Hugo static site generator, installable with pip"
1414
readme = "README.md"
15-
version = "24.1.1"
1615
license = {text = "Apache License v2.0"}
1716
requires-python = ">=3.8,<3.13"
18-
dynamic = ["scripts"]
17+
dynamic = ["scripts", "version"]
1918
classifiers = [
2019
"Development Status :: 3 - Alpha",
2120
"Intended Audience :: Developers",
@@ -45,7 +44,7 @@ Issues = "https://github.com/agriyakhetarpal/hugo-python-distributions/issues"
4544
Changelog = "https://github.com/agriyakhetarpal/hugo-python-distributions/releases"
4645

4746
[tool.ruff]
48-
src = ["python_hugo"]
47+
src = ["hugo"]
4948
extend-select = [
5049
"B", # flake8-bugbear
5150
"I", # isort

scripts/ci/tools/macos/fuse_wheels.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,6 @@ def copy_if_universal(wheel_name, in_dir, out_dir):
5757
src_path = Path(out_dir) / wheel_name
5858
dest_path = Path(out_dir) / wheel_name_new
5959

60+
print(f"Renamed wheel {wheel_name} to {wheel_name_new}")
61+
6062
Path(src_path).rename(dest_path)

setup.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from setuptools.command.build_ext import build_ext
1313
from wheel.bdist_wheel import bdist_wheel, get_platform
1414

15-
# Has to be kept in sync with the version in python_hugo/cli.py
15+
# Has to be kept in sync with the version in hugo/cli.py and incantation of setup()
1616
HUGO_VERSION = "0.121.2"
1717
HUGO_RELEASE = (
1818
f"https://github.com/gohugoio/hugo/archive/refs/tags/v{HUGO_VERSION}.tar.gz"
@@ -90,13 +90,13 @@ def run(self):
9090
tar.extractall(path=HUGO_CACHE_DIR)
9191

9292
# The binary is put into GOBIN, which is set to the package directory
93-
# (python_hugo/binaries/) for use in editable mode. The binary is copied
93+
# (hugo/binaries/) for use in editable mode. The binary is copied
9494
# into the wheel afterwards
9595
# Error: GOBIN cannot be set if GOPATH is set when compiling for different
9696
# architectures, so we use the default GOPATH/bin as the place to copy
9797
# binaries from
9898
# os.environ["GOBIN"] = os.path.join(
99-
# os.path.dirname(os.path.abspath(__file__)), "python_hugo", "binaries"
99+
# os.path.dirname(os.path.abspath(__file__)), "hugo", "binaries"
100100
# )
101101
os.environ["CGO_ENABLED"] = "1"
102102
os.environ["GOPATH"] = os.path.abspath(HUGO_CACHE_DIR) # noqa: PTH100
@@ -159,12 +159,12 @@ def run(self):
159159
)
160160
original_name.rename(new_name)
161161

162-
# Copy the new_name file into a folder binaries/ inside python_hugo/
162+
# Copy the new_name file into a folder binaries/ inside hugo/
163163
# so that it is included in the wheel.
164164
# basically we are copying hugo-HUGO_VERSION-PLATFORM-ARCH into
165-
# python_hugo/binaries/ and creating the folder if it does not exist.
165+
# hugo/binaries/ and creating the folder if it does not exist.
166166

167-
binaries_dir = Path(__file__).parent / "python_hugo" / "binaries"
167+
binaries_dir = Path(__file__).parent / "hugo" / "binaries"
168168
if not binaries_dir.exists():
169169
binaries_dir.mkdir()
170170

@@ -262,7 +262,7 @@ def run(self):
262262
# into the wheel.
263263
hugo_binary = (
264264
Path(__file__).parent
265-
/ "python_hugo"
265+
/ "hugo"
266266
/ "binaries"
267267
/ (
268268
f"hugo-{HUGO_VERSION}-{HUGO_PLATFORM}-{os.environ.get('GOARCH', HUGO_ARCH)}"
@@ -284,7 +284,7 @@ def run(self):
284284
Extension(
285285
name="hugo.build",
286286
sources=[
287-
f"python_hugo/binaries/hugo-{HUGO_VERSION}-{HUGO_PLATFORM}-{os.environ.get('GOARCH', HUGO_ARCH)}"
287+
f"hugo/binaries/hugo-{HUGO_VERSION}-{HUGO_PLATFORM}-{os.environ.get('GOARCH', HUGO_ARCH)}"
288288
+ FILE_EXT
289289
],
290290
)
@@ -294,13 +294,15 @@ def run(self):
294294
"clean": Cleaner,
295295
"bdist_wheel": HugoWheel,
296296
},
297-
packages=["python_hugo", "python_hugo.binaries"],
297+
packages=["hugo", "hugo.binaries"],
298298
package_data={
299-
"python_hugo": [
299+
"hugo": [
300300
f"binaries/hugo-{HUGO_VERSION}-{HUGO_PLATFORM}-{os.environ.get('GOARCH', HUGO_ARCH)}"
301301
+ FILE_EXT
302302
],
303303
},
304304
include_package_data=True,
305-
entry_points={"console_scripts": ["hugo=python_hugo.cli:__call"]},
305+
entry_points={"console_scripts": ["hugo=hugo.cli:__call"]},
306+
# has to be kept in sync with the version in hugo/cli.py
307+
version=HUGO_VERSION,
306308
)

0 commit comments

Comments
 (0)