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 _monkeypatches, import-related Flake8 codes #4568

Merged
merged 2 commits into from May 29, 2020

Conversation

elacuesta
Copy link
Member

@elacuesta elacuesta commented May 11, 2020

No need for the monkey patch anymore, since https://twistedmatrix.com/trac/ticket/7989 does not affect Python 3 (similar to this code simplification related to pickle).

Refactored scrapy/__init__.py to group the different sections.

Also removed the E402 Flake8 code. Most occurrences in pytest.ini were outdated.

/cc @dangra since he authored #1414. Please advice about this removal. Thanks in advance.

@elacuesta elacuesta force-pushed the remove-monkeypatches-flake8-e402 branch from 0f97133 to 5e13781 Compare May 11, 2020
@codecov
Copy link

@codecov codecov bot commented May 11, 2020

Codecov Report

Merging #4568 into master will decrease coverage by 0.02%.
The diff coverage is 80.00%.

@@            Coverage Diff             @@
##           master    #4568      +/-   ##
==========================================
- Coverage   84.57%   84.55%   -0.03%     
==========================================
  Files         164      163       -1     
  Lines        9931     9924       -7     
  Branches     1477     1475       -2     
==========================================
- Hits         8399     8391       -8     
  Misses       1266     1266              
- Partials      266      267       +1     
Impacted Files Coverage Δ
scrapy/__init__.py 84.21% <70.00%> (-1.51%) ⬇️
scrapy/linkextractors/__init__.py 97.10% <100.00%> (ø)
scrapy/selector/__init__.py 100.00% <100.00%> (ø)
scrapy/spiders/__init__.py 100.00% <100.00%> (ø)
scrapy/utils/trackref.py 82.85% <0.00%> (-2.86%) ⬇️

@Gallaecio Gallaecio closed this May 15, 2020
@Gallaecio Gallaecio reopened this May 15, 2020
@elacuesta elacuesta force-pushed the remove-monkeypatches-flake8-e402 branch from 163d0d2 to 7d6f623 Compare May 15, 2020
@elacuesta elacuesta force-pushed the remove-monkeypatches-flake8-e402 branch from 7d6f623 to a915af2 Compare May 15, 2020
@elacuesta elacuesta changed the title Remove _monkeypatches module, E402 flake8 code Remove _monkeypatches, import-related Flake8 codes May 16, 2020
from scrapy.selector.unified import * # noqa: F401

# top-level imports
from scrapy.selector.unified import Selector, SelectorList
Copy link
Member Author

@elacuesta elacuesta May 16, 2020

Choose a reason for hiding this comment

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

This is safe, these two classes are the only ones that have been exposed from the very beginning.

@kmike kmike added this to the v2.2 milestone May 28, 2020
@kmike kmike merged commit 6aab3ba into scrapy:master May 29, 2020
1 of 2 checks passed
@kmike
Copy link
Member

@kmike kmike commented May 29, 2020

Thanks @elacuesta!

@elacuesta elacuesta deleted the remove-monkeypatches-flake8-e402 branch May 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants