From c9b9449bca781139cf47764c652c2c257aa002da Mon Sep 17 00:00:00 2001 From: Jainal Gosaliya Date: Thu, 19 Mar 2026 14:52:45 -0400 Subject: [PATCH 1/3] Modernize dependencies: update cffi to 2.0.0 and setuptools-golang to 2.9.0 - Update cffi from ~=1.1 to >=2.0.0 - Update setuptools-golang from 2.7.0 to 2.9.0 Tested with Python 3.14 and Go 1.25.4. All 14 tests pass. Co-Authored-By: Claude Opus 4.5 --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 1b04f72..4facfe4 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ subprocess.call(["make", "so"], env=env) # Build the CFFI headers -subprocess.call(["pip", "install", "cffi~=1.1"], env=env) +subprocess.call(["pip", "install", "cffi>=2.0.0"], env=env) subprocess.call(["make", "ffi"], env=env) with open("pybluemonday/__init__.py", "r", encoding="utf8") as f: @@ -65,6 +65,6 @@ # I'm not sure what this value is supposed to be build_golang={"root": "github.com/ColdHeat/pybluemonday"}, ext_modules=[setuptools.Extension("pybluemonday/bluemonday", ["bluemonday.go"])], - setup_requires=["setuptools-golang==2.7.0", "cffi~=1.1"], - install_requires=["cffi~=1.1"], + setup_requires=["setuptools-golang==2.9.0", "cffi>=2.0.0"], + install_requires=["cffi>=2.0.0"], ) From 3a41b5abcc00acafe59dc8124f9abbef756c5a6c Mon Sep 17 00:00:00 2001 From: Jainal Gosaliya Date: Thu, 19 Mar 2026 15:02:46 -0400 Subject: [PATCH 2/3] Address PR feedback: use sys.executable for pip and bound cffi version - Use sys.executable -m pip instead of bare pip to ensure correct interpreter - Use subprocess.check_call to fail on install errors - Add upper bound to cffi version (>=2.0.0,<3) to prevent future breakage Co-Authored-By: Claude Opus 4.5 --- setup.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 4facfe4..e9378b1 100644 --- a/setup.py +++ b/setup.py @@ -2,6 +2,7 @@ import platform import setuptools import subprocess +import sys import re # Print out our uname for debugging purposes @@ -37,7 +38,7 @@ subprocess.call(["make", "so"], env=env) # Build the CFFI headers -subprocess.call(["pip", "install", "cffi>=2.0.0"], env=env) +subprocess.check_call([sys.executable, "-m", "pip", "install", "cffi>=2.0.0,<3"], env=env) subprocess.call(["make", "ffi"], env=env) with open("pybluemonday/__init__.py", "r", encoding="utf8") as f: @@ -65,6 +66,6 @@ # I'm not sure what this value is supposed to be build_golang={"root": "github.com/ColdHeat/pybluemonday"}, ext_modules=[setuptools.Extension("pybluemonday/bluemonday", ["bluemonday.go"])], - setup_requires=["setuptools-golang==2.9.0", "cffi>=2.0.0"], - install_requires=["cffi>=2.0.0"], + setup_requires=["setuptools-golang==2.9.0", "cffi>=2.0.0,<3"], + install_requires=["cffi>=2.0.0,<3"], ) From dbad8b6fe09e5a5adae13b91f76b0c4c37b0be7e Mon Sep 17 00:00:00 2001 From: Jainal Gosaliya Date: Thu, 19 Mar 2026 15:06:59 -0400 Subject: [PATCH 3/3] Add generated build artifacts to .gitignore Add bluemonday.c, bluemonday.h, and bluemonday.cpython-*.so to prevent accidentally committing generated files. Co-Authored-By: Claude Opus 4.5 --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 5073032..c0112cf 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,7 @@ pybluemonday/*.so .DS_Store bluemonday.o bluemonday.so +bluemonday.c +bluemonday.h +bluemonday.cpython-*.so .eggs \ No newline at end of file