Skip to content

Commit

Permalink
Merge 2863c6a into 2d945e3
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebrowning committed Apr 4, 2020
2 parents 2d945e3 + 2863c6a commit d35b14b
Show file tree
Hide file tree
Showing 36 changed files with 871 additions and 395 deletions.
4 changes: 3 additions & 1 deletion .appveyor.yml
Expand Up @@ -6,11 +6,13 @@ environment:
PYTHON_MINOR: 6
- PYTHON_MAJOR: 3
PYTHON_MINOR: 7
- PYTHON_MAJOR: 3
PYTHON_MINOR: 8

cache:
- .venv -> poetry.lock

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

install:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -7,6 +7,7 @@
*.egg-info
__pycache__
.ipynb_checkpoints
setup.py

# Temporary OS files
Icon*
Expand Down
10 changes: 1 addition & 9 deletions .pylint.ini
Expand Up @@ -124,10 +124,10 @@ disable=
too-many-arguments,
too-many-branches,
keyword-arg-before-vararg,
logging-not-lazy,
redefined-builtin,
too-many-public-methods,
bad-continuation,
subprocess-run-check,

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down Expand Up @@ -290,14 +290,6 @@ single-line-class-stmt=no
# else.
single-line-if-stmt=no


[LOGGING]

# Logging modules to check that the string format arguments are in logging
# function parameter format
logging-modules=logging


[MISCELLANEOUS]

# List of note tags to take in consideration, separated by a comma.
Expand Down
1 change: 1 addition & 0 deletions .python-version
@@ -0,0 +1 @@
3.8.2
7 changes: 0 additions & 7 deletions .scrutinizer.yml
Expand Up @@ -3,13 +3,6 @@ build:
override:
- pylint-run --rcfile=.pylint.ini
- py-scrutinizer-run
nodes:
py35:
environment:
python: 3.5.1
py36:
environment:
python: 3.6
checks:
python:
code_rating: true
Expand Down
9 changes: 4 additions & 5 deletions .travis.yml
@@ -1,11 +1,10 @@
dist: xenial

language: python
python:
- 3.6
matrix:
include:
- python: 3.7
dist: xenial
sudo: true
- 3.7
- 3.8

cache:
pip: true
Expand Down
4 changes: 2 additions & 2 deletions .verchew.ini
Expand Up @@ -6,12 +6,12 @@ version = GNU Make
[Python]

cli = python
version = Python 3
version = 3

[Poetry]

cli = poetry
version = 0.12
version = 1

[Git]

Expand Down
8 changes: 6 additions & 2 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
# 1.8 (2020-04-04)

- Added support Python 3.8.

# 1.7 (2019-08-07)

- **BREAKING**: Renamed `-f` alias to `-F` (`-f` now implies `--force-interactive`).
Expand Down Expand Up @@ -173,8 +177,8 @@
# 0.1.2 (2014-02-27)

- Added `--force` argument to:
- overwrite uncommitted changes
- create symbolic links in place of directories
- overwrite uncommitted changes
- create symbolic links in place of directories
- Added live shell command output with `-vv` argument.

# 0.1 (2014-02-24)
Expand Down
14 changes: 8 additions & 6 deletions Makefile
Expand Up @@ -45,13 +45,15 @@ DEPENDENCIES := $(VIRTUAL_ENV)/.poetry-$(shell bin/checksum pyproject.toml poetr
install: $(DEPENDENCIES) .cache

$(DEPENDENCIES): poetry.lock
@ poetry config settings.virtualenvs.in-project true
@ poetry config virtualenvs.in-project true
poetry install
@ touch $@

ifndef CI
poetry.lock: pyproject.toml
poetry lock
@ touch $@
endif

.cache:
@ mkdir -p .cache
Expand All @@ -69,8 +71,8 @@ check: install format ## Run formaters, linters, and static analysis
ifdef CI
git diff --exit-code
endif
poetry run pylint $(PACKAGES) --rcfile=.pylint.ini
poetry run mypy $(PACKAGES) --config-file=.mypy.ini
poetry run pylint $(PACKAGES) --rcfile=.pylint.ini
poetry run pydocstyle $(PACKAGES) $(CONFIG)

# TESTS #######################################################################
Expand Down Expand Up @@ -129,9 +131,9 @@ $(MKDOCS_INDEX): docs/requirements.txt mkdocs.yml docs/*.md
@ cd docs/about && ln -sf ../../LICENSE.md license.md
poetry run mkdocs build --clean --strict

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

.PHONY: uml
uml: install docs/*.png
Expand All @@ -140,8 +142,8 @@ docs/*.png: $(MODULES)
- mv -f classes_$(PACKAGE).png docs/classes.png
- mv -f packages_$(PACKAGE).png docs/packages.png

.PHONY: mkdocs-live
mkdocs-live: mkdocs
.PHONY: mkdocs-serve
mkdocs-serve: mkdocs
eval "sleep 3; bin/open http://127.0.0.1:8000" &
poetry run mkdocs serve

Expand Down
98 changes: 48 additions & 50 deletions README.md
Expand Up @@ -15,28 +15,28 @@ GitMan is a language-agnostic dependency manager using Git. It aims to serve as

### Requirements

* Python 3.6+
* Git 2.8+ (with [stored credentials](http://gitman.readthedocs.io/en/latest/setup/git/))
- Python 3.6+
- Git 2.8+ (with [stored credentials](http://gitman.readthedocs.io/en/latest/setup/git/))

### Installation

Install this tool globally:

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

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

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

### Configuration

Generate a sample config file:

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

Expand All @@ -46,57 +46,57 @@ or manually create one (`gitman.yml` or `.gitman.yml`) in the root of your worki
location: vendor/gitman

sources:
- name: framework
repo: https://github.com/kstenerud/iOS-Universal-Framework
rev: Mk5-end-of-life
- name: coverage
repo: https://github.com/jonreid/XcodeCoverage
rev: master
link: Tools/XcodeCoverage
- name: trufflehog
repo: https://github.com/dxa4481/truffleHog
rev: master
scripts:
- chmod a+x truffleHog/truffleHog.py
- name: fontawesome
repo: https://github.com/FortAwesome/Font-Awesome
sparse_paths:
- webfonts/*
rev: master
- name: material-design-icons
repo: https://github.com/google/material-design-icons.git
rev: master
- name: framework
repo: https://github.com/kstenerud/iOS-Universal-Framework
rev: Mk5-end-of-life
- name: coverage
repo: https://github.com/jonreid/XcodeCoverage
rev: master
link: Tools/XcodeCoverage
- name: trufflehog
repo: https://github.com/dxa4481/truffleHog
rev: master
scripts:
- chmod a+x truffleHog/truffleHog.py
- name: fontawesome
repo: https://github.com/FortAwesome/Font-Awesome
sparse_paths:
- "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
- name: code
members:
- framework
- trufflehog
- name: resources
members:
- fontawesome
- material-design-icons
```

Ignore the dependency storage location:

```shell
```sh
$ echo vendor/gitman >> .gitignore
```

## Usage

See the available commands:

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

### Updating Dependencies

Get the latest versions of all dependencies:

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

Expand All @@ -111,45 +111,43 @@ which will essentially:

where `rev` can be:

* all or part of a commit SHA: `123def`
* a tag: `v1.0`
* a branch: `master`
* a `rev-parse` date: `'develop@{2015-06-18 10:30:59}'`

- all or part of a commit SHA: `123def`
- a tag: `v1.0`
- 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
- Update a single repository

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

* Update a dependency group
- Update a dependency group

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


### Restoring Previous Versions

Display the specific revisions that are currently installed:

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

Reinstall these specific versions at a later time:

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

### Deleting Dependencies

Remove all installed dependencies:

```shell
```sh
$ gitman uninstall
```
13 changes: 8 additions & 5 deletions bin/checksum
Expand Up @@ -6,14 +6,17 @@ import sys


def run(paths):
hash_md5 = hashlib.md5()
sha = hashlib.sha1()

for path in paths:
with open(path, 'rb') as f:
for chunk in iter(lambda: f.read(4096), b''):
hash_md5.update(chunk)
try:
with open(path, 'rb') as f:
for chunk in iter(lambda: f.read(4096), b''):
sha.update(chunk)
except IOError:
sha.update(path.encode())

print(hash_md5.hexdigest())
print(sha.hexdigest())


if __name__ == '__main__':
Expand Down

0 comments on commit d35b14b

Please sign in to comment.