iDigBio / idb-backend

iDigBio server and backend code for data ingestion, media processing, record indexing, and data API.
GNU General Public License v3.0
7 stars 0 forks source link

pylint Python 3 porting report for `idb` #159

Open danstoner opened 3 years ago

danstoner commented 3 years ago
~/git/IDIGBIO/idb-backend]$ pylint --py3k idb
************* Module idb.config
idb/config.py:1:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
************* Module idb.load_annotations
idb/load_annotations.py:1:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
************* Module idb.load_corrections
idb/load_corrections.py:1:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
************* Module idb.clibase
idb/clibase.py:107:24: W1651: Accessing a deprecated function on the itertools module (deprecated-itertools-function)
idb/clibase.py:107:24: W1651: Accessing a deprecated function on the itertools module (deprecated-itertools-function)
************* Module idb.data_tables.build_taxon_index
idb/data_tables/build_taxon_index.py:2:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
************* Module idb.data_tables.rights_strings
idb/data_tables/rights_strings.py:2:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
************* Module idb.data_tables.taxon_rank
idb/data_tables/taxon_rank.py:374:4: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
************* Module idb.data_tables.taxon
idb/data_tables/taxon.py:1:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
************* Module idb.data_tables.locality
idb/data_tables/locality.py:1:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
idb/data_tables/locality.py:27:20: W1620: Calling a dict.iter*() method (dict-iter-method)
************* Module idb.data_tables.locality_data
idb/data_tables/locality_data.py:3:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
************* Module idb.data_tables.taxon_extended
idb/data_tables/taxon_extended.py:1:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
************* Module idb.data_tables.build_taxon_kv
idb/data_tables/build_taxon_kv.py:65:24: W1633: round built-in referenced (round-builtin)
************* Module idb.stats.stats_rewriter
idb/stats/stats_rewriter.py:1:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
************* Module idb.stats.stats-backup
idb/stats/stats-backup.py:1:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
************* Module idb.helpers.conversions
idb/helpers/conversions.py:269:11: W1619: division w/o __future__ statement (old-division)
idb/helpers/conversions.py:757:31: W1637: zip built-in referenced when not iterating (zip-builtin-not-iterating)
idb/helpers/conversions.py:1012:30: W1619: division w/o __future__ statement (old-division)
************* Module idb.helpers.media_validation
idb/helpers/media_validation.py:36:15: W1645: Exception.message removed in Python 3 (exception-message-attribute)
************* Module idb.helpers.fieldnames
idb/helpers/fieldnames.py:572:8: W1639: filter built-in referenced when not iterating (filter-builtin-not-iterating)
idb/helpers/fieldnames.py:580:9: W1655: dict.keys referenced when not iterating (dict-keys-not-iterating)
idb/helpers/fieldnames.py:588:9: W1655: dict.keys referenced when not iterating (dict-keys-not-iterating)
************* Module idb.helpers
idb/helpers/__init__.py:1:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
************* Module idb.helpers.biodiversity_socket_connector
idb/helpers/biodiversity_socket_connector.py:98:15: W1636: map built-in referenced when not iterating (map-builtin-not-iterating)
************* Module idb.annotations.loader
idb/annotations/loader.py:2:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
************* Module idb.annotations.epandda_fetcher
idb/annotations/epandda_fetcher.py:1:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
idb/annotations/epandda_fetcher.py:10:13: W1613: xrange built-in referenced (xrange-builtin)
************* Module idb.postgres_backend.stats_db
idb/postgres_backend/stats_db.py:1:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
************* Module idb.indexing.index_from_postgres
idb/indexing/index_from_postgres.py:305:30: W1651: Accessing a deprecated function on the itertools module (deprecated-itertools-function)
idb/indexing/index_from_postgres.py:305:30: W1651: Accessing a deprecated function on the itertools module (deprecated-itertools-function)
************* Module idb.corrections.loader
idb/corrections/loader.py:2:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)

-----------------------------------
Your code has been rated at 9.92/10
danstoner commented 3 years ago

From that big list, the following are the ones that would need to be fixed or investigated for Python 3 conversion project:

W1651 deprecated-itertools-function Message 'Accessing a deprecated function on the itertools module'

Description Used when accessing a function on itertools that has been removed in Python 3.

W1620 dict-iter-method Message 'Calling a dict.iter*() method'

Description Used for calls to dict.iterkeys(), itervalues() or iteritems() (Python 3 lacks these methods)

W1633 round-builtin Message 'round built-in referenced'

Description Used when the round built-in is referenced (backwards-incompatible semantics in Python 3)

W1619 old-division Message 'division w/o future statement'

Description Used for non-floor division w/o a float literal or from future import division (Python 3 returns a float for int division unconditionally)

W1637 zip-builtin-not-iterating Message 'zip built-in referenced when not iterating'

Description Used when the zip built-in is referenced in a non-iterating context (returns an iterator in Python 3)

W1636 map-builtin-not-iterating Message 'map built-in referenced when not iterating'

Description Used when the map built-in is referenced in a non-iterating context (returns an iterator in Python 3)