Commit Graph

6976 Commits

Author SHA1 Message Date
Adrián Chaves e3df6be360
Update docs/topics/broad-crawls.rst
Co-Authored-By: whalebot-helmsman <whalebot.helmsman@gmail.com>
2019-03-29 10:28:52 +00:00
Adrián Chaves 46b9ab0c58
Update docs/topics/broad-crawls.rst
Co-Authored-By: whalebot-helmsman <whalebot.helmsman@gmail.com>
2019-03-29 10:28:36 +00:00
Mikhail Korobov 845bae6637
Update docs/topics/broad-crawls.rst
Co-Authored-By: whalebot-helmsman <whalebot.helmsman@gmail.com>
2019-03-27 08:49:19 +00:00
Vostretsov Nikita 73e4ff5304 report warnings 2019-03-25 13:48:58 +00:00
Vostretsov Nikita 103fdc40c1 Merge remote-tracking branch 'upstream/master' into round-robin-scheduler-tested 2019-03-25 16:16:42 +03:00
Vostretsov Nikita 31b8a6b33a report warnings 2019-03-25 16:08:40 +03:00
Lucy Wang df574de8cc improve tests and fix some lint warnings (#6)
* refactor downloader-aware test cases

* fix lint

* add doctest for _path_safe

* remove unused code

* better doctest
2019-03-25 16:08:40 +03:00
Vostretsov Nikita 8afffb7234 Tests Cleanup
add doctest for function
no need in this variables
move common assertion inside function
rename variable
rename variables
rename function
use function
this is not a method of public API
correct name for test
Update docs/topics/settings.rst

Co-Authored-By: whalebot-helmsman <whalebot.helmsman@gmail.com>
2019-03-25 16:08:40 +03:00
Vostretsov Nikita 989bba6cb3 Revert "new signal"
This reverts commit 646164fd7d6dd52061804d2df7424cff929bf739.
remove tests
Revert "emit new signal"

This reverts commit fcde0c6880678957a76af6083b6248f430a00fcf.
Revert "documentation for new signal"

This reverts commit 8aeb9f696ece95c16499a96767a7afa3d9c4abf4.
2019-03-25 16:08:40 +03:00
Vostretsov Nikita 443fb98a47 Use downloader directly
rename variable
remove old write function
remove unused imports
remove old read function
remove unused function
use mock methods
mock downloader
close downloader
add parse method
use new PQ class
create mock downloader
use downloader directly
remove mark/unmark mechanism
2019-03-25 16:08:40 +03:00
Mikhail Korobov 83eb537645 assorted cleanups: comments, docstrings, etc
scheduler cleanup

Scheduler no longer converts requests to dicts; PriorityQueue
instances always work with Request instances; converting Requests
to dicts is now Priority Queue responsibility.
minor cleanup
2019-03-25 16:08:40 +03:00
Vostretsov Nikita 3b1db71dac New signal
update signature
documentation for new signal
utilize new signal
correct signal handler signature
emit new signal
test another signal
new signal
rename test file
faster test
rename test case
tests for signal emitting in bad cases
2019-03-25 16:08:40 +03:00
Vostretsov Nikita 757f53a324 Address Lucy's comments
add tests to check correctness of slot setermination
unmark requests after downloading
shorter
better exception message
2019-03-25 16:08:40 +03:00
Mikhail Korobov 90934959d0 actually apply __slots__ suggestion
[wip] refactoring

* SlotPriorityQueues doesn't care about objects inside, it is now just
  a container for multiple priority queues
* assorted variable renames
* don't inherit DownloaderAwarePriorityQueue from SlotBasedPriorityQueue
* apply @whalebot-helmsman's suggestions for __slots__ and meta issues
more bike-shedding

* remove mutable default arguments
* more verbose variable names
remove unneeded code

* PriorityAsTupleQueue.is_empty does the same as len(self) == 0
* custom PriorityAsTupleQueue.close is not needed after a switch
  to namedtuples
* is_new and is_empty return values are unused
* "url" local variable is unused
PrioritySlot.__str__ shouldn't return unicode in Python 2

also, do some bike-shedding: _pathable -> _path_safe
use namedtuple for PrioritySlot
cleanup: _get_from_request does the same here

Request.meta is always a dict
2019-03-25 16:08:40 +03:00
Mikhail Korobov 8583c033ef
Merge pull request #3694 from noviluni/master
[MRG+1] Fix numeration
2019-03-23 00:23:06 +05:00
Adrián Chaves c191a8e70c
Merge pull request #3698 from noviluni/_fix_gitignore
[MRG+1] remove duplicated entry in gitignore
2019-03-22 19:45:57 +01:00
Mikhail Korobov 729580dae2
Merge pull request #3671 from Gallaecio/item-deepcopy
Implement Item.deepcopy()
2019-03-22 22:56:39 +05:00
Marc Hernández Cabot 9a0fe8bf2d remove duplicated entry in gitignore 2019-03-22 18:56:25 +01:00
Adrián Chaves 7c148fce5a Implement Item.deepcopy() 2019-03-22 17:07:10 +01:00
Konstantin Lopuhin af2b666595
Merge pull request #3505 from kasun/json_request
[MRG+2] Request subclass for json requests #3504
2019-03-22 18:25:54 +03:00
Mikhail Korobov 4196d4869b
Merge pull request #3607 from victor-torres/feed-storage-s3-acl
[MRG+1] add FEED_STORAGE_S3_ACL setting
2019-03-22 20:05:45 +05:00
Vostretsov Nikita 338b78d796 Add documentation
add section to broad-crawl topic
reword in accord with broad-crawl topic
add documentation for new priority queue
2019-03-22 15:40:37 +03:00
Vostretsov Nikita 8e8ce301b1 check CONCURRENT_REQUESTS_PER_IP is not set 2019-03-22 15:40:37 +03:00
Vostretsov Nikita 987c2ae4a9 test ip concurrency incompatibility with DAPQ 2019-03-22 15:40:37 +03:00
Vostretsov Nikita 4163a7a1c7 no need for this 2019-03-22 15:40:37 +03:00
Daniel Graña 6ff2574c27 Needs to be installed within tox env 2019-03-22 15:40:36 +03:00
Daniel Graña 7d3175ac84 Fix boto import error under Jessie testing environment 2019-03-22 15:40:36 +03:00
Vostretsov Nikita d970be64cc Integration test
integration testing only everything is working, not logic of PQ
use method
create slot attribute in constructor
corect class for test case
stop crawler in teardown method
use class
correct entity naming
python 2 adaptation
integration test with crawler and spider
2019-03-22 15:40:36 +03:00
Vostretsov Nikita a23e1894b3 Fix boto problem
another way to fix boto problem
Revert "fix for travis ci based on https://github.com/boto/boto/issues/3717"

This reverts commit 150d2564ff0ea994652da7f5be333d72e0b38d93.
fix for travis ci based on https://github.com/boto/boto/issues/3717
2019-03-22 15:40:36 +03:00
Vostretsov Nikita a46613afa8 use regular comments 2019-03-22 15:40:36 +03:00
Vostretsov Nikita 6af964cc0b common indentation for comment 2019-03-22 15:40:36 +03:00
Vostretsov Nikita 484927b08c less complex implementation 2019-03-22 15:40:36 +03:00
Vostretsov Nikita 0e06b9a816 use urlparse_cached where it is possible 2019-03-22 15:40:36 +03:00
Lucy Wang 7efba10194 remove "sudo: false" now that travis no longer supports it
https://changelog.travis-ci.com/deprecation-container-based-linux-build-environment-82037
2019-03-22 15:40:36 +03:00
Vostretsov Nikita f56079f6c7 Test cleanups
PEP8 fixes
no need to close implicitly
do not use pytest
need to put it into class
remove round-robin queue
additional check for empty queue
use pytest tmpdir fixture
2019-03-22 15:40:36 +03:00
Adrián Chaves 9c314800e4 Document the SCRAPY_PROJECT environment variable
Fixes #1109
2019-03-22 15:40:36 +03:00
Adrián Chaves afdb69ea6d Add a troubleshooting section to the installation instructions
Its initial content covers the workaround for #2473.
2019-03-22 15:40:36 +03:00
Vostretsov Nikita 821f5bb260 First implementation
handle exception
use O(N) instead of O(NlogN)
here we have request as struct
additional check for meptiness
small performance improvement
do not consume another request
test number of responses
mark requests
back to 3 slots test case
raise exceptions in case of missed meta
add marks to requests and work only with your own requests
only disk queue should obtain signals
separate functions for slot rasd/write
use signlas without variable
stop crawler
get signals in correct place
logic test for download-aware priority queue
update comment for structure
ensure text type
transform slot name to path
use implicit structure
use unicode type implicitly
use real crawler
add signals
more slot accounting
simple implementation of pop
small slot accounting code
no need for custom len function
ability to call super in py27
add slots
generic tests for downloader aware queue
dummy implementation of crawler aware priority queue
move common logic to base class
rename class
pass crawler to pqclass constructor
do not copy quelib.PriorityQueue code
add comment about new class
remove obsolete function
modify behaviour of queuelib.PriorityQueue to dodge very complex priority
better way to get name
remove obsolete commentary
check boundaries
function for priority convertion with known limits
correct import path
move file
do not switch on by deffault as ip concurrency not supported
set scheduler slot in case of empty slot
use constant
single place for added urls
single place for constants
use as default queue
correct format for error text
test migration from old version with on disk queue
in these tests we have only two inflection points - jobdir and priority_queue_cls
we do not need separate mock spider, use usual one
do not rely on order of dict elements, imply order of list
test round robiness of priority queue
add comments and requirements for our magick function
remove debug logging
put queues into slot
as we fabricate priorities we do not need special types anymore
fabricate priority for priority queue
more versatile priorities
Scheduler class is not inflection point
wrap correct types
check for emptinees before initialization
tests for new priority queue
correct default type for startprios
use exact values
put common settings to base class
test priorities for disk scheduler
test dequeue for disk scheduler
test length for disk scheduler
setUp/tearDown methods for on disk schedulers
new methods
remove excessive line
base class to handle scheduler creation
correct method names
test priorities
deque test
close scheduler on test end
enqueue some requests
test template for scheduler
use downloader slot
I/O implementation for RoundRobin queue
round-robin implementation without I/O and slot detection
wrappers for every disk queue class
2019-03-22 15:40:36 +03:00
Marc Hernández 70aa5b1333
Fix numeration 2019-03-20 15:32:20 +01:00
Victor Torres fda1d04b81
Merge branch 'master' into feed-storage-s3-acl 2019-03-15 13:26:45 -03:00
Adrián Chaves d346b8cb0f
Merge pull request #3626 from Gallaecio/middlewares-from-crawler
[MRG+1] Document that the main entry point of downloader and spider middlewar…
2019-03-15 08:58:35 +01:00
Adrián Chaves 70a0f1f2e4
Merge pull request #3610 from Gallaecio/spidercls-check
[MRG+1] Check that spidercls arguments in scrapy.crawler classes are not spid…
2019-03-15 08:25:16 +01:00
Adrián Chaves 1f7413dc88
Merge pull request #3635 from matthieucham/feature-filteringlinkextractor-restrict-text
[MRG+1] Feature filteringlinkextractor restrict text
2019-03-15 07:58:28 +01:00
Adrián Chaves 2bd5790d9b
Merge pull request #3629 from johndela1/master
[MRG+1] rel_has_nofollow: remove redundant if statement
2019-03-15 07:53:23 +01:00
Mikhail Korobov 09e56ae43e
Merge pull request #3648 from Gallaecio/backward
backwards → backward (adj.)
2019-03-14 22:21:34 +05:00
Mikhail Korobov 5dc94db847
Merge branch 'master' into backward 2019-03-14 22:21:09 +05:00
Mikhail Korobov 54d106033f
Merge pull request #3649 from Gallaecio/inline-code-formatting
[MRG+1] Switch from ` to `` where inline code formatting is desired
2019-03-14 22:18:57 +05:00
Mikhail Korobov 7c54479a0e
Merge pull request #3662 from anubhavp28/link-patch
Fix a link inside docs
2019-03-14 22:18:04 +05:00
Mikhail Korobov c3b6755671
Merge pull request #3668 from Gallaecio/retry-complete-docs
Remove the unexisting retry_complete signal from the documentation
2019-03-14 22:16:28 +05:00
Mikhail Korobov f439553844
Merge pull request #3670 from Gallaecio/depth-first-doc
Clarify the documentation of DEPTH_PRIORITY further
2019-03-14 22:10:42 +05:00