A tool to interactively resolve Python wheel dependencies.
Project description
Interactive Dependency Resolver
A tool to interactively resolve Python wheel dependencies.
This tool is particularly useful for:
- Reproducing historical development environments
- Debugging "dependency hell" scenarios
- Creating reproducible builds
Features
- Interactive wheel version selection – Users choose between available versions for each wheel.
- Conflict detection – Automatically checks if selected versions satisfy dependencies.
- Layer-by-layer resolution – Processes dependencies in BFS order, one layer at a time.
- Rollback on conflict – If a conflict is found, reverts to the layer where the conflicting wheel was chosen.
- Version Compatibility: Supports both Python 2 and 3 environments.
Running Example
This tool is not guaranteed to succeed. Thus, you should run this tool in a clean virtual environment set up with venv, conda, etc. to prevent contaminating your existing environment.
Installation
pip install interactive-dependency-resolver
After installation, run it as interactive_dependency_resolver.
Resolving a Python 2.7 Data Science Stack (as of 2020-01-01)
interactive_dependency_resolver numpy scipy matplotlib pandas scikit-learn opencv-python torch --date 2020-01-01
Sample output:
Resolving layer 1 requirements...
Handling requirement `matplotlib`
Getting compatible wheel versions for `matplotlib`...
Select a version for `matplotlib`:
1. 2.2.4 (released on 2019-03-01)
2. 2.2.3 (released on 2018-08-11)
...
Enter a number (1-13): 1
Getting next layer requirements from `matplotlib==2.2.4`...
The tool will:
- Present available versions for each wheel
- Guide you through version selection
- Show added dependencies in subsequent layers
Final Output Example:
Final selected versions:
numpy==1.16.6
scipy==1.2.2
matplotlib==2.2.4
pandas==0.24.2
scikit-learn==0.20.4
opencv-python==4.1.2.30
torch==1.3.1
Requirements without compatible wheels:
future
For Packages Without Compatible Wheels
When the resolver shows "Requirements without compatible wheels", you must:
- Manually verify on PyPI (https://pypi.org/).
- Check for:
- Platform-specific wheels (may need to run on different OS)
- Source distributions (
.tar.gz) that can be built manually
Common Scenarios
Case 1: Platform-specific wheels
For torch in Python 2.7:
- Linux: Has wheels
- Windows: No wheels -> Must use Linux or build from source
Case 2: Pure Python packages
Like future:
# Can safely install from source
pip install --no-deps future==1.0.0
Case 3: C-extensions without wheels
Like subprocess32:
# Requires build tools
sudo apt-get install python-dev # Debian/Ubuntu
pip install --no-deps subprocess32
Installing the Resolved Environment
You MUST use --no-deps with pip install to prevent automatic dependency resolution:
pip install --no-deps numpy==1.16.6 scipy==1.2.2 matplotlib==2.2.4 pandas==0.24.2 scikit-learn==0.20.4 opencv-python==4.1.2.30 torch==1.3.1
pip install --no-deps future # install from source
Then, you MUST run pip check and check for hidden dependencies:
matplotlib 2.2.4 requires cycler, which is not installed.
matplotlib 2.2.4 requires kiwisolver, which is not installed.
Use the tool to resolve these additional dependencies and repeat the verification process.
How It Works
- Queries PyPI JSON API for package metadata
- Filters versions by:
- Release date (before specified cutoff)
- Wheel compatibility with current platform
- Version constraints
- Builds dependency graph layer by layer
- Handles conflicts by rolling back decisions when necessary
Platform Considerations
- Wheel compatibility is automatically evaluated for your current platform
- For cross-platform resolution, execute the tool on the target system
Known Limitations
- May miss some implicit dependencies (e.g.,
matplotlib's optional dependencies) - Requires manual intervention for some complex dependency conflicts
Contributing
Contributions are welcome! Please submit pull requests or open issues on GitHub.
License
AGPL-3.0 - See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file interactive_dependency_resolver-0.1.0a2.tar.gz.
File metadata
- Download URL: interactive_dependency_resolver-0.1.0a2.tar.gz
- Upload date:
- Size: 19.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1257bc59964e0609a5a2e3b67c693be719363d8c4dd992064f1a0f20d665985a
|
|
| MD5 |
519faa3a2c14e77581c9fc8090deffb6
|
|
| BLAKE2b-256 |
5e432ac6c397cc3f6cebdd4c962b07c66259abe7e3c0092dbac7e91627971b66
|
File details
Details for the file interactive_dependency_resolver-0.1.0a2-py2.py3-none-any.whl.
File metadata
- Download URL: interactive_dependency_resolver-0.1.0a2-py2.py3-none-any.whl
- Upload date:
- Size: 20.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d00cbdb89ec464d38d3a8a383efa56670a873050982a561e4c5b680ded4e18f
|
|
| MD5 |
78981e9855c5932a0dbf2ef343a27bb9
|
|
| BLAKE2b-256 |
f376145b480c5a91352e27429deac8bd414d91a7e212d02f6c9f993ae661bd97
|