cfv-project / cfv

Command-line File Verify
GNU General Public License v2.0
58 stars 10 forks source link

Add support for GNU coreutils b2sum files #9

Open lxp opened 5 years ago

lxp commented 5 years ago

Implemented in GNU coreutils with this commit: https://github.com/coreutils/coreutils/commit/ea94589e9ef02624a3837f97f80efd7d3dcf56bf

mtausig commented 4 years ago

How are external dependencies handled by this project? Right now, there do not appear to be any. Would a new one be acceptable?

lxp commented 4 years ago

Currently, there is no mechanism to manage external dependencies. However, there is also no hard-dependency yet, as most functionality works fine with just the Python standard library. You can find the optional dependencies in the README: https://github.com/cfv-project/cfv/blob/master/README.md#optional These functions simply do not work or use some other implementations, when they are not available.

One option would be to use setuptools for dependencies, as it is already used anyway. However, I am not sure, if it is easy to specify optional dependencies. What other options are there to manage dependencies in Python?

mtausig commented 4 years ago

What other options are there to manage dependencies in Python?

We could add a requirements.txt file whose contents gets installed by pip.

lxp commented 4 years ago

We could add a requirements.txt file whose contents gets installed by pip.

The project is also distributed via PyPI, so the dependencies should be automatically pulled when doing a pip install cfv. Does this work, when we just have a requirements.txt?

mtausig commented 4 years ago

You have to put them in setup.py as well iirc. If you are not opposed to having a dependency, I will give it a shot.

As an alternative, there would be a pure-python blake2b implementation, but that is of course not competitive performance-wise.

lxp commented 4 years ago

I am not against adding dependencies, especially, if there are some good libraries for the job. Also, performance is a relevant factor for cfv. Please keep in mind that the library should be available via PyPI, run on Python 2.7/3 and there are bonus points, if it is already available as a Debian package, as we want to have a cfv Debian package again in the future too.

lxp commented 3 years ago

Since Python 3.6 hashlib suports BLAKE2 [1]. If the hashlib support is enough for supporting GNU coreutils b2sum, then I would opt for using it.

In any case, please consider implementing it in cfv 3.x (currently the python3 branch), as no feature releases are planned for cfv 2.x (currently the master branch).

[1] https://docs.python.org/3/library/hashlib.html#blake2