Skip to content

Use native 7z to extract files and calculate hashes #2232

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

Merged
merged 4 commits into from
Aug 8, 2025
Merged

Conversation

gantoine
Copy link
Member

@gantoine gantoine commented Aug 7, 2025

Description
Explain the changes or enhancements you are proposing with this pull request.

py7zr adds 30MB+ to the image size in useless dependencies for "compatibility". This PR replaces it with the native 7zip/p7zip library, opting to call sub-processes and parse the output.

Checklist
Please check all that apply.

  • I've tested the changes locally
  • I've updated relevant comments
  • I've assigned reviewers for this PR
  • I've added unit tests that cover the changes

@gantoine gantoine changed the title [exp] Use cli 7z to calc file hashes [EXP] Use cli 7z to calc file hashes Aug 7, 2025
@gantoine gantoine changed the title [EXP] Use cli 7z to calc file hashes Use cli 7z to calc file hashes (experimental) Aug 7, 2025
Copy link

trunk-io bot commented Aug 7, 2025

Running Code Quality on PRs by uploading data to Trunk will soon be removed. You can still run checks on your PRs using trunk-action - see the migration guide for more information.

Copy link

github-actions bot commented Aug 7, 2025

Test Results

548 tests  ±0   547 ✅ ±0   1m 0s ⏱️ ±0s
  1 suites ±0     1 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit c47be72. ± Comparison against base commit 3f98ef6.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Aug 7, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
8790 6170 70% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
backend/handler/filesystem/roms_handler.py 72% 🟢
backend/utils/archive_7zip.py 20% 🟢
TOTAL 46% 🟢

updated for commit: c47be72 by action🐍

@gantoine gantoine requested review from adamantike and Copilot August 7, 2025 22:03
@gantoine gantoine changed the title Use cli 7z to calc file hashes (experimental) Use native 7z to extract files and calculate hashes Aug 7, 2025
@gantoine gantoine marked this pull request as ready for review August 7, 2025 22:04
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces the py7zr Python library dependency with system-level 7zip CLI tool for calculating file hashes from 7zip archives. The change moves from a Python-based approach to executing the system's 7zip binary.

  • Removes py7zr dependency from pyproject.toml and associated imports
  • Implements new CLI-based 7zip processing using subprocess calls
  • Updates Docker configurations to use appropriate 7zip packages
  • Removes unrelated frontend navigation code

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pyproject.toml Removes py7zr dependency
backend/utils/archive_7zip.py Complete rewrite to use CLI 7z instead of py7zr library
backend/handler/filesystem/roms_handler.py Updates imports and function calls to use new CLI-based approach
docker/Dockerfile Changes from 7zip to p7zip package
Dockerfile Changes from p7zip to p7zip-full package
frontend/src/views/Gallery/Search.vue Removes navigation logic (unrelated to 7z changes)
frontend/src/views/Gallery/Collection/BaseCollection.vue Removes navigation logic (unrelated to 7z changes)
frontend/src/components/Details/States.vue Adds explicit TypeScript type annotation

@gantoine gantoine merged commit de42333 into master Aug 8, 2025
10 checks passed
@gantoine gantoine deleted the native-7z-parse branch August 8, 2025 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant