Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Type Hints for aioredis #584

Merged
merged 3 commits into from Apr 20, 2019
Merged

Type Hints for aioredis #584

merged 3 commits into from Apr 20, 2019

Conversation

butuzov
Copy link
Contributor

@butuzov butuzov commented Apr 20, 2019

What do these changes do?

  • Enabls type hints using mypy
  • Adds initial type checks for errors.py and parser.py

Are there changes in behavior for the user?

None

Related issue number

#555

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> (e.g. 588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the PR
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: Fix issue with non-ascii contents in doctest text files.

+ enabling type hints using `mypy`
+ added initial type checks for `errors.py` and `parser.py`
- &MYPY
name: mypy
cache: false
python: "3.6"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
python: "3.6"
python: "3.7"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes total sense. Added 3.7 version for Travis-CI job.

self.pos: int = 0
self.protocolError: Callable = protocolError
self.replyError: Callable = replyError
self.encoding: Optional[str] = encoding
Copy link
Contributor

Choose a reason for hiding this comment

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

This wont work in Python 3.5

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean variable annotations

Ensuring that typings will be recognized by python 3.5
@codecov
Copy link

codecov bot commented Apr 20, 2019

Codecov Report

Merging #584 into master will decrease coverage by 16.48%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #584       +/-   ##
===========================================
- Coverage   96.82%   80.34%   -16.49%     
===========================================
  Files          57       57               
  Lines        8411     7976      -435     
  Branches      563      561        -2     
===========================================
- Hits         8144     6408     -1736     
- Misses        191     1513     +1322     
+ Partials       76       55       -21
Impacted Files Coverage Δ
aioredis/parser.py 98.43% <100%> (+0.01%) ⬆️
aioredis/errors.py 100% <100%> (ø) ⬆️
tests/stream_commands_test.py 12.35% <0%> (-87.65%) ⬇️
tests/sentinel_commands_test.py 18.45% <0%> (-81.55%) ⬇️
tests/geo_commands_test.py 19.08% <0%> (-80.92%) ⬇️
aioredis/commands/geo.py 22.53% <0%> (-77.47%) ⬇️
tests/ssl_test.py 23.52% <0%> (-76.48%) ⬇️
tests/sentinel_failover_test.py 13.43% <0%> (-74.43%) ⬇️
aioredis/commands/streams.py 23.8% <0%> (-66.67%) ⬇️
aioredis/sentinel/commands.py 36.25% <0%> (-61.29%) ⬇️
... and 35 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b8cb283...3b3909b. Read the comment docs.

@popravich popravich merged commit 6b727af into aio-libs-abandoned:master Apr 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants