Skip to main content

depman

https://travis-ci.org/mbodenhamer/depman.svg?branch=master https://img.shields.io/coveralls/mbodenhamer/depman.svg https://readthedocs.org/projects/depman/badge/?version=latest

A lightweight dependency manager for managing project dependencies in multiple contexts. The use case driving development is that of distinguishing between development, testing, and production dependencies in a simple and unified way. However, the application is general purpose and can be used in any project requiring the management of dependencies in multiple contexts.

Currently, only dependencies resolved via apt-get and pip are supported. However, support for other dependency types is planned for future releases (see Future Features for more details).

Installation

$ pip install -U depman

Usage

usage: depman [-h] [-f <depfile>] <command> [<context>]

A lightweight dependency manager.

positional arguments:
  <command>             'satisfy' satisfies the dependencies specified in
                        <depfile>. 'validate' only validates <depfile> and
                        does not perform any system operations
  <context>             The dependency context to perform <command> on

optional arguments:
  -h, --help            show this help message and exit
  -f <depfile>, --depfile <depfile>
                        The requirements file to load

If not supplied, <depfile> and <context> default to requirements.yml and all, respectively.

Example(s)

Suppose you have the following requirements.yml in your current working directory:

includes:
  dev:
    - test

dev:
  apt:
    - libxml2-dev
    - libxslt1-dev
  pip:
    - lxml
    - Sphinx

test:
  pip:
    - nose
    - coverage

prod:
  pip:
    - gevent:
        version: 1.0.2
    - texttable
    - syn:
        always_upgrade: yes

This file specifies three dependency contexts: dev, test, prod. In general, any top-level key in requirements.yml specifies a dependency context. The one exception to this rule is includes, which defines inclusion relationships between contexts. In this example, the dev context includes the test context. As such, when depman satisfy test is run at the command line, depman will invoke pip to install nose and coverage, if they do not exist on the system. On the other hand, when depman satisfy dev is run at the command line, depman will first invoke apt-get to install libxml1-dev and libxslt1-dev and then invoke pip to install lxml, Sphinx, nose, and coverage (in general, apt dependencies are processed before pip dependencies). Because test is “included” in dev, its dependencies are processed whenever dev is processed.

depman also accepts the special context all as a valid command line parameter. Running depman satisfy all causes depman to satisfy the dependencies in all of the defined dependency contexts. In this example, it would cause depman to satisfy the dependencies for dev, test, and prod. Running depman satisfy is equivalent to running depman satisfy all.

Currently, only two dependency types are supported in any context: apt and pip. However, support for other dependency types is planned for future releases (see Future Features for more details).

Dependencies are specified in each context under each dependency type (i.e. apt or pip) as YAML list elements. If the element is a string, the dependency in question will be treated as satisfied if some version of the package denoted by the string exists on the system. For more detailed dependency requirements, the name of the package can be listed as the key to a YAML dictionary of dependency options. This can be seen, for example, in the gevent dependency, in which a minimum version 1.0.2 is specified as a requirement. Additionally, the syn package contains the always_upgrade option, which causes depman to always attempt to upgrade the package, regardless of the current version installed.

In version 0.1, versioning features are only available for pip dependencies, but versioning options will be added to other dependency types in future releases.

Future Features

The following features are planned for future releases:

  • Better versioning support (>=, ==, <=, etc.)

  • Support for apt versioning

  • apt PPA support

  • Support for other package managers

  • Support for scripted installs from source

  • Export to requirements files for various package management systems

Metadata

Release files for depman 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for depman 0.2.1
File Size Uploaded Provenance Actions
depman-0.2.1.tar.gz 21.4 kB Without provenance Details for depman-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for depman 0.2.1
File Interpreter ABI Platform Actions
depman-0.2.1-py2.py3-none-any.whl Python 2, Python 3 none any Details for depman-0.2.1-py2.py3-none-any.whl

Total release size: 36.4 kB

Release files / depman-0.2.1.tar.gz

Download URL depman-0.2.1.tar.gz
Size 21.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6f88d5697ce7656fcdb90be91b378213f1561d2b142bd97fd9d163c3cc63d51b
BLAKE2b-256 checksum
How to use checksums
8bac650998a514a4bfb0427c3d3e9a9a03a9174f5e3771ba8fb1cf3a652eec6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / depman-0.2.1-py2.py3-none-any.whl

Download URL depman-0.2.1-py2.py3-none-any.whl
Size 15.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
5ff863a88f1252abf523f993e109ccfa695d24d995ad166d80a9929ba06eafe4
BLAKE2b-256 checksum
How to use checksums
c90cb31546c4c436b4193054c03356aaf2d3e6619b1517544b1a754f75673db8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for depman 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page