Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Jan 13, 2021
Merged

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

merged 5 commits into from
Jan 13, 2021

Conversation

eumiro
Copy link
Member

@eumiro eumiro commented Jan 12, 2021

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
Copy link
Member Author

eumiro commented Jan 12, 2021

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

Copy link
Contributor

@jruere jruere left a comment

Choose a reason for hiding this comment

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

I prefer the artisanal formatting a little more but removing coding style from the table altogether is priceless.

destream/archive.py Show resolved Hide resolved
@jruere
Copy link
Contributor

jruere commented Jan 12, 2021

@cecton would you like to review?

@jruere
Copy link
Contributor

jruere commented Jan 12, 2021

We should probably release soon after this.

Copy link
Collaborator

@cecton cecton left a comment

Choose a reason for hiding this comment

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

Except for that weird inconsistency about self vs cls and the author in setup.py I think it's great!

I just remember there is another project linked to this one that could be moved to the same organization. I will do that later.

destream/archive.py Show resolved Hide resolved
destream/archive.py Show resolved Hide resolved
_mimes = ["application/x-xz"]
_extensions = ["xz"]
_command = "unxz -c".split()
_compression = "xz"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure what logic I used for the prefix with _. It might be worth revisiting this in a different ticket

setup.py Outdated Show resolved Hide resolved
@eumiro eumiro merged commit b6b1a0e into destream-py:main Jan 13, 2021
@eumiro eumiro deleted the black-cleanup branch January 13, 2021 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants