-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from shosca/master
Add attribute support
- Loading branch information
Showing
6 changed files
with
103 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,79 @@ | ||
.PHONY: clean-pyc clean-build docs clean | ||
.PHONY: watch clean-pyc clean-build docs clean | ||
|
||
NOSE_FLAGS=-sv --with-doctest --rednose | ||
COVER_CONFIG_FLAGS=--with-coverage --cover-package=pycontext,tests --cover-tests --cover-erase | ||
COVER_REPORT_FLAGS=--cover-html --cover-html-dir=htmlcov | ||
COVER_FLAGS=${COVER_CONFIG_FLAGS} ${COVER_REPORT_FLAGS} | ||
|
||
# automatic help generator | ||
help: | ||
@echo "install - install all requirements including for testing" | ||
@echo "clean - remove all artifacts" | ||
@echo "clean-build - remove build artifacts" | ||
@echo "clean-pyc - remove Python file artifacts" | ||
@echo "clean-test - remove test and coverage artifacts" | ||
@echo "lint - check style with flake8" | ||
@echo "test - run tests quickly with the default Python" | ||
@echo "test-coverage - run tests with coverage report" | ||
@echo "test-all - run tests on every Python version with tox" | ||
@echo "check - run all necessary steps to check validity of project" | ||
@echo "release - package and upload a release" | ||
@echo "dist - package" | ||
|
||
install: | ||
@for f in $(MAKEFILE_LIST) ; do \ | ||
echo "$$f:" ; \ | ||
grep -E '^[a-zA-Z_-%]+:.*?## .*$$' $$f | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}' ; \ | ||
done ; \ | ||
|
||
install: ## install all requirements including for testing | ||
pip install -U -r requirements-dev.txt | ||
|
||
clean: clean-build clean-pyc clean-test-all | ||
clean: clean-build clean-pyc clean-test-all ## remove all artifacts | ||
|
||
clean-build: | ||
clean-build: ## remove build artifacts | ||
@rm -rf build/ | ||
@rm -rf dist/ | ||
@rm -rf *.egg-info | ||
|
||
clean-pyc: | ||
clean-pyc: ## remove Python file artifacts | ||
-@find . -name '*.pyc' -follow -print0 | xargs -0 rm -f | ||
-@find . -name '*.pyo' -follow -print0 | xargs -0 rm -f | ||
-@find . -name '__pycache__' -type d -follow -print0 | xargs -0 rm -rf | ||
|
||
clean-test: | ||
clean-test: ## remove test and coverage artifacts | ||
rm -rf .coverage coverage* | ||
rm -rf htmlcov/ | ||
|
||
clean-test-all: clean-test | ||
rm -rf .tox/ | ||
|
||
lint: | ||
lint: ## check style with flake8 | ||
flake8 pycontext tests | ||
|
||
test: | ||
test: ## run tests quickly with the default Python | ||
nosetests ${NOSE_FLAGS} tests/ pycontext/ | ||
|
||
test-coverage: | ||
test-coverage: ## run tests with coverage report | ||
nosetests ${NOSE_FLAGS} ${COVER_FLAGS} tests/ pycontext/ | ||
|
||
test-all: | ||
test-all: ## run tests on every Python version with tox | ||
tox | ||
|
||
check: lint clean-build clean-pyc clean-test test-coverage | ||
check: lint clean-build clean-pyc clean-test test-coverage ## run all necessary steps to check validity of project | ||
|
||
release: clean | ||
release: clean ## release - package and upload a release | ||
python setup.py sdist upload | ||
python setup.py bdist_wheel upload | ||
|
||
dist: clean | ||
dist: clean ## package | ||
python setup.py sdist | ||
python setup.py bdist_wheel | ||
ls -l dist | ||
|
||
.NOTPARALLEL: watch | ||
WATCH_EVENTS=modify,close_write,moved_to,create | ||
watch: ## watch file changes to run a command, e.g. make watch test | ||
@if ! type "inotifywait" > /dev/null; then \ | ||
echo "Please install inotify-tools" ; \ | ||
fi; \ | ||
echo "Watching $(pwd) to run: $(WATCH_ARGS)" ; \ | ||
while true; do \ | ||
$(MAKE) $(WATCH_ARGS) ; \ | ||
inotifywait -e $(WATCH_EVENTS) -r --exclude '.*(git|~)' . ; \ | ||
done \ | ||
|
||
# This needs to be at the bottom as it'll convert things to do-nothing targets | ||
# If the first argument is "watch"... | ||
ifeq (watch,$(firstword $(MAKECMDGOALS))) | ||
# use the rest as arguments for "watch" | ||
WATCH_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS)) | ||
# ...and turn them into do-nothing targets | ||
$(eval $(WATCH_ARGS):;@:) | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,5 @@ | |
|
||
__author__ = 'Miroslav Shubernetskiy' | ||
__author_email__ = '[email protected]' | ||
__version__ = '0.1.0' | ||
__version__ = '0.2' | ||
__description__ = 'Python dict with stacked context data' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters