Skip to content

Instantly share code, notes, and snippets.

View hugovk's full-sized avatar

Hugo van Kemenade hugovk

View GitHub Profile
"""Regenerate the macOS installer screenshots used in Doc/using/mac.rst.
Walks the python.org macOS installer UI with System Events and captures
each screen with screencapture(1), writing the mac_installer_*.png files
into Doc/using/. Semi-automated: the admin password is entered by hand,
and any UI click that fails falls back to asking you to click it
yourself. The Finder (07) and Terminal certificate (08) screenshots
are not captured; take those by hand if needed.
Requirements:
@hugovk
hugovk / EuroPython-print.md
Last active July 11, 2026 11:46
EuroPython 2026 printable styles
@hugovk
hugovk / PyPI-names.md
Last active January 12, 2026 15:52
PyPI names, specs and versions
@hugovk
hugovk / prek-install.py
Last active September 14, 2025 15:30
Run "prek install" in all subdirectories with a .pre-commit-config.yaml
"""
uv run https://gist.github.com/hugovk/d601e651e08d229714a86fb5b04bc6c9
"""
import subprocess
from pathlib import Path
for directory in sorted(Path(".").iterdir(), key=lambda x: x.name.lower()):
if directory.is_dir() and (directory / ".pre-commit-config.yaml").is_file():
print(directory)
subprocess.run(
@hugovk
hugovk / singlehtml.md
Last active August 8, 2025 10:42
CPython singlehtml docs

CPython singlehtml docs

Built by adding this to Doc/Makefile:

.PHONY: singlehtml
singlehtml: BUILDER = singlehtml
singlehtml: build
	@echo "Build finished. The HTML page is in build/html."
@hugovk
hugovk / "sys.version\[0\] == ['\"]3['\"]".md
Created July 3, 2024 16:10
How often code checks sys.version[0] == '3' or sys.version_info[0] == 3
python3 ~/github/misc/cpython/search_pypi_top.py -q . "sys.version\[0\] == ['\"]3['\"]"
./Flask-RESTful-0.3.10.tar.gz: Flask-RESTful-0.3.10/docs/conf.py: elif sys.version[0] == '3':
./fastnumbers-5.1.0.tar.gz: fastnumbers-5.1.0/dev/patch_doctest.py: if sys.version[0] == "3":
./exhale-0.3.7.tar.gz: exhale-0.3.7/exhale/deploy.py: if sys.version[0] == "3":
./exhale-0.3.7.tar.gz: exhale-0.3.7/exhale/deploy.py: if sys.version[0] == "3":
./impyla-0.19.0.tar.gz: impyla-0.19.0/impala/tests/_dbapi20_tests.py: if sys.version[0] == '3': #under Python 3 StardardError no longer exists
./install-1.3.5.tar.gz: install-1.3.5/install/__init__.py: if sys.version[0] == '3':
./mercurial-6.7.4.tar.gz: mercurial-6.7.4/tests/test-narrow-clone-non-narrow-server.t: > if sys.version[0] == '3':
./pyroute2-0.7.12.tar.gz: pyroute2-0.7.12/pyroute2/common.py: if sys.version[0] == '3':
"""
Find the first PEP created after the last PEP created in the 3xxx range.
"""
import datetime as dt
import json
import urllib.request
with urllib.request.urlopen("https://peps.python.org/peps.json") as url:
peps = json.loads(url.read().decode())
@hugovk
hugovk / checklist.md
Last active May 17, 2024 22:38
PyCon US Challenge 2024

https://us.pycon.org/2024/about/pycon-us-challenge/

List of Challenges

1 POINT

  • you see features from Python 3.12+ in presentation slide
  • submit a PR to an open source Python project
  • take a selfie at The PSF booth
  • say thanks to an open source maintainer which project you use
  • give a lightning talk
@hugovk
hugovk / 1000.md
Created May 4, 2023 13:30
Output of `pypinfo --days 7 --limit 1000 numpy version file system`

Served from cache: False Data processed: 3.71 GiB Data billed: 3.71 GiB Estimated cost: $0.02

version file system_name download_count
1.21.6 numpy-1.21.6-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl Linux 5,544,509
1.24.3 numpy-1.24.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Linux 3,530,114
1.24.3 numpy-1.24.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Linux 2,459,540