Testing guide for DPM features.
# clone the repository
git clone https://github.com/yomnahisham/dpm.git
cd dpm
# install in development mode
pip install -e .
# verify installation
dpm --versionRun unit tests:
# test version parsing and comparison
python3 tests/unit/test_version.py
# test dependency parsing
python3 tests/unit/test_dependency.py
# test graph operations
python3 tests/unit/test_graph.py
# run all tests
python3 tests/unit/test_version.py && \
python3 tests/unit/test_dependency.py && \
python3 tests/unit/test_graph.pydpm search requests
dpm search flask
dpm search express # npm packagedpm info requests
dpm info numpy
dpm info lodash # npm package# single package
dpm resolve requests
# multiple packages
dpm resolve flask django
# see the dependency tree
dpm tree flask
dpm tree requestsdpm lock requests flask
cat dpm.lock # view the lock file# install specific packages
dpm install requests
# install from lock file (after running lock command)
dpm installdpm listdpm remove requests# create a venv
dpm venv create myenv
# check status
dpm venv status
# detect existing environments
dpm venv detect
# use existing environment
dpm venv use conda# initialize manifest
dpm init myproject 1.0.0
# view manifest
cat dpm.json# pin a package
dpm pin requests@2.32.5
# unpin a package
dpm unpin requests# export to requirements.txt
dpm export requirements.txt
# export to package.json
dpm export package.json# show cache info
dpm cache info
# list cached entries
dpm cache list
# clear cache
dpm cache cleardpm outdated# preview what would be removed
dpm clean --dry-run
# actually remove
dpm clean# list repositories
dpm repo list
# add repository
dpm repo add myrepo https://example.com/repo
# remove repository
dpm repo remove myrepodpm resolve requests
# should show: requests, urllib3, idna, charset_normalizer, certifidpm tree flask
# should show flask and all its dependencies in tree formatdpm resolve numpy pandas matplotlib
# should resolve all three with their dependenciesdpm info express
dpm resolve lodash# create lock file
dpm lock requests flask
# verify lock file exists
cat dpm.lock
# install from lock file
dpm install
# should use versions from lock filedpm tree django
# should show django with all nested dependencies# initialize project
dpm init myproject 1.0.0
# install packages (adds to manifest)
dpm install requests
# view manifest
cat dpm.json
# pin a package
dpm pin requests@2.32.5
# unpin
dpm unpin requests# create lock file
dpm lock requests flask
# export to requirements.txt
dpm export requirements.txt
cat requirements.txt
# export to package.json
dpm export package.json
cat package.json# first, resolve with network (populates cache)
dpm resolve requests
# then resolve offline
dpm --offline resolve requests# verbose output
dpm --verbose resolve requests
# debug output
dpm --debug resolve requests# show detailed resolution steps
dpm --show-resolution resolve flask djangoPackage: requests
Version: 2.32.5
Language: python
Source: PyPI
Dependencies (4):
* charset_normalizer<4.0.0,>=2.0.0
* idna<4.0.0,>=2.5.0
* urllib3<3.0.0,>=1.21.1
* certifi>=2017.4.17
Dependency tree:
`-- flask@3.1.2
|-- blinker@1.9.0
|-- click@8.3.1
| `-- colorama@0.4.6
|-- jinja2@3.1.2
| `-- markupsafe@3.0.3
|-- werkzeug@3.1.2
| `-- markupsafe@3.0.3
...
Installed packages (5):
* certifi@2025.11.12
* charset_normalizer@3.4.4
* idna@3.11
* requests@2.32.5
* urllib3@1.26.20
- Check spelling
- Verify the package exists on pypi.org or npmjs.com
- Try
dpm search <package>to find similar packages
- Might be a version conflict
- Try
dpm resolve <package>to see what's happening - Use
--show-resolutionfor detailed information
- First run fetches from network
- Subsequent runs use cache (
~/.dpm/cache) - Use
dpm cache infoto check cache status
dpm cache clear
# or manually
rm -rf ~/.dpm/cache- Package may have been corrupted
- Try clearing cache and re-downloading
- Use
--skip-integrityto bypass (not recommended)
- Check if venv exists:
dpm venv status - Try detecting existing environments:
dpm venv detect - Create new venv:
dpm venv create myenv
# time a large resolution
time dpm resolve requests flask django numpy pandas scipy matplotlib
# should complete in a few seconds (cached) or ~10-20s (uncached)Test with real package installations:
# install packages
dpm install requests
# verify installation
dpm list
# check for updates
dpm outdated
# update packages
dpm update
# remove packages
dpm remove requestsCurrent test coverage:
- ✅ Version parsing and comparison
- ✅ Dependency constraint parsing
- ✅ Graph operations (add, dependencies, dependents)
- ✅ Cycle detection
- ✅ Topological sort
- ✅ Network retry logic
- ✅ Input validation
- ✅ Cache TTL and size limits
- ✅ Atomic file writes
- ✅ SystemSource optimization
- ✅ Resolution timeout
- ✅ Offline mode
# test retry logic (simulate network failure)
# HttpClient automatically retries with exponential backoff
dpm resolve requests # should retry on transient failures# test input sanitization
python3 -c "from dpm.core.validation import sanitize_package_name, ValidationError; \
print('Valid:', sanitize_package_name('test-package')); \
try: sanitize_package_name('../../etc/passwd'); \
except ValidationError as e: print('Blocked:', type(e).__name__)"# test cache expiration
python3 -c "from dpm.network.cache import Cache; import time; \
cache = Cache(ttl_hours=0.001); cache.set('test', 'value'); \
time.sleep(2); result = cache.get('test'); \
print('TTL test:', 'Expired' if result is None else 'Still cached')"# test atomic file writes
python3 -c "from dpm.installer.lockfile import LockFile; \
lf = LockFile('test.lock'); \
result = lf.write({'test': '1.0.0'}, {}, {}); \
print('Atomic write:', 'OK' if result else 'Failed')"# test multiple packages resolution
time dpm resolve requests flask django numpy
# should complete in < 5 seconds (cached) or ~20-25s (uncached)See Test Results for comprehensive test results covering:
- Core functionality (6 tests)
- File management (4 tests)
- Management commands (5 tests)
- Advanced features (3 tests)
- Unit tests (3 suites)
- Performance tests (2 tests)
- Robustness tests (6 tests)
Total: 28 tests, all passed ✅
Testing guide for DPM features.
# clone the repository
git clone https://github.com/yomnahisham/dpm.git
cd dpm
# install in development mode
pip install -e .
# verify installation
dpm --versionRun unit tests:
# test version parsing and comparison
python3 tests/unit/test_version.py
# test dependency parsing
python3 tests/unit/test_dependency.py
# test graph operations
python3 tests/unit/test_graph.py
# run all tests
python3 tests/unit/test_version.py && \
python3 tests/unit/test_dependency.py && \
python3 tests/unit/test_graph.pydpm search requests
dpm search flask
dpm search express # npm packagedpm info requests
dpm info numpy
dpm info lodash # npm package# single package
dpm resolve requests
# multiple packages
dpm resolve flask django
# see the dependency tree
dpm tree flask
dpm tree requestsdpm lock requests flask
cat dpm.lock # view the lock file# install specific packages
dpm install requests
# install from lock file (after running lock command)
dpm installdpm listdpm remove requests# create a venv
dpm venv create myenv
# check status
dpm venv status
# detect existing environments
dpm venv detect
# use existing environment
dpm venv use conda# initialize manifest
dpm init myproject 1.0.0
# view manifest
cat dpm.json# pin a package
dpm pin requests@2.32.5
# unpin a package
dpm unpin requests# export to requirements.txt
dpm export requirements.txt
# export to package.json
dpm export package.json# show cache info
dpm cache info
# list cached entries
dpm cache list
# clear cache
dpm cache cleardpm outdated# preview what would be removed
dpm clean --dry-run
# actually remove
dpm clean# list repositories
dpm repo list
# add repository
dpm repo add myrepo https://example.com/repo
# remove repository
dpm repo remove myrepodpm resolve requests
# should show: requests, urllib3, idna, charset_normalizer, certifidpm tree flask
# should show flask and all its dependencies in tree formatdpm resolve numpy pandas matplotlib
# should resolve all three with their dependenciesdpm info express
dpm resolve lodash# create lock file
dpm lock requests flask
# verify lock file exists
cat dpm.lock
# install from lock file
dpm install
# should use versions from lock filedpm tree django
# should show django with all nested dependencies# initialize project
dpm init myproject 1.0.0
# install packages (adds to manifest)
dpm install requests
# view manifest
cat dpm.json
# pin a package
dpm pin requests@2.32.5
# unpin
dpm unpin requests# create lock file
dpm lock requests flask
# export to requirements.txt
dpm export requirements.txt
cat requirements.txt
# export to package.json
dpm export package.json
cat package.json# first, resolve with network (populates cache)
dpm resolve requests
# then resolve offline
dpm --offline resolve requests# verbose output
dpm --verbose resolve requests
# debug output
dpm --debug resolve requests# show detailed resolution steps
dpm --show-resolution resolve flask djangoPackage: requests
Version: 2.32.5
Language: python
Source: PyPI
Dependencies (4):
* charset_normalizer<4.0.0,>=2.0.0
* idna<4.0.0,>=2.5.0
* urllib3<3.0.0,>=1.21.1
* certifi>=2017.4.17
Dependency tree:
`-- flask@3.1.2
|-- blinker@1.9.0
|-- click@8.3.1
| `-- colorama@0.4.6
|-- jinja2@3.1.2
| `-- markupsafe@3.0.3
|-- werkzeug@3.1.2
| `-- markupsafe@3.0.3
...
Installed packages (5):
* certifi@2025.11.12
* charset_normalizer@3.4.4
* idna@3.11
* requests@2.32.5
* urllib3@1.26.20
- Check spelling
- Verify the package exists on pypi.org or npmjs.com
- Try
dpm search <package>to find similar packages
- Might be a version conflict
- Try
dpm resolve <package>to see what's happening - Use
--show-resolutionfor detailed information
- First run fetches from network
- Subsequent runs use cache (
~/.dpm/cache) - Use
dpm cache infoto check cache status
dpm cache clear
# or manually
rm -rf ~/.dpm/cache- Package may have been corrupted
- Try clearing cache and re-downloading
- Use
--skip-integrityto bypass (not recommended)
- Check if venv exists:
dpm venv status - Try detecting existing environments:
dpm venv detect - Create new venv:
dpm venv create myenv
# time a large resolution
time dpm resolve requests flask django numpy pandas scipy matplotlib
# should complete in a few seconds (cached) or ~10-20s (uncached)Test with real package installations:
# install packages
dpm install requests
# verify installation
dpm list
# check for updates
dpm outdated
# update packages
dpm update
# remove packages
dpm remove requestsCurrent test coverage:
- ✅ Version parsing and comparison
- ✅ Dependency constraint parsing
- ✅ Graph operations (add, dependencies, dependents)
- ✅ Cycle detection
- ✅ Topological sort
- ✅ Network retry logic
- ✅ Input validation
- ✅ Cache TTL and size limits
- ✅ Atomic file writes
- ✅ SystemSource optimization
- ✅ Resolution timeout
- ✅ Offline mode
# test retry logic (simulate network failure)
# HttpClient automatically retries with exponential backoff
dpm resolve requests # should retry on transient failures# test input sanitization
python3 -c "from dpm.core.validation import sanitize_package_name, ValidationError; \
print('Valid:', sanitize_package_name('test-package')); \
try: sanitize_package_name('../../etc/passwd'); \
except ValidationError as e: print('Blocked:', type(e).__name__)"# test cache expiration
python3 -c "from dpm.network.cache import Cache; import time; \
cache = Cache(ttl_hours=0.001); cache.set('test', 'value'); \
time.sleep(2); result = cache.get('test'); \
print('TTL test:', 'Expired' if result is None else 'Still cached')"# test atomic file writes
python3 -c "from dpm.installer.lockfile import LockFile; \
lf = LockFile('test.lock'); \
result = lf.write({'test': '1.0.0'}, {}, {}); \
print('Atomic write:', 'OK' if result else 'Failed')"# test multiple packages resolution
time dpm resolve requests flask django numpy
# should complete in < 5 seconds (cached) or ~20-25s (uncached)See Test Results for comprehensive test results covering:
- Core functionality (6 tests)
- File management (4 tests)
- Management commands (5 tests)
- Advanced features (3 tests)
- Unit tests (3 suites)
- Performance tests (2 tests)
- Robustness tests (6 tests)
Total: 28 tests, all passed ✅
Testing guide for DPM features.
# clone the repository
git clone https://github.com/yomnahisham/dpm.git
cd dpm
# install in development mode
pip install -e .
# verify installation
dpm --versionRun unit tests:
# test version parsing and comparison
python3 tests/unit/test_version.py
# test dependency parsing
python3 tests/unit/test_dependency.py
# test graph operations
python3 tests/unit/test_graph.py
# run all tests
python3 tests/unit/test_version.py && \
python3 tests/unit/test_dependency.py && \
python3 tests/unit/test_graph.pydpm search requests
dpm search flask
dpm search express # npm packagedpm info requests
dpm info numpy
dpm info lodash # npm package# single package
dpm resolve requests
# multiple packages
dpm resolve flask django
# see the dependency tree
dpm tree flask
dpm tree requestsdpm lock requests flask
cat dpm.lock # view the lock file# install specific packages
dpm install requests
# install from lock file (after running lock command)
dpm installdpm listdpm remove requests# create a venv
dpm venv create myenv
# check status
dpm venv status
# detect existing environments
dpm venv detect
# use existing environment
dpm venv use conda# initialize manifest
dpm init myproject 1.0.0
# view manifest
cat dpm.json# pin a package
dpm pin requests@2.32.5
# unpin a package
dpm unpin requests# export to requirements.txt
dpm export requirements.txt
# export to package.json
dpm export package.json# show cache info
dpm cache info
# list cached entries
dpm cache list
# clear cache
dpm cache cleardpm outdated# preview what would be removed
dpm clean --dry-run
# actually remove
dpm clean# list repositories
dpm repo list
# add repository
dpm repo add myrepo https://example.com/repo
# remove repository
dpm repo remove myrepodpm resolve requests
# should show: requests, urllib3, idna, charset_normalizer, certifidpm tree flask
# should show flask and all its dependencies in tree formatdpm resolve numpy pandas matplotlib
# should resolve all three with their dependenciesdpm info express
dpm resolve lodash# create lock file
dpm lock requests flask
# verify lock file exists
cat dpm.lock
# install from lock file
dpm install
# should use versions from lock filedpm tree django
# should show django with all nested dependencies# initialize project
dpm init myproject 1.0.0
# install packages (adds to manifest)
dpm install requests
# view manifest
cat dpm.json
# pin a package
dpm pin requests@2.32.5
# unpin
dpm unpin requests# create lock file
dpm lock requests flask
# export to requirements.txt
dpm export requirements.txt
cat requirements.txt
# export to package.json
dpm export package.json
cat package.json# first, resolve with network (populates cache)
dpm resolve requests
# then resolve offline
dpm --offline resolve requests# verbose output
dpm --verbose resolve requests
# debug output
dpm --debug resolve requests# show detailed resolution steps
dpm --show-resolution resolve flask djangoPackage: requests
Version: 2.32.5
Language: python
Source: PyPI
Dependencies (4):
* charset_normalizer<4.0.0,>=2.0.0
* idna<4.0.0,>=2.5.0
* urllib3<3.0.0,>=1.21.1
* certifi>=2017.4.17
Dependency tree:
`-- flask@3.1.2
|-- blinker@1.9.0
|-- click@8.3.1
| `-- colorama@0.4.6
|-- jinja2@3.1.2
| `-- markupsafe@3.0.3
|-- werkzeug@3.1.2
| `-- markupsafe@3.0.3
...
Installed packages (5):
* certifi@2025.11.12
* charset_normalizer@3.4.4
* idna@3.11
* requests@2.32.5
* urllib3@1.26.20
- Check spelling
- Verify the package exists on pypi.org or npmjs.com
- Try
dpm search <package>to find similar packages
- Might be a version conflict
- Try
dpm resolve <package>to see what's happening - Use
--show-resolutionfor detailed information
- First run fetches from network
- Subsequent runs use cache (
~/.dpm/cache) - Use
dpm cache infoto check cache status
dpm cache clear
# or manually
rm -rf ~/.dpm/cache- Package may have been corrupted
- Try clearing cache and re-downloading
- Use
--skip-integrityto bypass (not recommended)
- Check if venv exists:
dpm venv status - Try detecting existing environments:
dpm venv detect - Create new venv:
dpm venv create myenv
# time a large resolution
time dpm resolve requests flask django numpy pandas scipy matplotlib
# should complete in a few seconds (cached) or ~10-20s (uncached)Test with real package installations:
# install packages
dpm install requests
# verify installation
dpm list
# check for updates
dpm outdated
# update packages
dpm update
# remove packages
dpm remove requestsCurrent test coverage:
- ✅ Version parsing and comparison
- ✅ Dependency constraint parsing
- ✅ Graph operations (add, dependencies, dependents)
- ✅ Cycle detection
- ✅ Topological sort
- ✅ Network retry logic
- ✅ Input validation
- ✅ Cache TTL and size limits
- ✅ Atomic file writes
- ✅ SystemSource optimization
- ✅ Resolution timeout
- ✅ Offline mode
# test retry logic (simulate network failure)
# HttpClient automatically retries with exponential backoff
dpm resolve requests # should retry on transient failures# test input sanitization
python3 -c "from dpm.core.validation import sanitize_package_name, ValidationError; \
print('Valid:', sanitize_package_name('test-package')); \
try: sanitize_package_name('../../etc/passwd'); \
except ValidationError as e: print('Blocked:', type(e).__name__)"# test cache expiration
python3 -c "from dpm.network.cache import Cache; import time; \
cache = Cache(ttl_hours=0.001); cache.set('test', 'value'); \
time.sleep(2); result = cache.get('test'); \
print('TTL test:', 'Expired' if result is None else 'Still cached')"# test atomic file writes
python3 -c "from dpm.installer.lockfile import LockFile; \
lf = LockFile('test.lock'); \
result = lf.write({'test': '1.0.0'}, {}, {}); \
print('Atomic write:', 'OK' if result else 'Failed')"# test multiple packages resolution
time dpm resolve requests flask django numpy
# should complete in < 5 seconds (cached) or ~20-25s (uncached)See Test Results for comprehensive test results covering:
- Core functionality (6 tests)
- File management (4 tests)
- Management commands (5 tests)
- Advanced features (3 tests)
- Unit tests (3 suites)
- Performance tests (2 tests)
- Robustness tests (6 tests)
Total: 28 tests, all passed ✅
Testing guide for DPM features.
# clone the repository
git clone https://github.com/yomnahisham/dpm.git
cd dpm
# install in development mode
pip install -e .
# verify installation
dpm --versionRun unit tests:
# test version parsing and comparison
python3 tests/unit/test_version.py
# test dependency parsing
python3 tests/unit/test_dependency.py
# test graph operations
python3 tests/unit/test_graph.py
# run all tests
python3 tests/unit/test_version.py && \
python3 tests/unit/test_dependency.py && \
python3 tests/unit/test_graph.pydpm search requests
dpm search flask
dpm search express # npm packagedpm info requests
dpm info numpy
dpm info lodash # npm package# single package
dpm resolve requests
# multiple packages
dpm resolve flask django
# see the dependency tree
dpm tree flask
dpm tree requestsdpm lock requests flask
cat dpm.lock # view the lock file# install specific packages
dpm install requests
# install from lock file (after running lock command)
dpm installdpm listdpm remove requests# create a venv
dpm venv create myenv
# check status
dpm venv status
# detect existing environments
dpm venv detect
# use existing environment
dpm venv use conda# initialize manifest
dpm init myproject 1.0.0
# view manifest
cat dpm.json# pin a package
dpm pin requests@2.32.5
# unpin a package
dpm unpin requests# export to requirements.txt
dpm export requirements.txt
# export to package.json
dpm export package.json# show cache info
dpm cache info
# list cached entries
dpm cache list
# clear cache
dpm cache cleardpm outdated# preview what would be removed
dpm clean --dry-run
# actually remove
dpm clean# list repositories
dpm repo list
# add repository
dpm repo add myrepo https://example.com/repo
# remove repository
dpm repo remove myrepodpm resolve requests
# should show: requests, urllib3, idna, charset_normalizer, certifidpm tree flask
# should show flask and all its dependencies in tree formatdpm resolve numpy pandas matplotlib
# should resolve all three with their dependenciesdpm info express
dpm resolve lodash# create lock file
dpm lock requests flask
# verify lock file exists
cat dpm.lock
# install from lock file
dpm install
# should use versions from lock filedpm tree django
# should show django with all nested dependencies# initialize project
dpm init myproject 1.0.0
# install packages (adds to manifest)
dpm install requests
# view manifest
cat dpm.json
# pin a package
dpm pin requests@2.32.5
# unpin
dpm unpin requests# create lock file
dpm lock requests flask
# export to requirements.txt
dpm export requirements.txt
cat requirements.txt
# export to package.json
dpm export package.json
cat package.json# first, resolve with network (populates cache)
dpm resolve requests
# then resolve offline
dpm --offline resolve requests# verbose output
dpm --verbose resolve requests
# debug output
dpm --debug resolve requests# show detailed resolution steps
dpm --show-resolution resolve flask djangoPackage: requests
Version: 2.32.5
Language: python
Source: PyPI
Dependencies (4):
* charset_normalizer<4.0.0,>=2.0.0
* idna<4.0.0,>=2.5.0
* urllib3<3.0.0,>=1.21.1
* certifi>=2017.4.17
Dependency tree:
`-- flask@3.1.2
|-- blinker@1.9.0
|-- click@8.3.1
| `-- colorama@0.4.6
|-- jinja2@3.1.2
| `-- markupsafe@3.0.3
|-- werkzeug@3.1.2
| `-- markupsafe@3.0.3
...
Installed packages (5):
* certifi@2025.11.12
* charset_normalizer@3.4.4
* idna@3.11
* requests@2.32.5
* urllib3@1.26.20
- Check spelling
- Verify the package exists on pypi.org or npmjs.com
- Try
dpm search <package>to find similar packages
- Might be a version conflict
- Try
dpm resolve <package>to see what's happening - Use
--show-resolutionfor detailed information
- First run fetches from network
- Subsequent runs use cache (
~/.dpm/cache) - Use
dpm cache infoto check cache status
dpm cache clear
# or manually
rm -rf ~/.dpm/cache- Package may have been corrupted
- Try clearing cache and re-downloading
- Use
--skip-integrityto bypass (not recommended)
- Check if venv exists:
dpm venv status - Try detecting existing environments:
dpm venv detect - Create new venv:
dpm venv create myenv
# time a large resolution
time dpm resolve requests flask django numpy pandas scipy matplotlib
# should complete in a few seconds (cached) or ~10-20s (uncached)Test with real package installations:
# install packages
dpm install requests
# verify installation
dpm list
# check for updates
dpm outdated
# update packages
dpm update
# remove packages
dpm remove requestsCurrent test coverage:
- ✅ Version parsing and comparison
- ✅ Dependency constraint parsing
- ✅ Graph operations (add, dependencies, dependents)
- ✅ Cycle detection
- ✅ Topological sort
- ✅ Network retry logic
- ✅ Input validation
- ✅ Cache TTL and size limits
- ✅ Atomic file writes
- ✅ SystemSource optimization
- ✅ Resolution timeout
- ✅ Offline mode
# test retry logic (simulate network failure)
# HttpClient automatically retries with exponential backoff
dpm resolve requests # should retry on transient failures# test input sanitization
python3 -c "from dpm.core.validation import sanitize_package_name, ValidationError; \
print('Valid:', sanitize_package_name('test-package')); \
try: sanitize_package_name('../../etc/passwd'); \
except ValidationError as e: print('Blocked:', type(e).__name__)"# test cache expiration
python3 -c "from dpm.network.cache import Cache; import time; \
cache = Cache(ttl_hours=0.001); cache.set('test', 'value'); \
time.sleep(2); result = cache.get('test'); \
print('TTL test:', 'Expired' if result is None else 'Still cached')"# test atomic file writes
python3 -c "from dpm.installer.lockfile import LockFile; \
lf = LockFile('test.lock'); \
result = lf.write({'test': '1.0.0'}, {}, {}); \
print('Atomic write:', 'OK' if result else 'Failed')"# test multiple packages resolution
time dpm resolve requests flask django numpy
# should complete in < 5 seconds (cached) or ~20-25s (uncached)See Test Results for comprehensive test results covering:
- Core functionality (6 tests)
- File management (4 tests)
- Management commands (5 tests)
- Advanced features (3 tests)
- Unit tests (3 suites)
- Performance tests (2 tests)
- Robustness tests (6 tests)
Total: 28 tests, all passed ✅