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

Deprecate scrapy.utils.py36 module #4900

Merged
merged 3 commits into from Nov 24, 2020
Merged

Conversation

elacuesta
Copy link
Member

Now that the minimum Python version is 3.6, there is no need to keep this helper in a different file and catch the SyntaxError when importing.



logger = logging.getLogger(__name__)


def iterate_spider_output(result):
if collect_asyncgen and hasattr(inspect, 'isasyncgen') and inspect.isasyncgen(result):
Copy link
Member Author

Choose a reason for hiding this comment

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

inspect.isasyncgen was added in Python 3.6

@wRAR
Copy link
Member

wRAR commented Nov 23, 2020

This is actually done in #4467 (not sure why I didn't think of extracting this change), though the function is moved to scrapy.utils.asyncgen. That module will get one more function, as_async_generator, but I guess it's fine to put both into scrapy.utils.python now that we don't need this separation because of 3.5.

@elacuesta
Copy link
Member Author

elacuesta commented Nov 23, 2020

Ohh 🤦
Well, I guess we can still work with this PR, since it's smaller and easier to merge than #4467.
Actually, I was hesitant about putting it under utils.python, if there are going to be more functions I think I like a new submodule instead.

@wRAR
Copy link
Member

wRAR commented Nov 23, 2020

Well, I think it's good that this will be merged separately as it reduces the diff and works fine as a separate change.

@codecov
Copy link

codecov bot commented Nov 24, 2020

Codecov Report

Merging #4900 (fe8bb6b) into master (e17c890) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #4900      +/-   ##
==========================================
+ Coverage   87.87%   87.89%   +0.02%     
==========================================
  Files         160      161       +1     
  Lines        9756     9757       +1     
  Branches     1437     1437              
==========================================
+ Hits         8573     8576       +3     
+ Misses        926      924       -2     
  Partials      257      257              
Impacted Files Coverage Δ
scrapy/utils/asyncgen.py 100.00% <100.00%> (ø)
scrapy/utils/py36.py 100.00% <100.00%> (ø)
scrapy/utils/spider.py 81.81% <100.00%> (+4.04%) ⬆️

@wRAR wRAR merged commit 440e45d into scrapy:master Nov 24, 2020
@elacuesta elacuesta deleted the deprecate_utils_py36 branch November 25, 2020 15:42
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

2 participants