Skip to content

Commit

Permalink
Use html.clean from external project and provide "html_clean" extra d…
Browse files Browse the repository at this point in the history
…ependency (GH-406)

Following the discussion in https://bugs.launchpad.net/lxml/+bug/1958539, "lxml.html.clean" is now extracted into a separate project "lxml_html_clean":

*    Github: https://github.com/fedora-python/lxml_html_clean
*    PyPI: https://pypi.org/project/lxml-html-clean/
*    Documentation: https://lxml-html-clean.readthedocs.io/en/latest/

The module is available as an "extra" setuptools dependency "lxml[html_clean]", so that:

*    Projects that use lxml without lxml.html.clean will continue to use it without any difference. Except they won't have potentially vulnerable code installed.
*    Projects that need lxml.html.clean will need to switch their requirements from lxml to lxml[html_clean].

The new package is added as a test dependency to continue to test the compatibility between the two projects.

Closes https://bugs.launchpad.net/lxml/+bug/1958539
  • Loading branch information
frenzymadness committed Mar 29, 2024
1 parent 06b70c3 commit 7377868
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 1,434 deletions.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def static_env_list(name, separator=None):
'cssselect': 'cssselect>=0.7',
'html5': 'html5lib',
'htmlsoup': 'BeautifulSoup4',
'html_clean': 'lxml_html_clean',
}

extra_options.update(setupinfo.extra_setup_args())
Expand Down
1 change: 0 additions & 1 deletion setupinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"lxml.builder",
"lxml._elementpath",
"lxml.html.diff",
"lxml.html.clean",
"lxml.sax",
]
HEADER_FILES = ['etree.h', 'etree_api.h']
Expand Down

0 comments on commit 7377868

Please sign in to comment.