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

Remove parsel dependency #15

Merged
merged 8 commits into from
Nov 19, 2018
Merged

Remove parsel dependency #15

merged 8 commits into from
Nov 19, 2018

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%) ⬆️

tox.ini Outdated Show resolved Hide resolved
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! 👍

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.

None yet

3 participants