Giter Site home page Giter Site logo

cfv's People

Contributors

lxp avatar mkoppmann avatar mtausig avatar sbraz avatar stevenxxiu avatar vestingz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cfv's Issues

Update README

The README should contain updated install instructions and requirements.

Add macOS support

Currently, there are a few issues, why cfv including the test suite does not run on macOS. We have to investigate the issues and fix them.

I consider shifting back macOS support to a later release. If anyone wants to use cfv on macOS, please speak up.

Investigate and fix deprecation warnings

Some deprecated modules and functions are used. We have to investigate those and move them to a proper supported module/function.

Python provides the -W error argument to ease finding such issues. For example:

$ python3 -W error test/test.py
Traceback (most recent call last):
  File "test/test.py", line 48, in <module>
    import cfvtest
  File "/[...]/cfv/test/cfvtest.py", line 26, in <module>
    import imp
  File "/usr/lib/python3.6/imp.py", line 33, in <module>
    DeprecationWarning, stacklevel=2)
DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses

Once fixed, we should also add these Python flags in our CI pipeline.

Static typing with e.g. mypy

Hello,

I noticed cfv does not use type hints. Type hints and type checkers such as mypy are great aids for making robust code. Strongly recommended.

Cheers,
J

Add Windows support

Currently, there are a few issues, why cfv including the test suite does not run on Windows. We have to investigate the issues and fix them.

Add support for BLAKE3 (b3sum files)

Hello,

Big thanks for reviving the cfv project! I just installed it and it works great Have you considered adding Blake 3 support? It is a very fast hash algo.

My other feature request is an option to update the hash only if the file modify time is later than then checksum file.

Cheers,

J

Test suite expects `/data1` to not exists

As reported by @Terry-Kennedy, a test case fails, when /data1 exists: #8 (comment)

>>> failed test: /sysprog/terry/cfv-python3/test/cfv -ZNVRMUI --unquote=no --fixpaths="" --strippaths=0 --showpaths=autorelative --progress=no --announceurl=url --noprivate_torrent --strippaths=none -T -f teststrip-none.csv4 
/data1 : file size does not match (13!=33)
teststrip-none.csv4: 1 files, 0 OK, 1 badsize.  0.000 seconds, 0.0K/s
FAILED (4)
  File "test/test.py", line 1876, in <module>
  File "test/test.py", line 1719, in all_tests
  File "test/test.py", line 269, in test_generic
  File "test/test.py", line 254, in test_log_results
  File "test/test.py", line 237, in test_log_finish

It is bad practice that the test suite makes assumptions about things outside it's own scope (i.e. temp directory). However, the test case cannot easily be adjusted without modifying it's intention. Therefore, we just change the expected test outcome, depending on if the /data1 exists or not. Leaving only an unexpected error, if someone has a file /data1 with exactly the same content as https://github.com/cfv-project/cfv/blob/python3/test/testdata/data1.

Bash cfv tool

Hello,

I haven't been able to run the Python 2.7 based cfv for years on a stock Ubuntu due to some dependencies. As a long-time user of (Python-based) cfv, I decided to write a Bash script to do roughly the same thing and with less dependencies to "often" (once a decade) changing libs, modules. Just in case someone is interested.

Bash bcfv

"Tested and works on Linux"

Refactor Test Suite for use in CI

The most severe issues are already resolved.
However, it would be nice to be able to run unit tests, short CLI tests and long CLI tests separately.

Fix flake8 issues

Flake8 is currently running in non-fatal mode in our CI because of some issues.
We should fix the issues and make flake8 fail our pipeline again.

$ flake8 --exclude=build,venv --ignore= --max-line-length=200 --max-complexity=75 --show-source --statistics .
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/2.7.18/x64
./lib/cfv/osutil.py:112:78: E741 ambiguous variable name 'I'
def strippath(filename, num='a', _splitdrivere=re.compile(r'[a-z]:[/\\]', re.I)):
                                                                             ^
./lib/cfv/common.py:738:34: E741 ambiguous variable name 'l'
    def do_test_chksumline(self, l):
                                 ^
./lib/cfv/common.py:900:34: E741 ambiguous variable name 'l'
    def do_test_chksumline(self, l):
                                 ^
./lib/cfv/common.py:1400:34: E741 ambiguous variable name 'l'
    def do_test_chksumline(self, l):
                                 ^
./lib/cfv/common.py:1505:34: E741 ambiguous variable name 'l'
    def do_test_chksumline(self, l):
                                 ^
./lib/cfv/common.py:1537:34: E741 ambiguous variable name 'l'
    def do_test_chksumline(self, l):
                                 ^
./lib/cfv/common.py:1572:34: E741 ambiguous variable name 'l'
    def do_test_chksumline(self, l):
                                 ^
./lib/cfv/common.py:1649:34: E741 ambiguous variable name 'l'
    def do_test_chksumline(self, l):
                                 ^
./lib/cfv/strutil.py:6:14: E741 ambiguous variable name 'l'
def safesort(l):
             ^
./test/cfvtest.py:49:26: E741 ambiguous variable name 'l'
    def writelines(self, l):
                         ^
10    E741 ambiguous variable name 'l'
Error: Process completed with exit code 1.

Fix clipping of max open files in CI pipeline

In the CI pipeline the maximum number of open file descriptors is clipped to 4096 for the manyfiles_test:

max open files is big (65536) clipping to 4096.  Use --long to try the real value

Therefore, the manyfiles_test cannot really detect issues with leaking file descriptors. We should reduce the maximum number of open file descriptors limit to <=4096 before running the tests in the CI pipeline. We can do this with ulimit -n 4096.

Flake fails

Running the code style checker flake as expected by the CI script currently causes some errors:

$ flake8 --exclude=build,venv --ignore= --max-line-length=200 --max-complexity=75 --show-source --statistics .
./lib/cfv/common.py:738:34: E741 ambiguous variable name 'l'
    def do_test_chksumline(self, l):
                                 ^
./lib/cfv/common.py:900:34: E741 ambiguous variable name 'l'
    def do_test_chksumline(self, l):
                                 ^
./lib/cfv/common.py:1400:34: E741 ambiguous variable name 'l'
    def do_test_chksumline(self, l):
                                 ^
./lib/cfv/common.py:1505:34: E741 ambiguous variable name 'l'
    def do_test_chksumline(self, l):
                                 ^
./lib/cfv/common.py:1537:34: E741 ambiguous variable name 'l'
    def do_test_chksumline(self, l):
                                 ^
./lib/cfv/common.py:1572:34: E741 ambiguous variable name 'l'
    def do_test_chksumline(self, l):
                                 ^
./lib/cfv/common.py:1649:34: E741 ambiguous variable name 'l'
    def do_test_chksumline(self, l):
                                 ^
./lib/cfv/osutil.py:112:78: E741 ambiguous variable name 'I'
def strippath(filename, num='a', _splitdrivere=re.compile(r'[a-z]:[/\\]', re.I)):
                                                                             ^
./lib/cfv/strutil.py:6:14: E741 ambiguous variable name 'l'
def safesort(l):
             ^
./test/cfvtest.py:49:26: E741 ambiguous variable name 'l'
    def writelines(self, l):
                         ^
10    E741 ambiguous variable name 'l'

Investigate and fix `bytes` to `str` conversation using `str()`

There still seem to be a lot of uses of str() to convert from bytes to str. We have to investigate those and move them to a proper decoding using something like .decode(correct_encoding).

Python provides the -bb argument to ease finding such issues. For example:

$ python3 -bb test/test.py --exit-early
>>> testing...
...........................Traceback (most recent call last):
  File "test/test.py", line 1874, in <module>
    failed += all_tests()
  File "test/test.py", line 1620, in all_tests
    ren_test(fmt)
  File "test/test.py", line 913, in ren_test
    flscmp(b'1', 0, flsf)
  File "test/test.py", line 897, in flscmp
    test_log_results('cmp %s for %s' % (fn, t), r, o, r, None)
BytesWarning: str() on a bytes instance

Once fixed, we should also add these Python flags in our CI pipeline.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.