Dobatymo / lmdb-python-dbm

Python DBM style wrapper of LMDB
ISC License
26 stars 8 forks source link

mypy is not happy #1

Closed dimaqq closed 5 months ago

dimaqq commented 1 year ago

Sorry, I'm not an expert on type annotations, I added this library and ran mypy, that was it.

> mypy my-package-src
lib/python3.10/site-packages/lmdbm/lmdbm.py:28: error: syntax error in type comment "(bool, ) -> None"
lib/python3.10/site-packages/lmdbm/lmdbm.py:98: error: syntax error in type comment "(int, ) -> None"
lib/python3.10/site-packages/lmdbm/lmdbm.py:103: error: syntax error in type comment "(object, ) -> bytes"
lib/python3.10/site-packages/lmdbm/lmdbm.py:113: error: syntax error in type comment "(bytes, ) -> KT"
lib/python3.10/site-packages/lmdbm/lmdbm.py:118: error: syntax error in type comment "(VT, ) -> bytes"
lib/python3.10/site-packages/lmdbm/lmdbm.py:128: error: syntax error in type comment "(bytes, ) -> VT"
lib/python3.10/site-packages/lmdbm/lmdbm.py:133: error: syntax error in type comment "(KT, ) -> VT"
lib/python3.10/site-packages/lmdbm/lmdbm.py:161: error: syntax error in type comment "(KT, ) -> None"
lib/python3.10/site-packages/lmdbm/lmdbm.py:188: error: syntax error in type comment "(object, ) -> bool"
lib/python3.10/site-packages/lmdbm/lmdbm.py:288: error: syntax error in type comment "(VT, ) -> bytes"
lib/python3.10/site-packages/lmdbm/lmdbm.py:294: error: syntax error in type comment "(bytes, ) -> VT"
Found 11 errors in 1 file (errors prevented further checking)

Version info:

lmdb @ file:/xxx/lmdb-1.3.0-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
lmdbm @ file:/xxx/lmdbm-0.0.5-py2.py3-none-any.whl

mypy @ file:/xxx/mypy-0.982-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
mypy-extensions @ file:/xxx/mypy_extensions-0.4.3-py2.py3-none-any.whl

> python 
Python 3.10.6 (main, Aug  2 2022, 15:11:28) [GCC 9.4.0] on linux
Dobatymo commented 1 year ago

Please try the master branch, it's using type annotations. However mypy should understand these old style type comments as well...

dimaqq commented 1 year ago

Btw., the core of the issue:

Dobatymo commented 1 year ago

Yes thank you I am aware of that. These already don't exist in master anymore (and mypy seems to have only recently decided to not like these)

dimaqq commented 1 year ago

No worries, I'll wait for the new release.

Dobatymo commented 5 months ago

Fixed https://github.com/Dobatymo/lmdb-python-dbm/releases/tag/v0.0.6