-
Notifications
You must be signed in to change notification settings - Fork 2
Remove nchash dependency #25
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
Conversation
|
It will require code changes. Sorry if that wasn't clear. |
|
Just a comment, if you're running an opinionated python formatting tool it's best to do that as a separate commit so the functional bits can be viewed (and re-viewed) more easily. |
Crap - I've got ruff configured to format on save by default, I'll fix it up in vim. I think most of these changes are sensible but I'll get the formatting changes out and then request a review @aidanheerdegen - I'm not sure I fully grok the intent of some of the remaining broken tests. |
f7e316f to
4e72ab7
Compare
collected 16 items
test/test_manifest.py ..FF............ [100%]
========================================================================== FAILURES ==========================================================================
____________________________________________________________________ test_manifest_netcdf ____________________________________________________________________
def test_manifest_netcdf():
with cd(os.path.join('test','testfiles')):
mf1 = mf.Manifest('mf1.yaml')
for filepath in glob.glob('*.nc'):
mf1.add(filepath,['md5','sha1'])
mf1.dump()
with cd(os.path.join('test','testfiles_copy')):
mf2 = mf.Manifest('mf2.yaml')
for filepath in glob.glob('*.nc'):
mf2.add(filepath,['md5','sha1'])
mf2.dump()
# Unequal because they contain different fullpaths
assert(mf1.equals(mf2) == False)
# Equal when paths ignored
assert(mf1.equals(mf2,paths=False) == True)
# Test with array of filepaths
with cd(os.path.join('test','testfiles_copy')):
mf1 = mf.Manifest('mf1.yaml')
mf1.add(glob.glob('*.nc'),['binhash'])
mf1.add(hashfn=['md5','sha1'])
> assert(mf1.equals(mf2))
E assert False
E + where False = equals(<yamanifest.manifest.Manifest object at 0x1083ceb10>)
E + where equals = <yamanifest.manifest.Manifest object at 0x10850b350>.equals
test/test_manifest.py:148: AssertionError
_____________________________________________________________ test_manifest_netcdf_changed_time ______________________________________________________________
def test_manifest_netcdf_changed_time():
with cd(os.path.join('test','testfiles_copy')):
mf3 = mf.Manifest('mf3.yaml')
for filepath in glob.glob('*.nc'):
touch(filepath)
mf3.add(filepath,['md5','sha1'])
mf3.dump()
mf2 = mf.Manifest('mf2.yaml')
mf2.load()
> assert(not mf3.equals(mf2))
E assert not True
E + where True = equals(<yamanifest.manifest.Manifest object at 0x10842c550>)
E + where equals = <yamanifest.manifest.Manifest object at 0x10850bbd0>.equals
test/test_manifest.py:165: AssertionError |
|
I'm wondering why the test break. As for the second test if it doesn't have |
|
Bit of a left-field idea - I've been rewriting manageable sized stuff in Rust recently as a learning exercise - nchash is a pretty small package - does it make any sense at all to use a Rust-reimplementation of nchash which would be completely dependency free & avoid having to clean out the tests? Made a fair whack of progress with the reimplentation already |
As a change detection hash though it is limited to only netCDF files, so was quite limited in that regarded. I'd just remove |
a95fb77 to
4e72ab7
Compare
aidanheerdegen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks.
|
@aidanheerdegen Are you happy for me to trigger a new release with the removed dependency? |
|
Sure, go for it |
The yamanifest conda package requires nchash
Based on discussions with @charles-turner-1 and @aidanheerdegen the package is not used any more and the dependency to nchash should be removed.