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

Added documentation for Spider.update_settings #5846

Merged
merged 9 commits into from Aug 2, 2023

Conversation

jxlil
Copy link
Contributor

@jxlil jxlil commented Mar 8, 2023

Added documentation for the Spider.update_settings class method.

Fixes #5745, closes #5757, closes #5784.

@codecov
Copy link

codecov bot commented Mar 8, 2023

Codecov Report

Merging #5846 (bcffe38) into master (8aca47e) will increase coverage by 0.26%.
Report is 300 commits behind head on master.
The diff coverage is 92.88%.

❗ Current head bcffe38 differs from pull request most recent head af1be83. Consider uploading reports for the commit af1be83 to get more accurate results

@@            Coverage Diff             @@
##           master    #5846      +/-   ##
==========================================
+ Coverage   88.96%   89.23%   +0.26%     
==========================================
  Files         162      163       +1     
  Lines       11021    11370     +349     
  Branches     1797     1844      +47     
==========================================
+ Hits         9805    10146     +341     
+ Misses        938      930       -8     
- Partials      278      294      +16     
Files Changed Coverage Δ
scrapy/__init__.py 84.21% <0.00%> (ø)
scrapy/downloadermiddlewares/httpcache.py 93.97% <ø> (ø)
scrapy/mail.py 77.77% <0.00%> (-0.88%) ⬇️
scrapy/commands/parse.py 29.26% <42.10%> (+1.07%) ⬆️
scrapy/utils/engine.py 77.27% <71.42%> (-6.94%) ⬇️
scrapy/pipelines/files.py 79.33% <75.00%> (+7.42%) ⬆️
scrapy/cmdline.py 68.70% <80.00%> (+0.73%) ⬆️
scrapy/signalmanager.py 81.81% <83.33%> (+1.81%) ⬆️
scrapy/addons.py 84.00% <84.00%> (ø)
scrapy/utils/display.py 93.10% <85.71%> (+0.24%) ⬆️
... and 54 more

... and 2 files with indirect coverage changes

@jxlil jxlil marked this pull request as ready for review March 8, 2023 14:40
Copy link
Member

@Gallaecio Gallaecio left a comment

Choose a reason for hiding this comment

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

Besides my points below, I think it may be good to highlight the benefits of update_settings over custom_settings. I‘m thinking that the main one is that you can dynamically add, remove or change settings based on spider arguments and other settings that may be defined outside code (e.g. Scrapy Cloud settings), not sure if there are others.

docs/topics/spiders.rst Outdated Show resolved Hide resolved
docs/topics/spiders.rst Outdated Show resolved Hide resolved
docs/topics/spiders.rst Outdated Show resolved Hide resolved
@jxlil
Copy link
Contributor Author

jxlil commented Mar 17, 2023

Done. The requested modifications were made and the last paragraph was replaced to highlight the benefits of update_settings()

docs/topics/spiders.rst Outdated Show resolved Hide resolved
docs/topics/spiders.rst Outdated Show resolved Hide resolved
jxlil and others added 2 commits March 17, 2023 12:13
Co-authored-by: Adrián Chaves <adrian@chaves.io>
docs/topics/spiders.rst Outdated Show resolved Hide resolved
Co-authored-by: Adrián Chaves <adrian@chaves.io>
@wRAR
Copy link
Member

wRAR commented Jul 24, 2023

It doesn't cover everything that I want to be covered here, I'll try to suggest some additional wording.

@wRAR wRAR requested a review from Gallaecio August 2, 2023 08:34
docs/topics/settings.rst Outdated Show resolved Hide resolved
docs/topics/settings.rst Outdated Show resolved Hide resolved
docs/topics/spiders.rst Outdated Show resolved Hide resolved
docs/topics/spiders.rst Outdated Show resolved Hide resolved
Co-authored-by: Adrián Chaves <adrian@chaves.io>
@wRAR wRAR merged commit 7c6aaed into scrapy:master Aug 2, 2023
24 checks passed
@wRAR
Copy link
Member

wRAR commented Aug 2, 2023

Thanks!

@jxlil jxlil deleted the docs/spiders branch August 2, 2023 17:33
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.

Document Spider.update_settings
4 participants