laktak / chkbit

Check your files for data corruption
MIT License
115 stars 7 forks source link

move cli under chkbit and reshuffle imports #9

Closed spock closed 11 months ago

spock commented 11 months ago

Related to #7 , but fixing a different problem - package namespace pollution with cli which is not a separate package but a part of chkbit. Works for me.

laktak commented 11 months ago

I'm not sure what I am polluting :) cli is using chkbit so it should not be under its namespace.

Is this related to the problem you had with packaging? If so I've added instructions to the readme.

https://github.com/laktak/chkbit-py#development

spock commented 11 months ago

Yes, related to installation. Thank you for providing instructions!

After this reshuffling I was able to do my usual pip install --user . (and also pip install --editable --user .) directly from the repository.

What I meant by "polluting" is that under python/site-packages folder there are two folders created: chkbit and cli, even though only chkbit package is being installed.

I don't know if that is standard practice, but it feels wrong to me.
I would expect each package to live under it's own "namespace" - derived from package name.
If this is not the case, then your cli module, while not being visible to pypi (because this is not the package name), may clash with some package that is called cli.
Right now I can only find cli2 and cli3 as existing package names; so if your module would be called cli2 or cli3 instead of cli, then there would be conflicts with those existing packages.

This PR appears to be opinion-based and is not necessarily the best solution (it's just the first that "worked for me" 😄 ).

laktak commented 11 months ago

Thank you for the explanation! I'm not happy with having cli under the chkbit namespace though so I hope you don't mind if I close this PR. To avoid conflicts I will rename cli to chkbit_cli.