Skip to content

Commit

Permalink
Merge pull request #202 from jacebrowning/release/v1.7
Browse files Browse the repository at this point in the history
Release v1.7
  • Loading branch information
jacebrowning authored Aug 8, 2019
2 parents 302f606 + f788aeb commit 2d945e3
Show file tree
Hide file tree
Showing 29 changed files with 1,042 additions and 202 deletions.
3 changes: 3 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ environment:
cache:
- .venv -> poetry.lock

init:
- git config --global core.symlinks true

install:
# Add Make and Python to the PATH
- copy C:\MinGW\bin\mingw32-make.exe C:\MinGW\bin\make.exe
Expand Down
15 changes: 12 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
# 1.7 (2019-08-07)

- **BREAKING**: Renamed `-f` alias to `-F` (`-f` now implies `--force-interactive`).
- Added `--force-interactive` option to interactively overwrite changed dependencies on install or update command. (@daniel-brosche)
- Added basic group support. (@daniel-brosche)
- Improved validity check of git repo. (@mttjohnson)
- Added rebuilding missing repo on `install --force`. (@mttjohnson)
- Added support for symlinks on Windows. (@sergey-shuyskiy)

# 1.6 (2019-01-26)

- **BREAKING**: Dropped support for Python 3.5.
- Added `git svn` support. (@daniel-brosche)
- Added `$GITMAN_CACHE_DISABLE` to disable repository mirrors. (@daniel-brosche)
- Added `--skip-changes` option to skip changed dependencies on install or update command. (@daniel-brosche)
- **BREAKING**: Dropped support for Python 3.5.

# 1.5 (2018-09-08)

- Added `--keep-location` option on `uninstall`. (@DavidWatkins)
- Added feature to enable sparse checkouts. See the docs for further information. (@xenji)
- **BREAKING**: Removed confusing `--lock` option on `update` command in favor of just using the `lock` command.
- **BREAKING**: Renamed `--no-lock` to `--skip-lock` on `update` command.
- **BREAKING**: Renamed `--no-dirty` to `--fail-if-dirty` on `list` command.
- Added `--keep-location` option on `uninstall`. (@DavidWatkins)
- Added feature to enable sparse checkouts. See the docs for further information. (@xenji)

# 1.4 (2017-03-21)

Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ $(MKDOCS_INDEX): docs/requirements.txt mkdocs.yml docs/*.md

# Workaround: https://github.com/rtfd/readthedocs.org/issues/5090
docs/requirements.txt: poetry.lock
poetry run pip freeze | grep mkdocs > $@
@ poetry run pip freeze -qqq | grep mkdocs > $@

.PHONY: uml
uml: install docs/*.png
Expand All @@ -148,7 +148,7 @@ mkdocs-live: mkdocs
# BUILD #######################################################################

DIST_FILES := dist/*.tar.gz dist/*.whl
EXE_FILES := dist/$(PROJECT).*
EXE_FILES := dist/$(PACKAGE).*

.PHONY: dist
dist: install $(DIST_FILES)
Expand All @@ -158,12 +158,12 @@ $(DIST_FILES): $(MODULES) pyproject.toml

.PHONY: exe
exe: install $(EXE_FILES)
$(EXE_FILES): $(MODULES) $(PROJECT).spec
$(EXE_FILES): $(MODULES) $(PACKAGE).spec
# For framework/shared support: https://github.com/yyuu/pyenv/wiki
poetry run pyinstaller $(PROJECT).spec --noconfirm --clean
poetry run pyinstaller $(PACKAGE).spec --noconfirm --clean

$(PROJECT).spec:
poetry run pyi-makespec $(PACKAGE)/__main__.py --onefile --windowed --name=$(PROJECT)
$(PACKAGE).spec:
poetry run pyi-makespec $(PACKAGE)/__main__.py --onefile --additional-hooks-dir=gitman --name=$(PACKAGE)

# RELEASE #####################################################################

Expand Down
52 changes: 41 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,29 @@ GitMan is a language-agnostic dependency manager using Git. It aims to serve as

Install this tool globally:

```
```shell
$ pip install gitman
```

or add it to your [Poetry](https://poetry.eustace.io/) project:

```
```shell
$ poetry add gitman
```

### Configuration

Generate a sample config file:

```sh
```shell
$ gitman init
```

or manually create one (`gitman.yml` or `.gitman.yml`) in the root of your working tree:

```yaml
location: vendor/gitman

sources:
- name: framework
repo: https://github.com/kstenerud/iOS-Universal-Framework
Expand All @@ -56,33 +57,46 @@ sources:
repo: https://github.com/dxa4481/truffleHog
rev: master
scripts:
- chmod a+x truffleHog.py
- chmod a+x truffleHog/truffleHog.py
- name: fontawesome
repo: https://github.com/FortAwesome/Font-Awesome
sparse_paths:
- fonts/*
- webfonts/*
rev: master
- name: material-design-icons
repo: https://github.com/google/material-design-icons.git
rev: master

groups:
- name: code
members:
- framework
- trufflehog
- name: resources
members:
- fontawesome
- material-design-icons
```
Ignore the dependency storage location:
```sh
```shell
$ echo vendor/gitman >> .gitignore
```

## Usage

See the available commands:

```sh
```shell
$ gitman --help
```

### Updating Dependencies

Get the latest versions of all dependencies:

```sh
```shell
$ gitman update
```

Expand All @@ -102,24 +116,40 @@ where `rev` can be:
* a branch: `master`
* a `rev-parse` date: `'develop@{2015-06-18 10:30:59}'`


Alternatively get the latest versions of certain dependencies or even dependency groups:

* Update a single repository

```shell
$ gitman update framework
```

* Update a dependency group

```shell
$ gitman update resources
```


### Restoring Previous Versions

Display the specific revisions that are currently installed:

```sh
```shell
$ gitman list
```

Reinstall these specific versions at a later time:

```sh
```shell
$ gitman install
```

### Deleting Dependencies

Remove all installed dependencies:

```sh
```shell
$ gitman uninstall
```
6 changes: 3 additions & 3 deletions docs/interfaces/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ gitman.install(*names, root=None, depth=None,

with optional arguments:

- `*names`: optional list of dependency directory names to filter on
- `*names`: optional list of dependency source or group names to filter on
- `root`: specifies the path to the root working tree
- `depth`: number of levels of dependencies to traverse
- `force`: indicates uncommitted changes can be overwritten and
Expand All @@ -41,7 +41,7 @@ gitman.update(*names, root=None, depth=None, recurse=False,

with optional arguments:

- `*names`: optional list of dependency directory names to filter on
- `*names`: optional list of dependency source or group names to filter on
- `root`: specifies the path to the root working tree
- `depth`: number of levels of dependencies to traverse
- `recurse`: indicates nested dependencies should also be updated
Expand Down Expand Up @@ -75,7 +75,7 @@ gitman.lock(*names, root=None)

with optional arguments:

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

## Uninstall
Expand Down
18 changes: 15 additions & 3 deletions docs/interfaces/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ To clone/checkout the specified dependencies, run:
$ gitman install
```

or filter the dependency list by directory name:
or filter the dependency list by source or group name:

```sh
$ gitman install <name1> <name2> <etc.>
Expand Down Expand Up @@ -48,6 +48,12 @@ It will exit with an error if there are any uncommitted changes in dependencies
$ gitman install --force
```

or to interactively overwrite changes, run:

```sh
$ gitman install --force-interactive
```

Alternatively, it is possible to skip the update process for dependencies that have uncommitted changes:

```sh
Expand All @@ -62,7 +68,7 @@ If any of the dependencies track a branch (rather than a specific commit), the c
$ gitman update
```

or filter the dependency list by directory name:
or filter the dependency list by source or group name:

```sh
$ gitman update <name1> <name2> <etc.>
Expand Down Expand Up @@ -92,6 +98,12 @@ It will exit with an error if there are any uncommitted changes in dependencies
$ gitman update --force
```

or to interactively overwrite changes, run:

```sh
$ gitman update --force-interactive
```

Alternatively, it is possible to skip the update process only for dependencies that have uncommitted changes:

```sh
Expand Down Expand Up @@ -122,7 +134,7 @@ To manually record the exact version of each dependency, run:
$ gitman lock
```

or lock down specific dependencies:
or lock down specific sources or groups:

```sh
$ gitman lock <name1> <name2> <etc.>
Expand Down
12 changes: 12 additions & 0 deletions docs/interfaces/plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ Git will exit with an error if there are any uncommitted changes in dependencies
$ git deps --force
```

or to interactively overwrite changes, run:

```sh
$ git deps --force-interactive
```

Alternatively, it is possible to skip the install process only for dependencies that have uncommitted changes:

```sh
$ git deps --skip-changes
```

## Update

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 running:
Expand Down
66 changes: 66 additions & 0 deletions docs/use-cases/self-contained-gitman.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Self contained / Portable GitMan

There are scenarios where a global GitMan installation via [pip](https://github.com/pypa/pip) or a local GitMan installation via [poetry](https://github.com/sdispater/poetry) is not possible or difficult to manage.
For example, when a local system doesn't have the required python or pip version installed and or the global installation may produce side effects (different parallel python versions on the same machine).
Furthermore there are scenarios where a high degree of reproducibility, managing multiple different versions of GitMan on the same machine and hassle free distribution of GitMan is desired.

In these scenarios, it can be helpful to use a self contained GitMan application besides the possibility to use a virtual environment (e.g. via pyenv + poetry or docker).
It is possible to build a single self contained OS-specific GitMan binary using [PyInstaller](https://www.pyinstaller.org/) that can be used locally or globally.
Over this way it is possible to manage multiple different versions of GitMan on the same machine and to easily distribute the GitMan application (including all needed dependencies) by simply copying one single file.

Following this approach, the gitman.yml and the corresponding compatible version of the GitMan application can be managed side by side in the same repository to ensure
reproducibility and easy distribution.


## Prerequisites

### General prerequisites

The [PyInstaller](https://www.pyinstaller.org/) will encapsulate the required parts of the local installed python version and the needed modules in the self contained GitMan binary.

In this matter, ensure that the required python version and development tools are locally available (see [GitMan requirements](../index.md#Setup) and [development setup](../about/contributing.md#Setup)).

The compatible PyInstaller package will be automatically resolved by poetry. It is not necessary to explicitly install the PyInstaller via pip.

Furthermore OS-specifc prerequisites are required.
Below there are some well-known prerequisites listed.
Depending on the local system it may need further steps to do.

### Linux-specific prerequisites

- install the corresponding python developer package
- Debian based distros (e.g. Mint, Ubuntu, Xubuntu):
```sh
sudo apt-get install python-dev
```
In cases where multiple python versions are installed it is may
helpful to specify the concrete version of the python developer package like:
```sh
sudo apt-get install python3.7-dev
```

- Fedora based distros (e.g. CentOS):
```sh
yum install python-devel
```

### Windows-specific prerequisites

- install make via [cygwin](https://www.cygwin.com/) or [mingw](http://www.mingw.org/) (add the path to make to the PATH-Environment Variable e.g. C:\cygwin\bin)
- install [pywin32](https://github.com/mhammond/pywin32) according the used python version and system architecture (e.g. for python 3.7 and amd64-architecture use pywin32-224.win-amd64-py3.7.exe)

### Mac OS X prerequisites

Some notes regarding Mac OS X prerequisites can be found [here](https://pyinstaller.readthedocs.io/en/v3.3.1/installation.html#installing-in-mac-os-x).

## Build the self contained GitMan binary

To build the self contained GitMan binary use:

```sh
$ make exe
```

By default this call installs the [PyInstaller](https://www.pyinstaller.org/) pip-Package as part of the GitMan virtual environment.

The build output is located in the `dist` folder.
9 changes: 9 additions & 0 deletions gitman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,12 @@ sources_locked:
link:
scripts:
-
groups:
- name: group_a
members:
- gitman_1
- gitman_4
- name: group_b
members:
- gitman 2
- gitman_3
Loading

0 comments on commit 2d945e3

Please sign in to comment.