Skip to content

Commit

Permalink
Merge pull request #87 from jacebrowning/release/v0.7
Browse files Browse the repository at this point in the history
Release v0.7
  • Loading branch information
jacebrowning committed Dec 22, 2015
2 parents 15b9ae8 + 6bf1c92 commit f1c90af
Show file tree
Hide file tree
Showing 26 changed files with 616 additions and 280 deletions.
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[MESSAGES CONTROL]

disable=locally-disabled,fixme,too-few-public-methods,too-many-public-methods,invalid-name,global-statement,too-many-ancestors
disable=locally-disabled,fixme,too-few-public-methods,too-many-public-methods,invalid-name,global-statement,too-many-ancestors,misplaced-comparison-constant

[FORMAT]

Expand Down
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ sudo: false

language: python
python:
- 3.3
- 3.4
- 3.5

Expand Down
13 changes: 11 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
Revision History
================

0.7 (2015/12/22)
----------------

- Fixed `git remote rm` command (@hdnivara).
- Now applying the `update` dependency filter to locking as well.
- Now only locking previous locked dependencies.
- Added `lock` command to manually save all dependency versions.
- Now requiring `--lock` option on `update` to explicitly lock dependencies.

0.6 (2015/11/13)
----------------

- Added the ability to filter the dependency list on `install` and `update`
- Added `--depth` option to limit dependency traversal on `install`, `update`, and `list`
- Added the ability to filter the dependency list on `install` and `update`.
- Added `--depth` option to limit dependency traversal on `install`, `update`, and `list`.

0.5 (2015/10/20)
----------------
Expand Down
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

Create a virtualenv:

```
```sh
$ make env
```

Expand All @@ -26,14 +26,14 @@ $ make env

Manually run the tests:

```
```sh
$ make test
$ make tests # includes integration tests
```

or keep them running on change:

```
```sh
$ make watch
```

Expand All @@ -43,15 +43,15 @@ $ make watch

Build the documentation:

```
```sh
$ make doc
```

### Static Analysis

Run linters and static analyzers:

```
```sh
$ make pep8
$ make pep257
$ make pylint
Expand All @@ -62,7 +62,7 @@ $ make check # includes all checks

Release to PyPI:

```
```sh
$ make upload-test # dry run upload to a test server
$ make upload
```
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ PACKAGE := gdm
SOURCES := Makefile setup.py $(shell find $(PACKAGE) -name '*.py')
EGG_INFO := $(subst -,_,$(PROJECT)).egg-info

# Python settings
PYTHON_MAJOR ?= 3
PYTHON_MINOR ?= 4
# Python
ifndef TRAVIS
PYTHON_MAJOR ?= 3
PYTHON_MINOR ?= 5
endif

# Test settings
UNIT_TEST_COVERAGE := 72
Expand Down Expand Up @@ -108,7 +110,7 @@ depends: depends-ci depends-dev
.PHONY: depends-ci
depends-ci: env Makefile $(DEPENDS_CI_FLAG)
$(DEPENDS_CI_FLAG): Makefile
$(PIP) install --upgrade pep8 pep257 pylint coverage pytest pytest-cov pytest-random pytest-runfailed mkdocs
$(PIP) install --upgrade pep8 pep257 pylint coverage pytest pytest-describe pytest-cov pytest-random pytest-runfailed mkdocs
@ touch $(DEPENDS_CI_FLAG) # flag to indicate dependencies are installed

.PHONY: depends-dev
Expand All @@ -118,7 +120,7 @@ $(DEPENDS_DEV_FLAG): Makefile
ifdef WINDOWS
$(PIP) install --upgrade pywin32
else ifdef MAC
$(PIP) install --upgrade pync MacFSEvents
$(PIP) install --upgrade pync MacFSEvents==0.4
else ifdef LINUX
$(PIP) install --upgrade pyinotify
endif
Expand Down Expand Up @@ -205,7 +207,7 @@ fix: depends-dev

RANDOM_SEED ?= $(shell date +%s)

PYTEST_CORE_OPTS := --doctest-modules --verbose -r X --maxfail=3
PYTEST_CORE_OPTS := --verbose -r xXw --maxfail=3
PYTEST_COV_OPTS := --cov=$(PACKAGE) --cov-report=term-missing --no-cov-on-fail
PYTEST_RANDOM_OPTS := --random --random-seed=$(RANDOM_SEED)

Expand All @@ -217,7 +219,6 @@ FAILED_FLAG := .pytest/failed
.PHONY: test test-unit
test: test-unit
test-unit: depends-ci
@ if test -e $(FAILED_FLAG); then $(MAKE) test-all; fi
@ $(COVERAGE) erase
$(PYTEST) $(PYTEST_OPTS) $(PACKAGE)
ifndef TRAVIS
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Git Dependency Manager (GDM) is a language-agnostic "dependency manager" using G
Requirements
------------

* Python 3.3+
* Python 3.4+
* Latest version of Git (with [stored credentials](http://stackoverflow.com/questions/7773181))
* OSX/Linux (with a decent shell for Git)

Expand All @@ -22,15 +22,15 @@ Installation
GDM can be installed with pip:

```sh
$ pip3 install gdm
$ pip install gdm
```

or directly from the source code:

```sh
$ git clone https://github.com/jacebrowning/gdm.git
$ cd gdm
$ python3 setup.py install
$ python setup.py install
```

Setup
Expand Down
8 changes: 4 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Git Dependency Manager
# Git Dependency Manager

Git Dependency Manager (GDM) is a language-agnostic "dependency manager" using Git. It aims to serve as a submodules replacement and provides advanced options for managing versions of nested Git repositories.

## Requirements

* Python 3.3+
* Python 3.4+
* Latest version of Git (with [stored credentials](http://stackoverflow.com/questions/7773181))
* OSX/Linux (with a decent shell for Git)

Expand All @@ -13,15 +13,15 @@ Git Dependency Manager (GDM) is a language-agnostic "dependency manager" using G
GDM can be installed with pip:

```sh
$ pip3 install gdm
$ pip install gdm
```

or directly from the source code:

```sh
$ git clone https://github.com/jacebrowning/gdm.git
$ cd gdm
$ python3 setup.py install
$ python setup.py install
```

## Setup
Expand Down
15 changes: 14 additions & 1 deletion docs/interfaces/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ with optional arguments:
If any of the dependencies track a branch (rather than a specific commit), the current upstream version of that branch can be checked out by calling:

```python
gdm.update(*names, root=None, depth=None, recurse=False, force=False, clean=True, lock=True)
gdm.update(*names, root=None, depth=None, recurse=False, force=False, clean=True, lock=None)
```

with optional arguments:
Expand All @@ -50,6 +50,19 @@ with optional arguments:
- `depth`: number of levels of dependencies to traverse
- `allow_dirty`: causes uncommitted changes to be ignored

## Lock

To record the exact versions of currently checked out dependencies, call:

```python
gdm.lock(*names, root=None)
```

with optional arguments:

- `*names`: optional list of dependency directory names to filter on
- `root`: specifies the path to the root working tree

## Uninstall

To delete all source dependencies, call:
Expand Down
44 changes: 38 additions & 6 deletions docs/interfaces/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ or filter the dependency list by directory name:
gdm install <dir1> <dir2> <etc.>
```

or limit the traversal of nested dependencies:

```sh
gdm install --depth=<count>
```

Delete all untracked files in dependencies by instead running:

```sh
Expand All @@ -42,22 +48,22 @@ or filter the dependency list by directory name:
gdm update <dir1> <dir2> <etc.>
```

This will also record the exact versions that were checked out. Disable this behavior by instead running:
or limit the traversal of nested dependencies:

```sh
gdm update --no-lock
gdm update --depth=<count>
```

or to additionally get the latest versions of all nested dependencies, run:
This will also record the exact versions of any previously locked dependencies. Disable this behavior by instead running:

```sh
gdm update --all
gdm update --no-lock
```

To restore the exact versions previously checked out, run:
or to additionally get the latest versions of all nested dependencies, run:

```sh
gdm install
gdm update --all
```

## List
Expand All @@ -74,6 +80,32 @@ or exit with an error if there are any uncommitted changes:
gdm list --no-dirty
```

## Lock

To manually record the exact version of each dependency, run:

```sh
gdm lock
```

or lock down specific dependencies:

```sh
gdm lock <dir1> <dir2> <etc.>
```

This can be combined with updating dependencies by running:

```sh
gdm update --lock
```

To restore the exact versions previously checked out, run:

```sh
gdm install
```

## Uninstall

To delete all source dependencies, run:
Expand Down
6 changes: 4 additions & 2 deletions gdm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys

__project__ = 'GDM'
__version__ = '0.6'
__version__ = '0.7'

CLI = 'gdm'
PLUGIN = 'deps'
Expand All @@ -12,13 +12,15 @@

PYTHON_VERSION = 3, 3

if not sys.version_info >= PYTHON_VERSION: # pragma: no cover (manual test)
if sys.version_info < PYTHON_VERSION: # pragma: no cover (manual test)
exit("Python {}.{}+ is required.".format(*PYTHON_VERSION))

try:
# pylint: disable=wrong-import-position
from .commands import install
from .commands import update
from .commands import display as list # pylint: disable=redefined-builtin
from .commands import lock
from .commands import delete as uninstall
except ImportError: # pragma: no cover (manual test)
pass
22 changes: 18 additions & 4 deletions gdm/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,13 @@ def main(args=None, function=None):
help="list of dependencies (`dir` values) to update")
sub.add_argument('-a', '--all', action='store_true', dest='recurse',
help="update all nested dependencies, recursively")
sub.add_argument('-L', '--no-lock',
action='store_false', dest='lock', default=True,
help="skip recording of versions for later reinstall")
group = sub.add_mutually_exclusive_group()
group.add_argument('-l', '--lock',
action='store_true', dest='lock', default=None,
help="enable recording of versions for later reinstall")
group.add_argument('-L', '--no-lock',
action='store_false', dest='lock', default=None,
help="disable recording of versions for later reinstall")

# Display parser
info = "display the current version of each dependency"
Expand All @@ -73,6 +77,13 @@ def main(args=None, function=None):
dest='allow_dirty',
help="fail if a source has uncommitted changes")

# Lock parser
info = "lock the current version of each dependency"
sub = subs.add_parser('lock', description=info.capitalize() + '.',
help=info, parents=[debug, project], **shared)
sub.add_argument('name', nargs='*',
help="list of dependencies (`dir` values) to lock")

# Uninstall parser
info = "delete all installed dependencies"
sub = subs.add_parser('uninstall', description=info.capitalize() + '.',
Expand Down Expand Up @@ -113,6 +124,9 @@ def _get_command(function, namespace):
function = commands.display
kwargs.update(dict(depth=namespace.depth,
allow_dirty=namespace.allow_dirty))
elif namespace.command == 'lock':
function = getattr(commands, namespace.command)
args = namespace.name
elif namespace.command == 'uninstall':
function = commands.delete
kwargs.update(force=namespace.force)
Expand All @@ -124,7 +138,7 @@ def _get_command(function, namespace):
def _run_command(function, args, kwargs, exit_msg):
success = False
try:
log.debug("Running %r command...", function.__name__)
log.debug("Running %r command...", getattr(function, '__name__', 'a'))
success = function(*args, **kwargs)
except KeyboardInterrupt:
log.debug("Command canceled")
Expand Down
Loading

0 comments on commit f1c90af

Please sign in to comment.