destream-py / destream

A tool & Python 3 library to decompress anything
GNU General Public License v2.0
12 stars 1 forks source link

Apply `black -l 79` and do some code cleanup #22

Closed eumiro closed 3 years ago

eumiro commented 3 years ago

This is one time black -l 79 for the whole codebase without setting up any automatic tools (which we'll have to discuss and evaluate and agree on).

I also wanted to apply isort, but then following error came:

 ImportError while importing test module '/home/miro/src/destream/tests/test_30_decompressors.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../.pyenv/versions/3.9.0/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_30_decompressors.py:17: in <module>
    import destream
destream/__init__.py:2: in <module>
    from destream.decompressors import *
destream/decompressors/__init__.py:5: in <module>
    from destream.decompressors.bzip2 import *
destream/decompressors/bzip2.py:1: in <module>
    from destream import ExternalPipe
E   ImportError: cannot import name 'ExternalPipe' from partially initialized module 'destream' (most likely due to a circular import) (/home/miro/src/destream/destream/__init__.py)

so we're going to do it without isort now and then replace the from x import * with some more explicit import that will prevent such problems.

And then I did some code cleanup.

eumiro commented 3 years ago

Oh and this is the first part of the code style discussion in #18

jruere commented 3 years ago

@cecton would you like to review?

jruere commented 3 years ago

We should probably release soon after this.