Skip to content

Commit

Permalink
make release-tag: Merge branch 'master' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
csala committed Apr 2, 2019
2 parents ffd5e19 + fd56778 commit 589706c
Show file tree
Hide file tree
Showing 48 changed files with 911 additions and 1,049 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ docs/build/
docs/modules.rst
docs/atm.rst
docs/atm.*.rst
docs/api

# PyBuilder
target/
Expand All @@ -120,6 +121,9 @@ celerybeat-schedule
venv/
ENV/

# vim temporary files
*.swp

# Spyder project settings
.spyderproject
.spyproject
Expand Down
3 changes: 2 additions & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ Contributors
* Thomas Swearingen <[email protected]>
* Kalyan Veeramachaneni <[email protected]>
* Laura Gustafson <[email protected]>
* Carles Sala <[email protected]>
* Carles Sala <[email protected]>
* Micah Smith <[email protected]>
* Plamen Valentinov <[email protected]>
* Kiran Karra <[email protected]>
* swearin3 <[email protected]>
* Max Kanter <[email protected]>
Expand Down
11 changes: 10 additions & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# History

## 0.1.1 (2019-04-02)

First Release on PyPi.

### New Features

* Upgrade to latest BTB.
* New Command Line Interface.

## 0.1.0 (2018-05-04)

* First release on PyPI.
* First Release.
161 changes: 128 additions & 33 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.PHONY: clean clean-test clean-pyc clean-build clean-docs docs help
.DEFAULT_GOAL := help

define BROWSER_PYSCRIPT
Expand Down Expand Up @@ -26,91 +25,187 @@ export PRINT_HELP_PYSCRIPT

BROWSER := python -c "$$BROWSER_PYSCRIPT"

.PHONY: help
help:
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)

clean: clean-build clean-pyc clean-coverage clean-test clean-docs clean-data ## remove all build, test, coverage, docs and Python artifacts
# CLEAN TARGETS

.PHONY: clean-build
clean-build: ## remove build artifacts
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +

.PHONY: clean-pyc
clean-pyc: ## remove Python file artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +

.PHONY: clean-docs
clean-docs: ## remove previously built docs
rm -rf docs/build
rm -f docs/atm.rst
rm -f docs/atm.*.rst
rm -f docs/modules.rst
$(MAKE) -C docs clean

.PHONY: clean-coverage
clean-coverage: ## remove coverage artifacts
rm -f .coverage
rm -f .coverage.*
rm -fr htmlcov/

clean-test: ## remove test and coverage artifacts
.PHONY: clean-test
clean-test: ## remove test artifacts
rm -fr .tox/
rm -fr .pytest_cache

clean-data: ## remove generated data
rm -fr *.db
rm -fr models/
rm -fr metrics/
rm -fr logs/
.PHONY: clean
clean: clean-build clean-pyc clean-test clean-coverage clean-docs ## remove all build, test, coverage, docs and Python artifacts

clean-docs: ## remove previously built docs
rm -rf docs/build
rm -f docs/atm.rst
rm -f docs/atm.*.rst
rm -f docs/modules.rst
$(MAKE) -C docs clean

# INSTALL TARGETS

.PHONY: install
install: clean-build clean-pyc ## install the package to the active Python's site-packages
pip install .

.PHONY: install-test
install-test: clean-build clean-pyc ## install the package and test dependencies
pip install .[test]

.PHONY: install-develop
install-develop: clean-build clean-pyc ## install the package in editable mode and dependencies for development
pip install -e .[dev]


# LINT TARGETS

.PHONY: lint
lint: ## check style with flake8 and isort
flake8 atm # tests
isort -c --recursive atm # tests
flake8 atm tests
isort -c --recursive atm tests

fixlint: ## fix lint issues using autoflake, autopep8, and isort
.PHONY: fix-lint
fix-lint: ## fix lint issues using autoflake, autopep8, and isort
find atm -name '*.py' | xargs autoflake --in-place --remove-all-unused-imports --remove-unused-variables
autopep8 --in-place --recursive --aggressive atm
isort --apply --atomic --recursive atm

# find tests -name '*.py' | xargs autoflake --in-place --remove-all-unused-imports --remove-unused-variables
# autopep8 --in-place --recursive --aggressive tests
# isort --apply --atomic --recursive tests
find tests -name '*.py' | xargs autoflake --in-place --remove-all-unused-imports --remove-unused-variables
autopep8 --in-place --recursive --aggressive tests
isort --apply --atomic --recursive tests


# TEST TARGETS

.PHONY: test
test: ## run tests quickly with the default Python
pytest
python -m pytest tests

.PHONY: test-all
test-all: ## run tests on every Python version with tox
tox

coverage: clean-coverage ## check code coverage quickly with the default Python
.PHONY: coverage
coverage: ## check code coverage quickly with the default Python
coverage run --source atm -m pytest
coverage report -m
coverage html
$(BROWSER) htmlcov/index.html


# DOCS TARGETS

.PHONY: docs
docs: clean-docs ## generate Sphinx HTML documentation, including API docs
sphinx-apidoc -o docs/ atm
sphinx-apidoc --module-first --separate -o docs/api/ atm
$(MAKE) -C docs html

viewdocs: docs ## view docs in browser
$(BROWSER) docs/build/index.html
.PHONY: view-docs
view-docs: docs ## view docs in browser
$(BROWSER) docs/_build/html/index.html

.PHONY: serve-docs
serve-docs: view-docs ## compile the docs watching for changes
watchmedo shell-command -W -R -D -p '*.rst;*.md' -c '$(MAKE) -C docs html' .

servedocs: docs ## compile the docs watching for changes
watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .

# RELEASE TARGETS

.PHONY: dist
dist: clean ## builds source and wheel package
python setup.py sdist
python setup.py bdist_wheel
ls -l dist

release: dist ## package and upload a release
twine upload dist/*

test-release: dist ## package and upload a release on TestPyPI
.PHONY: test-publish
test-publish: dist ## package and upload a release on TestPyPI
twine upload --repository-url https://test.pypi.org/legacy/ dist/*

install: clean ## install the package to the active Python's site-packages
python setup.py install
.PHONY: publish
publish: dist ## package and upload a release
twine upload dist/*

.PHONY: bumpversion-release
bumpversion-release: ## Merge master to stable and bumpversion release
git checkout stable
git merge --no-ff master -m"make release-tag: Merge branch 'master' into stable"
bumpversion release
git push --tags origin stable

.PHONY: test-bumpversion-release
test-bumpversion-release: ## Merge master to stable and bumpversion release
git checkout stable
git merge --no-ff master -m"make release-tag: Merge branch 'master' into stable"
bumpversion release

.PHONY: bumpversion-patch
bumpversion-patch: ## Merge stable to master and bumpversion patch
git checkout master
git merge stable
bumpversion --no-tag patch
git push

.PHONY: test-bumpversion-patch
test-bumpversion-patch: ## Merge stable to master and bumpversion patch
git checkout master
git merge stable
bumpversion --no-tag patch

.PHONY: bumpversion-minor
bumpversion-minor: ## Bump the version the next minor skipping the release
bumpversion --no-tag minor

.PHONY: bumpversion-major
bumpversion-major: ## Bump the version the next major skipping the release
bumpversion --no-tag major

CURRENT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
CHANGELOG_LINES := $(shell git diff HEAD..stable HISTORY.md 2>/dev/null | wc -l)

.PHONY: check-release
check-release: ## Check if the release can be made
ifneq ($(CURRENT_BRANCH),master)
$(error Please make the release from master branch\n)
endif
ifeq ($(CHANGELOG_LINES),0)
$(error Please insert the release notes in HISTORY.md before releasing)
endif

.PHONY: release
release: check-release bumpversion-release publish bumpversion-patch

.PHONY: release-minor
release-minor: check-release bumpversion-minor release

.PHONY: release-major
release-major: check-release bumpversion-major release

.PHONY: test-release
test-release: check-release test-bumpversion-release test-publish test-bumpversion-patch
Loading

0 comments on commit 589706c

Please sign in to comment.