AI-powered Python dependency fixer using Gemini.
Project description
pydepdoctor
pydepdoctor is a CLI tool that automatically fixes Python dependency conflicts in your requirements.txt using Google's Gemini AI.
Features
- Automated Fixes: Detects installation errors and asks Gemini to resolve version conflicts.
- Safe: Only updates versions; does not add new packages.
- Retry Loop: Retries installation up to 5 times until successful.
- Cross-Platform: Works on Windows, macOS, and Linux.
Installation
You can install pydepdoctor directly from PyPI:
pip install pydepdoctor
Global Installation (Recommended)
For a CLI tool like this, it is best to install it globally using pipx so it's available everywhere:
pipx install pydepdoctor
Install from Source
If you want to install from the source code:
- Clone the repository.
- Navigate to the root directory.
- Install using pip:
pip install .
Usage
1. Initialize
First, set up your Gemini API key:
pydepdoctor init
You will be prompted to enter your API key. It will be validated and saved locally.
2. Fix Dependencies
Navigate to a project with a problematic requirements.txt and run:
pydepdoctor fix
The tool will:
- Try to install dependencies.
- If it fails, capture the error.
- Send the error and
requirements.txtto Gemini. - Apply the fix and retry.
Running as a Module
You can also run pydepdoctor directly as a Python module. This is useful if the CLI command is not in your PATH or if you prefer this style:
python -m pydepdoctor
This is equivalent to running pydepdoctor fix. You can also pass commands:
python -m pydepdoctor init
python -m pydepdoctor fix
Requirements
- Python 3.7+
- A valid Google Gemini API Key
License
MIT
Project details
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 pydepdoctor-0.1.1.tar.gz.
File metadata
- Download URL: pydepdoctor-0.1.1.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8249b53067716060976fbc8080ca2a98f8619e66ae467c8f6815607919b9fc63
|
|
| MD5 |
8467556a895d7bc80c8894b92b093e0e
|
|
| BLAKE2b-256 |
00843775e2c2fc96edff75644d9ed3c3cb623559c145cabf7d7db13dda57ffcf
|
File details
Details for the file pydepdoctor-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pydepdoctor-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3ceb79312c52c43a0ea22f380e5cc2e46a022d526a2253ce3bd3592ad834825
|
|
| MD5 |
a446b689569928f47c0544aded9e80f2
|
|
| BLAKE2b-256 |
d43bf534d1687f111d28f8ba4e6daabb5fd6f65325a4f6046470a84b5b4b8b99
|