Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drop six dependency (#618) #742

Merged
merged 2 commits into from
Oct 28, 2024
Merged

drop six dependency (#618) #742

merged 2 commits into from
Oct 28, 2024

Conversation

willkg
Copy link
Member

@willkg willkg commented Oct 28, 2024

This does some squirrely things in order to drop the six dependency that our vendored html5lib has. The thinking is along these lines:

  1. this is the best way to drop the six dependency in the context we have
  2. it maintains the rigor we use for vendored libraries
  3. it's mostly straightforward and easy to reason about
  4. the code changes are minimal--it mostly teaks a small handful of import lines
  5. it won't cause problems with other things that are installed alongside bleach and its vendored html5lib
  6. html5lib hasn't had a release in a while so this won't meaningfully increase the maintenance burden

The way this works is that vendoring now has two steps:

  1. installing html5lib 1.1 into a specific directory with no dependencies
  2. applying the 01_html5lib_six.patch

Fixes #618.

urllib_parse = urllib.parse


# Copied from six: https://github.com/benjaminp/six/blob/c1b416f24de52ebd8eaed3e379ab85ec9c3e935b/six.py
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't need this. I'll fix it.

This way lies madness, but at least we don't have a six dependency
anymore.

The way this work is that we vendored html5lib 1.1, but then this
applies a 01_html5lib_six.patch to that which changes imports from six
to import from bleach.six_shim.

This updates the vendor management code and vendorverify to install
html5lib 1.1 and then apply the patch and then compare with what's in
the tree. If we end up applying further patches in the future, we can
use this model to do that.
@willkg willkg merged commit 156c589 into main Oct 28, 2024
36 checks passed
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.

remove six from dependencies
1 participant