8000 Unify Python dependencies and declare optional features by Napreth · Pull Request #832 · bkerler/edl · GitHub
[go: up one dir, main page]

Skip to content

Unify Python dependencies and declare optional features - #832

Open
Napreth wants to merge 2 commits into
bkerler:masterfrom
Napreth:fix/dependencies
Open

Napreth wants to merge 2 commits into
bkerler:masterfrom
Napreth:fix/dependencies

Conversation

@Napreth
@Napreth Napreth commented Oct 21, 2026
Copy link
Copy Markdown

Summary

Consolidate Python dependency declarations in pyproject.toml and separate optional features from the dependencies required by the main CLI tools.

Previously, pyproject.toml and requirements.txt maintained different dependency lists, so installing the package with pip or pipx could produce a different environment from installing the legacy requirements file.

This PR makes pyproject.toml the source of truth while retaining compatibility with existing source-based installation instructions.

Changes

Dependency declarations

  • Replace pycryptodome with pycryptodomex, matching the Cryptodome namespace used by the source code.
  • Remove unused direct dependency declarations, including lxml, pylzma, and paramiko.
  • Move Capstone and Keystone into the optional asm extra.
  • Add the optional qrcode extra with Pillow support for OnePlus factory QR code generation.
  • Keep dependencies required by the existing CLI tools in the base installation.

The optional features can be installed with:

pip install "edlclient[asm]"
pip install "edlclient[qrcode]"

Legacy requirements

  • Add .github/scripts/update_requirements.py to generate requirements.txt from pyproject.toml.
  • Keep both base and optional dependencies in the generated file to preserve the existing source installation workflow.
  • Add a --check mode to detect outdated generated requirements.
  • Update uv.lock and document the new dependency structure in the README.

Optional dependency handling

  • Defer Capstone and Keystone imports until their respective functionality is used.
  • Avoid printing missing-dependency warnings during normal CLI startup.
  • Provide actionable error messages when assembly or disassembly functionality is requested without the asm extra installed.

Testing

All four platform/Python combinations passed locally:

Platform Python Result
Linux (act) 3.10 Passed
Linux (act) 3.14 Passed
Windows (native) 3.10 Passed
Windows (native) 3.14 Passed

The test suite covers isolated installation of base and optional dependencies, wheel/sdist builds, dependency metadata consistency, and functional checks for assembly/disassembly and QR code generation.

No physical device operations were tested.

Scope

This PR focuses only on dependency management and optional features. It does not include the separate packaging or installation-script refactors.

Related to #830.

Generate legacy requirements from pyproject.toml, declare required cryptography support, and separate assembly and QR image extras. Add independent dependency resolution and optional-feature checks on the upstream package layout.

Refs: bkerler#830 (dependency management stage)
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

0