-
Notifications
You must be signed in to change notification settings - Fork 0
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
Support all tar archives in create and extract #166
Conversation
Reviewer's Guide by SourceryThis pull request extends the support for TAR archives in the Sequence diagram for improved archive creation processsequenceDiagram
participant Client
participant CreateArchive
participant ArchiveHandlers
participant FileSystem
Client->>CreateArchive: create_archive(root, files, archive)
CreateArchive->>ArchiveHandlers: Get handler for extension
alt zip format
ArchiveHandlers-->>CreateArchive: Return ZIP handler
CreateArchive->>FileSystem: Write files using ZIP_DEFLATED
else tar format
ArchiveHandlers-->>CreateArchive: Return appropriate TAR handler
Note right of ArchiveHandlers: Supports tar, tar.gz, tar.bz2, tar.xz
CreateArchive->>FileSystem: Write files using selected compression
end
CreateArchive-->>Client: Archive created
Sequence diagram for enhanced archive extraction processsequenceDiagram
participant Client
participant ExtractArchive
participant Archive
participant FileSystem
Client->>ExtractArchive: extract_archive(archive, destination)
alt zip format
ExtractArchive->>Archive: Open as ZIP
Archive->>FileSystem: Extract members
else tar format
ExtractArchive->>Archive: Check if tarfile
Archive->>FileSystem: Extract members with appropriate handler
end
ExtractArchive-->>Client: Return extracted files
Class diagram for archive handlers structureclassDiagram
class ArchiveHandlers {
+Dict handlers
+handle_zip()
+handle_tar()
+handle_tar_gz()
+handle_tar_bz2()
+handle_tar_xz()
}
class CreateArchive {
+create_archive(root, files, archive)
}
class ExtractArchive {
+extract_archive(archive, destination)
+extract_zip(archive)
+extract_tar(archive)
}
CreateArchive --> ArchiveHandlers
ExtractArchive --> ArchiveHandlers
note for ArchiveHandlers "New unified handler system"
note for ExtractArchive "Refactored with separate
extraction methods"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @hagenw - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files
|
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.
Single issues have been discussed in separate threads.
As these are resolved I think that it will be safe to proceed and give approval.
This adds support to not only create and extract
tar.gz
files, but all othertar
files as well.In addition,
audeer.create_archive()
andaudeer.extract_archive()
were slightly refactored to improve the code quality.Updated docstring of
audeer.create_archive()
:Updated docstring of
audeer.extract_archive()
:Updated docstring of
audeer.extract_archives()
:Summary by Sourcery
Extend archive creation and extraction to support all tar formats, including tar, tar.gz, tar.bz2, and tar.xz.
New Features:
Tests: