Skip to content

Modernize dependencies: update cffi to 2.0.0 and setuptools-golang to 2.9.0#53

Open
jainal09 wants to merge 3 commits into
ColdHeat:masterfrom
jainal09:modernize-dependencies
Open

Modernize dependencies: update cffi to 2.0.0 and setuptools-golang to 2.9.0#53
jainal09 wants to merge 3 commits into
ColdHeat:masterfrom
jainal09:modernize-dependencies

Conversation

@jainal09

@jainal09 jainal09 commented Mar 19, 2026

Copy link
Copy Markdown

Summary

  • Update cffi from ~=1.1 to >=2.0.0
  • Update setuptools-golang from 2.7.0 to 2.9.0

Why the need to upgrade?

When pybluemonday is used alongside the cryptography package, it constrains users to cryptography<=44.0.3 because pybluemonday requires cffi~=1.1 (which means <2.0), while newer versions of cryptography require cffi>=2.0.0.

There is a high severity vulnerability (CVSS 8.2) affecting cryptography versions <46.0.5. Without resolving the hard conflict with pybluemonday^0.0.14 which constrains cffi~=1.1, users cannot upgrade to the patched cryptography version.

This PR bumps the dependencies to their latest versions to unblock users from resolving this security issue.

Test plan

  • Built Go shared library successfully
  • Built CFFI bindings with cffi 2.0.0
  • All 14 tests pass
  • Verified compatibility with cryptography 46.0.5 (which also requires cffi>=2.0.0)
  • Benchmarks run successfully

Tested with Python 3.14 and Go 1.25.4.

🤖 Generated with Claude Code

… 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 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 19, 2026 18:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates Python build/install dependencies to support newer ecosystem requirements (notably newer cryptography), by bumping cffi and setuptools-golang versions used during the build of the Go shared library and CFFI bindings.

Changes:

  • Update the build-time pip install step to use cffi>=2.0.0.
  • Bump setup_requires from setuptools-golang==2.7.0 to ==2.9.0 and update cffi constraints.
  • Update install_requires to require cffi>=2.0.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread setup.py Outdated
Comment thread setup.py Outdated
Comment thread setup.py Outdated
- 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 <noreply@anthropic.com>
@jainal09

Copy link
Copy Markdown
Author

@ColdHeat please review

Add bluemonday.c, bluemonday.h, and bluemonday.cpython-*.so to
prevent accidentally committing generated files.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants