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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ site-generated/
output/
pelican.auto.py
.DS_Store
.venv
2 changes: 0 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ repos:
- id: fix-byte-order-marker
- id: forbid-submodules
- id: mixed-line-ending
- id: requirements-txt-fixer
files: ^requirements\.txt$
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
exclude: (\.svg$)
Expand Down
23 changes: 23 additions & 0 deletions .pre-commit-light.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
exclude: ^node_modules/
repos:
- repo: local
hooks:
- id: ruff
name: Ruff Linter
entry: ruff check --fix
language: system
types: [python]

- id: ruff-format
name: Ruff Formatter
entry: ruff format --force-exclude
language: system
types: [python]

- id: pyright
name: Pyright Type Check
entry: pyright
language: system
require_serial: true
types: [python]
exclude: ^tests/
33 changes: 15 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
PYTHON ?= python3
PIP := $(PYTHON) -m pip
PRECOMMIT ?= pre-commit

.PHONY: install i check c checkinstall ci checkupdate cu help
.PHONY: check check-light sync sync-all update-deps
.DEFAULT_GOAL := help

install i: ## Install Python dependencies from requirements.txt
$(PIP) install -r requirements.txt
check: ## Run all pre-commit checks.
git add -A
uv run pre-commit run --all-files

check c: ## Run pre-commit checks on all files
$(PRECOMMIT) run --all-files
check-light: ## Run the light set of pre-commit checks.
git add -A
uv run pre-commit run --all-files --config .pre-commit-light.yaml

checkinstall ci: ## Install pre-commit hooks
$(PRECOMMIT) install
sync: ## Sync non-development dependencies using uv.
uv sync --no-dev

checkupdate cu: ## Update pre-commit hooks to the latest version
$(PRECOMMIT) autoupdate
sync-all: ## Sync all dependencies (including development) using uv.
uv sync --all-groups

help: ## Display this help message
@echo "Usage: make <target>"
@echo
@echo "Available targets:"
@grep -E '^[a-z]+ [a-z]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
update-deps: ## Update pre-commit hooks and dependency locks.
pre-commit autoupdate || :
uv lock --upgrade
uv sync --all-groups
93 changes: 51 additions & 42 deletions pelicanconf.py
Original file line number Diff line number Diff line change
@@ -1,71 +1,80 @@

import datetime

# Basic information about the site.
SITENAME = 'ASF Tooling Website'
SITEDESC = 'The official website of the ASF Tooling Team'
SITEDOMAIN = 'tooling.apache.org'
SITEURL = 'https://tooling.apache.org'
SITELOGO = 'https://tooling.apache.org//extras/favicon.ico'
SITEREPOSITORY = 'https://github.com/apache/tooling-docs/blob/main/content/'
SITENAME = "ASF Tooling Website"
SITEDESC = "The official website of the ASF Tooling Team"
SITEDOMAIN = "tooling.apache.org"
SITEURL = "https://tooling.apache.org"
SITELOGO = "https://tooling.apache.org//extras/favicon.ico"
SITEREPOSITORY = "https://github.com/apache/tooling-docs/blob/main/content/"
CURRENTYEAR = datetime.date.today().year
TRADEMARKS = 'Apache and the Apache feather logo are trademarks of The Apache Software Foundation.'
TIMEZONE = 'UTC'
TRADEMARKS = "Apache and the Apache feather logo are trademarks of The Apache Software Foundation."
TIMEZONE = "UTC"
# Theme includes templates and possibly static files
THEME = 'content/theme'
THEME = "content/theme"
# Specify location of plugins, and which to use
PLUGIN_PATHS = [ 'plugins', ]
PLUGIN_PATHS = [
"plugins",
]
# If the website uses any *.ezmd files, include the 'gfm' and 'asfreader' plugins (in that order)
PLUGINS = [ 'toc', 'spu', 'gfm', 'asfgenid', 'asfrun', ]
PLUGINS = [
"toc",
"spu",
"gfm",
"asfgenid",
"asfrun",
]
# All content is located at '.' (aka content/ )
PAGE_PATHS = [ 'pages' ]
STATIC_PATHS = [ '.', ]
PAGE_PATHS = ["pages"]
STATIC_PATHS = [
".",
]
# Where to place/link generated pages

PATH_METADATA = 'pages/(?P<path_no_ext>.*)\\..*'
PATH_METADATA = "pages/(?P<path_no_ext>.*)\\..*"

PAGE_SAVE_AS = '{path_no_ext}.html'
PAGE_SAVE_AS = "{path_no_ext}.html"
# Don't try to translate
PAGE_TRANSLATION_ID = None
# Disable unused Pelican features
# N.B. These features are currently unsupported, see https://github.com/apache/infrastructure-pelican/issues/49
FEED_ALL_ATOM = None
INDEX_SAVE_AS = ''
TAGS_SAVE_AS = ''
CATEGORIES_SAVE_AS = ''
AUTHORS_SAVE_AS = ''
ARCHIVES_SAVE_AS = ''
INDEX_SAVE_AS = ""
TAGS_SAVE_AS = ""
CATEGORIES_SAVE_AS = ""
AUTHORS_SAVE_AS = ""
ARCHIVES_SAVE_AS = ""
# Disable articles by pointing to a (should-be-absent) subdir
ARTICLE_PATHS = [ 'blog' ]
ARTICLE_PATHS = ["blog"]
# needed to create blogs page
ARTICLE_URL = 'blog/{slug}.html'
ARTICLE_SAVE_AS = 'blog/{slug}.html'
ARTICLE_URL = "blog/{slug}.html"
ARTICLE_SAVE_AS = "blog/{slug}.html"
# Disable all processing of .html files
READERS = { 'html': None, }
READERS = {
"html": None,
}

# Configure the asfgenid plugin
ASF_GENID = {
'unsafe_tags': True,
'metadata': False,
'elements': False,
'permalinks': False,
'tables': False,

'headings': False,


'toc': False,

'debug': False,
"unsafe_tags": True,
"metadata": False,
"elements": False,
"permalinks": False,
"tables": False,
"headings": False,
"toc": False,
"debug": False,
}





# Configure the asfrun plugin (finalization)
ASF_POSTRUN = [ '/bin/bash pagefind.sh', ]
ASF_POSTRUN = [
"/bin/bash pagefind.sh",
]


# Configure ignore files
# File and directory basenames matching any of these patterns will be ignored by the processor.
IGNORE_FILES = [ 'theme', ]
IGNORE_FILES = [
"theme",
]
29 changes: 29 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[project]
name = "tooling-docs"
version = "0.0.1"
description = "Internal meta project for Apache Tooling documentation and development tooling (not published)"
authors = [
{ name = "ASF Tooling", email = "dev@tooling.apache.org" }
]
license = "Apache-2.0"
readme = "README.md"
requires-python = "~=3.13.0"
dependencies = [
"beautifulsoup4",
"Markdown",
"pelican",
"requests"
]

[dependency-groups]
dev = [
"pre-commit>=2.20.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would (again) strongly suggest prek instead of pre-commit. The user experience and speed are incomparable, it uses uv to install loca virtualenv for example. There are already many serious players using prek https://github.com/j178/prek?tab=readme-ov-file#who-is-using-prek - and more every day.

If you anyway want to use pre-commit I would suggest to use pre-commit-uv to add here https://pypi.org/project/pre-commit-uv/ - this is a project that was developed by tox maintainers that is patching the pre-commit to use uv instead of pip to install local venvs for pre-commit hooks.

A bit of interesting context and examples of dramas in our ecosystem.

Unfortunatey the author of pre-commit (also author of flake8 and few other code quality tools) considers astral and uv as "bad players" who "stole his ideas" and implemented ruff from scratch replacing many other tools in python ecosystem rather than contribute back to his tools and refused to have uv as an installation option despite clear benefits (speed, caching, better reuse of installed binaries).

So tox maintainers implemented pre-commit-uv that patches installation of pre-commit and replaces pip install with uv pip install essentially.

Also just to add a little spice - the pre-commit author essentially threatened prek author j178/prek#73 and accused him (again) of stealing his ideas instead of contributing to his project, even if prek essentially was from-grounds-up rewrite in rust. Much more open to ideas of the pre-commit users, that the pre-commit author plainly refused to accept as contribution). for example auto-complete of hook names that is essentials for big users like Airflow.

We also have good relationship with prek author and he fixes issue in hours usually when we report them - and you should not be afraid of it's stability.

"pyright>=1.1.393",
"ruff>=0.9.4",
]

[tool.ruff]
line-length = 120
extend-exclude = [
"node_modules",
]
5 changes: 0 additions & 5 deletions requirements.txt

This file was deleted.

Loading