Git Product home page Git Product logo

depman's Introduction

Depman

Dependency management helper for Golang packages. Supports versioned dependencies, using standard Golang imports.

Copyright 2013 Vubeology, Inc.

Released under the MIT License (see LICENSE).

Installation

git clone [email protected]:vube/depman.git $GOPATH/src/vube/depman
go install github.com/vube/depman

Usage

Run depman in the directory with your deps.json, or use the --path argument to specify the directory where deps.json is located.

Commands

init

Create an empty deps.json

add

Add a dependency (interactive)

install

Install all the dependencies listed in deps.json (default)

update [nickname] [branch]

Update [nickname] to use the latest commit in [branch]

show-frozen

Show dependencies as resolved to commit IDs.

Options
  • --recursive: Descend into dependencies depth-first.

help

Display help message

Options

  • --clean=false: Remove changes to code in dependencies
  • --debug=false: Display debug messages. Implies --verbose
  • --help=false: Display help
  • --no-colors=false: Disable colors
  • --path="./": Directory or full path to .deps.json
  • --silent=false: Don't display normal output. Overrides --debug and --verbose
  • --verbose=false: Display commands as they are run, and other informative messages
  • --version=false: Display version number

Requirements

  • Shall not require any external dependencies for normal operation
  • Testing dependencies shall be installed through depman
  • go vet shall not indicate any problems

Testing

# Setup
cd $GOPATH/github.com/vube/depman
git pull
go install
depman install

# Test
go test -i ./...
go test ./...

# Coverage
gocov test ./... | gocov report

# Vet
go vet ./...

Basic Algorithm

  1. For each dependency:
    1. Use go get to download the dependency
    2. Checkout the specified version
    3. Look in the dependency's directory for a deps.json
      1. Recursively install those dependencies as well
    4. If the dependency type is git-clone then manually run git clone, git fetch, etc as needed

Duplicates

Duplicated dependencies (anywhere in the tree) with identical versions will be skipped (this just saves some time and prevents infinite recursion). Duplicated dependencies with different versions cause a fatal error and must be fixed by the developer.

Non Go-Getable Repos

Some repositories (private bitbucket repos for example), are not supported by go get. To include those repositories in depman:

  1. Change the type to git-clone (hg and bzr are not yet supported)
  2. Change the repo to a full git url (include everything necessary for git clone)
  3. Add an alias section to specify a directory in which to clone, the path is rooted at $GOPATH/src/ See the example below or the included deps.json file.

JSON Structure

[The file must be named deps.json]

{
	"shortname":{
		"repo":"url/to/package, just like in import",
		"version":"commit, tag, or branch",
		"type": "one of 'git', 'bzr', 'hg'"
	},
	"not go getable":{
		"repo":"full git repo url, just like git clone"
		"version":"commit, tag, or branch",
		"type": "git-clone",
		"alias": "target directory to clone into, (optional for every type other than 'git-clone')"
	}
}

Example

{
	"gocheck": {
		"repo": "launchpad.net/gocheck",
		"version": "85",
		"type": "bzr"
	},
	"gocov": {
		"repo": "github.com/axw/gocov/gocov",
		"version": "90c9390",
		"type": "git"
	},
	"gocov-html": {
		"repo": "https://github.com/matm/gocov-html.git",
		"version": "f83448b",
		"type": "git-clone",
		"alias": "github.com/matm/gocov-html"
	},
	"golint": {
		"repo": "github.com/golang/lint",
		"version": "22f4d5e",
		"type": "git"
	}
}

TODO

  • Support manually cloning hg or bzr repositories (add types hg-clone, and bzr-clone)

depman's People

Contributors

lord-vubeset avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.