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

url-matcher integration with scrapy-poet #56

Merged
merged 22 commits into from
May 19, 2022
Merged

Conversation

ivanprado
Copy link
Contributor

@ivanprado ivanprado commented Dec 8, 2021

WARNING: this branch was created on top of #55. It should be merged only after the former one has been merged

New registry that uses the url-matcher patterns to configure the overrides. It is a backwards-incompatible change. See the updated documentation to get more context.

A new release of web-poet is required because this depends on scrapinghub/web-poet#16 scrapinghub/web-poet#27

TODO:

@ivanprado ivanprado changed the base branch from cacheable_provider to injector_record_replay_native December 8, 2021 12:16
Copy link
Contributor

@BurnzZ BurnzZ left a comment

Choose a reason for hiding this comment

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

Hi @ivanprado , added some comments after a first pass. Looking good so far!

docs/intro/tutorial.rst Outdated Show resolved Hide resolved
CHANGELOG.rst Outdated Show resolved Hide resolved
docs/overrides.rst Outdated Show resolved Hide resolved
docs/overrides.rst Outdated Show resolved Hide resolved
docs/overrides.rst Show resolved Hide resolved
example/example/spiders/books_04_overrides_02.py Outdated Show resolved Hide resolved
scrapy_poet/injection.py Show resolved Hide resolved
docs/intro/tutorial.rst Outdated Show resolved Hide resolved
scrapy_poet/overrides.py Outdated Show resolved Hide resolved
scrapy_poet/overrides.py Show resolved Hide resolved
Copy link

@sortafreel sortafreel left a comment

Choose a reason for hiding this comment

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

LGTM 👍

example/example/spiders/books_04_overrides_02.py Outdated Show resolved Hide resolved
scrapy_poet/injection.py Show resolved Hide resolved
docs/overrides.rst Outdated Show resolved Hide resolved
docs/overrides.rst Outdated Show resolved Hide resolved
tox.ini Outdated
@@ -7,7 +7,7 @@ deps =
pytest-cov
scrapy >= 2.1.0
pytest-twisted
web-poet
web-poet @ git+https://[email protected]/scrapinghub/web-poet@handle_urls#egg=web-poet
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder to update this when scrapinghub/web-poet#16 is released.

@BurnzZ BurnzZ changed the base branch from injector_record_replay_native to master December 21, 2021 06:28
@codecov
Copy link

codecov bot commented Dec 21, 2021

Codecov Report

Merging #56 (0bc51b8) into master (3ecc174) will increase coverage by 1.50%.
The diff coverage is 97.43%.

@@            Coverage Diff             @@
##           master      #56      +/-   ##
==========================================
+ Coverage   95.96%   97.46%   +1.50%     
==========================================
  Files           9        9              
  Lines         372      395      +23     
==========================================
+ Hits          357      385      +28     
+ Misses         15       10       -5     
Impacted Files Coverage Δ
scrapy_poet/cache.py 92.30% <ø> (+4.50%) ⬆️
scrapy_poet/utils.py 100.00% <ø> (+40.00%) ⬆️
scrapy_poet/overrides.py 95.12% <97.05%> (+1.78%) ⬆️
scrapy_poet/injection.py 98.95% <100.00%> (+0.01%) ⬆️
scrapy_poet/middleware.py 100.00% <100.00%> (ø)

@BurnzZ BurnzZ force-pushed the url-matcher-integration branch from 54ea603 to 63029dc Compare December 23, 2021 03:40
@BurnzZ BurnzZ force-pushed the url-matcher-integration branch from 7e00bf6 to 17689b5 Compare March 2, 2022 12:17
scrapy_poet/utils.py Outdated Show resolved Hide resolved
BookPage: BPBookPage
},
}
"SCRAPY_POET_OVERRIDES": [
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we should provide an example with handle_urls decorator

Copy link
Contributor

@BurnzZ BurnzZ May 19, 2022

Choose a reason for hiding this comment

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

A good point! Added such an example in 0bc51b8.

Copy link
Member

@kmike kmike left a comment

Choose a reason for hiding this comment

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

Thanks @BurnzZ, @ivanprado and @sortafreel!

I left a couple of minor comments; the PR looks good to me, +1 to merge.

@BurnzZ BurnzZ force-pushed the url-matcher-integration branch from 4374ad7 to 0bc51b8 Compare May 19, 2022 05:43
@BurnzZ BurnzZ merged commit 53e5b92 into master May 19, 2022
@BurnzZ BurnzZ deleted the url-matcher-integration branch May 19, 2022 05:48
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