aio-libs / aiopg

aiopg is a library for accessing a PostgreSQL database from the asyncio
http://aiopg.readthedocs.io
BSD 2-Clause "Simplified" License
1.4k stars 160 forks source link

Type annotations #813

Closed Pliner closed 3 years ago

Pliner commented 3 years ago

What do these changes do?

This PR adds type hints for aiopg except aiopg.sa. Due to cyclic dependencies between cursor, connection and transaction, I had to merge three files into one. The same thing is with context managers: due to cyclic dependencies(context managers were very specific) I had to generalise as much as possible _ContextManager and move specific ones closer to their usage.

Related issue number

314

Checklist

codecov[bot] commented 3 years ago

Codecov Report

Merging #813 (3980d99) into master (5e65277) will decrease coverage by 0.09%. The diff coverage is 96.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #813      +/-   ##
==========================================
- Coverage   93.34%   93.25%   -0.10%     
==========================================
  Files          13       11       -2     
  Lines        1548     1526      -22     
  Branches      179      179              
==========================================
- Hits         1445     1423      -22     
+ Misses         73       72       -1     
- Partials       30       31       +1     
Impacted Files Coverage Δ
aiopg/pool.py 94.46% <85.22%> (-5.54%) :arrow_down:
aiopg/utils.py 86.36% <91.17%> (+0.74%) :arrow_up:
aiopg/connection.py 95.81% <99.74%> (+4.41%) :arrow_up:
aiopg/__init__.py 100.00% <100.00%> (ø)
aiopg/sa/connection.py 88.03% <100.00%> (+0.41%) :arrow_up:
aiopg/sa/engine.py 99.13% <100.00%> (+<0.01%) :arrow_up:
aiopg/sa/result.py 90.77% <100.00%> (ø)

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 5e65277...3980d99. Read the comment docs.