Skip to content

Conversation

@kmike
Copy link
Contributor

@kmike kmike commented Nov 13, 2018

This PR is on top of #14.

  • _html_to_text is promoted to a public html_text.etree_to_text
  • html_text.cleaner object is exposed
  • parsel is imported only when needed
  • create_root_node implementation is copy-pasted to parse_html,
    to remove dependency
  • parsel is removed from install_requiers
  • README is updated

Motivation: make it possible for parsel to depend on html-text for scrapy/parsel#127.

@codecov-io
Copy link

codecov-io commented Nov 13, 2018

Codecov Report

Merging #15 into master will increase coverage by 0.11%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master      #15      +/-   ##
==========================================
+ Coverage   97.82%   97.93%   +0.11%     
==========================================
  Files           2        2              
  Lines          92       97       +5     
  Branches       17       18       +1     
==========================================
+ Hits           90       95       +5     
  Misses          2        2
Impacted Files Coverage Δ
html_text/__init__.py 100% <100%> (ø) ⬆️
html_text/html_text.py 97.89% <100%> (+0.11%) ⬆️

Copy link
Contributor

@lopuhin lopuhin left a comment

Choose a reason for hiding this comment

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

Hey @kmike I like the idea of removing parsel dependency and I like the code changes 👍
My main concern is that we don't check if we work without parsel, left a more detailed comment inline.

* _html_to_text is promoted to a public html_text.etree_to_text
* html_text.cleaner object is exposed
* parsel is imported only when needed
* create_root_node implementation is copy-pasted to parse_html,
  to remove dependency
* parsel is removed from install_requiers
* README is updated

The goal is to allow using html_text in parsel.
this is to cover all branches in parse_html function
Copy link
Contributor

@lopuhin lopuhin left a comment

Choose a reason for hiding this comment

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

Looks great, thanks! 👍

@lopuhin lopuhin merged commit 80289f1 into master Nov 19, 2018
@lopuhin lopuhin deleted the remove-parsel-dependency branch November 19, 2018 08:29
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.

4 participants