AI-assisted dependency management

Advanced AI-Assisted Coding for Developers

Thalia Barrera

AI Engineering Curriculum Manager, DataCamp

The problem

Two computers showing different results

 

 

  • ✅ Atlas works on my machine
  • ❌ Installation fails on production server
  • 🔀 Same code, different results
Advanced AI-Assisted Coding for Developers

Dependency conflicts

 

Dependency conflict diagram

 

  • Atlas depends on many libraries
  • Environment not reproducible
  • Known as dependency conflicts
Advanced AI-Assisted Coding for Developers

AI analyzes the error

Installation error:

installation-error2.png

🤖 Short diagnosis prompt:

Here is my dependency specification and the installation error output. Explain the root cause of the version conflict.

Advanced AI-Assisted Coding for Developers
Advanced AI-Assisted Coding for Developers

Reproducible environments

 

  • 📦 One command creates exact environment
  • 🤖 AI can help generating the setup commands
  • 💻 Consistent environment across colleagues and machines

Reproducible environments

Advanced AI-Assisted Coding for Developers

Generating setup commands

🤖 Reproducible setup prompt:

Given this project structure, propose a reproducible Python environment setup using pip-tools. Generate the exact files and commands needed to create the environment, lock dependencies and install deterministically. Explain how to use the virtual environment in the README.md file of the project.

Model's response: ai-virtual-env.png

Advanced AI-Assisted Coding for Developers

Transitive dependencies

Transitive dependency diagram

 

  • 📦 Toolboxes pull in many packages
  • ❗ Vulnerable library pulled indirectly: transitive dependency

 

  • ✔ Detect issues with auditing tools
  • 🤖 AI interprets reports, suggests safer versions, and highlights code changes
Advanced AI-Assisted Coding for Developers

Maintainable dependencies

🤖 Dependency audit prompt:

Given this Python repository, I want to audit dependency maintainability and license compliance.

Generate the command to produce a JSON license report for the currently active Python environment, including package URLs and license files, and write it to reports/licenses.json.

  • ✔ Actively maintained = lower risk

 

AI response: ai-licenses.png

Advanced AI-Assisted Coding for Developers

Inspecting reports

AI suggestion: ai-licenses-command.png

Licenses report: licenses-output.png

Advanced AI-Assisted Coding for Developers

AI proposes alternatives

🤖 Alternatives prompt:

Here is reports/licenses.json from pip-licenses we just generated.

Summarize the results in a short table with: package, version, license, and risk level for commercial use. Flag anything unusual, unknown, or missing a license.

Propose one safer alternative for the single highest risk dependency.

AI response: models-risk.png

Advanced AI-Assisted Coding for Developers

Automating environment setup

Environment setup automation flow

 

 

  • 💻 One command setup for new devs
  • ✅ CI validates environment on every change
Advanced AI-Assisted Coding for Developers

Part of daily workflow

ai-ci-licenses-emergency.png

Advanced AI-Assisted Coding for Developers

Let's practice!

Advanced AI-Assisted Coding for Developers

Preparing Video For Download...