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

Typing for scrapy/core/downloader #5896

Merged
merged 8 commits into from
Apr 17, 2023
Merged

Typing for scrapy/core/downloader #5896

merged 8 commits into from
Apr 17, 2023

Conversation

wRAR
Copy link
Member

@wRAR wRAR commented Apr 15, 2023

It doesn't seem worth it to add typing for code that uses Twisted HTTP stuff, as that code is itself untyped and also some of our code uses zope.interface which is not really supported by mypy.

@codecov
Copy link

codecov bot commented Apr 15, 2023

Codecov Report

Merging #5896 (41a4751) into master (e1f6662) will decrease coverage by 0.06%.
The diff coverage is 93.05%.

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

@@            Coverage Diff             @@
##           master    #5896      +/-   ##
==========================================
- Coverage   88.82%   88.77%   -0.06%     
==========================================
  Files         162      162              
  Lines       11129    11159      +30     
  Branches     1808     1813       +5     
==========================================
+ Hits         9885     9906      +21     
- Misses        961      966       +5     
- Partials      283      287       +4     
Impacted Files Coverage Δ
scrapy/utils/python.py 88.75% <81.81%> (-0.93%) ⬇️
scrapy/core/downloader/handlers/__init__.py 89.83% <87.50%> (-2.90%) ⬇️
scrapy/core/downloader/tls.py 97.22% <87.50%> (-2.78%) ⬇️
scrapy/core/downloader/contextfactory.py 85.24% <90.00%> (-2.26%) ⬇️
scrapy/core/downloader/webclient.py 94.77% <95.23%> (+0.11%) ⬆️
scrapy/core/downloader/__init__.py 91.72% <95.65%> (-1.09%) ⬇️
scrapy/core/downloader/middleware.py 96.77% <100.00%> (+0.05%) ⬆️
scrapy/utils/ssl.py 61.36% <100.00%> (+3.86%) ⬆️

x509name_to_string(server_cert.get_issuer()),
x509name_to_string(server_cert.get_subject()),
)
if server_cert:
Copy link
Member

Choose a reason for hiding this comment

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

Worth it! :)

def __repr__(self):
return f"<{self.__class__.__name__}: {self.url}>"
def __repr__(self) -> str:
return f"<{self.__class__.__name__}: {self._url}>"
Copy link
Member

Choose a reason for hiding this comment

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

🎉

@Gallaecio Gallaecio merged commit 02f3e8d into master Apr 17, 2023
@wRAR wRAR deleted the typing-core-downloader branch May 25, 2023 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants