Skip to content

Commit

Permalink
Compression MIME addition and checksum identification expanded (#99)
Browse files Browse the repository at this point in the history
* Add updated MIME for GZIP files

* Split by all whitespace to make checksum identification more general

* Update CHANGELOG
  • Loading branch information
yashpatel6 authored Jul 8, 2024
1 parent cc1d3d4 commit c1c5364
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
---

## [Unreleased]

---

## [5.1.0] - 2024-07-08
### Added
- Add validation flowchart
- Add support for unmapped BAM
- Add additional MIME type for GZIP compressed files
- Add support for checksum files formatted with any whitespace separator

---

## [5.0.0] - 2024-02-16
Expand Down
2 changes: 1 addition & 1 deletion pipeval/generate_checksum/checksum.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def _validate_checksums(path:Path):
def _compare_hash(hash_type:str, path:Path, hash_path:Path):
''' Compares existing hash to generated hash '''
# Read only the hash and not the filename for comparison
existing_hash = hash_path.read_text().split(' ')[0].strip()
existing_hash = hash_path.read_text().split()[0].strip()

if hash_type == 'md5':
return existing_hash == _generate_md5(path)
Expand Down
1 change: 1 addition & 0 deletions pipeval/validate/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def _identify_compression(path:Path):
''' Identify compression type and returns appropriate file handler '''
compression_handlers = {
'application/x-gzip': gzip.open,
'application/gzip': gzip.open,
'application/x-bzip2': bz2.open
}

Expand Down

0 comments on commit c1c5364

Please sign in to comment.