Skip to main content

Modern Python dependency and project manager with custom resolver, lock files, and comprehensive tooling (pydep CLI).

Project description

PyDepM - Python Dependencies & Projects Manager

Simple, fast, and modern Python project manager. Initialize projects, manage dependencies, build distributions, and publish to PyPI—all from one command.


Features

  • Initialize Projects — Create modules or apps with automatic environment setup
  • Manage Dependencies — Add, remove, update, with dev and optional groups
  • Lock Files — Auto-generate pydepm.lock for reproducible builds (TOML format)
  • Install — Install dependencies, dev-dependencies, and optional groups
  • Exact Versions — Automatically save exact versions (e.g., ==1.2.3) for reproducibility
  • Smart Updates — Check for outdated packages before updating, batch update with confirmation
  • Build — Create wheels, sdist, or PyInstaller apps
  • Audit — Check for dependency issues and security vulnerabilities
  • Publish — Upload to PyPI or TestPyPI with automated token management
  • Custom Scripts — Define and run scripts from pyproject.toml
  • Beautiful CLI — Progress bars, colors, interactive prompts, versioning

🚀 Quick Start

1. Install

pip install pydepm

Check version:

pydep -v
# or
pydep --version

2. Create a Project

pydep init my_project --type module --env venv
cd my_project

3. Add Dependencies

pydep add requests              # Add to project
pydep add -D pytest             # Add to dev (-D = --save-dev)
pydep add -G docs sphinx        # Add to group (-G = --group)
pydep add -F unknown-pkg        # Force add even if not found (skip checks)

Each add command:

  • Shows progress for each package
  • Automatically detects and saves exact versions
  • Updates pydepm.lock with installed versions
  • With -F/--force: Ignores if already declared, forces update

4. Remove Dependencies

pydep remove requests           # Remove from project
pydep remove -D pytest          # Remove from dev
pydep remove -F old-package     # Force remove even if not found

With -F/--force: Attempts uninstall even if not in pyproject.toml

5. Install & Lock

pydep install                   # Install all dependencies
# Automatically updates pydepm.lock with exact versions

6. Update Dependencies

Update single dependency:

pydep update requests           # Updates to latest, saves exact version
pydep update -F requests>=2.0   # Force update, adds if not present

Update all outdated dependencies:

pydep update                    # Checks for outdated, shows list, asks for confirmation
pydep update -y                 # Skip confirmation
pydep update -F                 # Force update all (skip outdated check)
pydep update -F -y              # Force update all without confirmation

7. Build & Publish

pydep build                     # Create distributions
pydep publish                   # Upload to PyPI

All Commands

Command Purpose
pydep -v / --version Show version
pydep init Create new project
pydep add <pkg> Add dependency
pydep remove <pkg> Remove dependency
pydep update [<spec>] Update one or all dependencies
pydep list [-D] [-G <x>] List dependencies
pydep install [-D] [-G <x>] Install all (auto-updates lock)
pydep lock [-D] [-G <x>] Generate lock file manually
pydep build Build wheel/sdist
pydep run <script> Run custom script
pydep audit Check for issues
pydep security-audit Scan for CVE
pydep fix Fix conflicts
pydep publish Upload to PyPI

Shorthand flags (work with most commands):

  • -D = --save-dev (dev dependencies)
  • -G = --group (optional groups)
  • -g = --global (use system Python)
  • -F = --force (skip confirmations and checks)
  • -y = --yes (skip confirmation prompts)

Command-specific flags:

  • update uses -F to skip outdated check or force update non-declared deps
  • add uses -F to force-add even if already declared
  • remove uses -F to force-remove even if not found

See Full Reference for all options and examples.


Lock Files

PyDepm automatically manages pydepm.lock files:

  • Auto-create/update: Every install, add, and update command updates the lock file
  • Reproducible builds: Lock file contains exact versions for all dependencies
  • Format: TOML with metadata (Python version, creation time, pyproject.toml hash)
  • Group support: Maintains proper placement of dependencies in their groups
[metadata]
version = "1.0"
created_at = "2024-04-04T10:30:00Z"
python_version = "3.11"
pyproject_hash = "abc123..."

[dependencies.requests]
version = "2.31.0"
specifier = "==2.31.0"

[dependencies.pytest]
version = "7.4.0"
specifier = "==7.4.0"

Version Pinning

PyDepm automatically saves exact versions to pyproject.toml:

[project]
dependencies = [
    "requests==2.31.0",  # Exact version saved
    "rich==13.5.2",
]

[tool.pydepm]
dev-dependencies = [
    "pytest==7.4.0",
    "black==23.9.1",
]

This ensures:

  • ✅ Reproducible builds across environments
  • ✅ No surprises from auto-updating transitive dependencies
  • ✅ Easy to spot version changes in git diffs

Configuration

All settings in pyproject.toml:

[project]
name = "my-project"
version = "0.1.0"
description = "My project"
requires-python = ">=3.11"

[tool.pydepm]
type = "module"     # or "app"
python-version = "3.11"

[tool.pydepm.env]
type = "venv"           # "venv", "conda", or "global"

[tool.pydepm.scripts]
test = "pytest -v"
lint = "ruff check ."

[project.dependencies]
requests = ">=2.28.0"

[project.optional-dependencies]
dev = ["pytest>=7.0", "black"]
docs = ["sphinx"]

See Configuration Guide for all options.


Lock Files

pydepm.lock stores exact versions:

[metadata]
version = "1.0"
created-at = "2024-04-04T10:30:00Z"
python-version = "3.11"

[resolved]
requests = "2.31.0"
urllib3 = "2.1.0"

Generate with: pydep lock


Project Structure

After pydep init my_project:

my_project/
├── pyproject.toml
├── .gitignore
├── src/my_project/
│   ├── __init__.py
│   └── module.py
├── tests/
│   └── __init__.py
└── .venv/

Common Usage

Create a Library

pydep init mylib --type module
cd mylib
pydep add requests
pydep add pytest -D
pydep build

Create an Application

pydep init myapp --type app
cd myapp
pydep add click rich
pydep build      # Creates executable via PyInstaller

Manage Multiple Dependency Groups

pydep add sphinx -G docs
pydep add pytest -G test
pydep install -G test,docs

Run in CI/CD

# Developer: lock versions
pydep lock
git add pydepm.lock

# CI: install exact versions
pydep install

Documentation

Document Purpose
CLI Reference All commands & flags
Configuration pyproject.toml spec
Lock Format Lock file structure
Architecture How it works
Examples Real-world recipes
Contributing Contribute to PyDepm

Custom Scripts

Define scripts in pyproject.toml:

[tool.pydepm.scripts]
test = "pytest -v"
lint = "ruff check ."
format = "black . && ruff --fix ."
docs = "sphinx-build docs/ build/docs"

Run with:

pydep run test
pydep run lint

Security

pydep audit              # Check for issues
pydep security-audit     # Scan for CVE vulnerabilities
pydep fix                # Fix conflicts
pydep fix --force        # Aggressive fixing

📦 Installation

From PyPI (Recommended)

pip install pydepm

Development

git clone https://github.com/ZtaMDev/pydepm.git
cd pydepm
pip install -e .

Verify

python scripts/quick_validation.py

Why PyDepm?

Feature Poetry Pipenv Pydepm
Dependency management
Easy init
Lock files
App bundling
Simple & fast ⚠️ ⚠️

🤝 Contributing

Contributions welcome! See Contributing Guide.


License

MIT License — See LICENSE


** Ready?** Run: pydep init my_first_project

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

pydepm-1.1.3.tar.gz (48.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydepm-1.1.3-py3-none-any.whl (50.6 kB view details)

Uploaded Python 3

File details

Details for the file pydepm-1.1.3.tar.gz.

File metadata

  • Download URL: pydepm-1.1.3.tar.gz
  • Upload date:
  • Size: 48.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for pydepm-1.1.3.tar.gz
Algorithm Hash digest
SHA256 cc325af76eb2974b21055b94535fea56d6d733c76379e87ca10a0b6ad7f2f0ba
MD5 3e998486ce5998fafe0cc7c6e9a677de
BLAKE2b-256 dea3cf43bfe6859e63dd104e920d6889a7271ad698afbf3ee939e13b6a5d04bf

See more details on using hashes here.

File details

Details for the file pydepm-1.1.3-py3-none-any.whl.

File metadata

  • Download URL: pydepm-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 50.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for pydepm-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 684c1090e4243a3360df6d573f823194fdad9757d199f768dcd43f049249e680
MD5 45ca5a6fe101cc9deec0e259814cb0ce
BLAKE2b-256 7f0b7fa75b8ef6d9a5d00e6dcd91a44c79dcf36b200a4b408fabe344e498e5ab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page