added Makefile for easy releases

Bump version: 0.8.1 → 0.8.2

Bump version: 0.8.2 → 0.8.3

included version in package
DRY version from package

revert the version to the current value

remove the breakpoint

change version in the new location

typo

activate compilation and uploading
This commit is contained in:
Andy Grabow 2018-04-13 11:09:41 +02:00
parent 7613c7bd0f
commit be57e57077
6 changed files with 115 additions and 2 deletions

41
Makefile Normal file
View file

@ -0,0 +1,41 @@
.PHONY: clean-pyc clean-build help test
.DEFAULT_GOAL := help
help: ## print this help screen
@perl -nle'print $& if m{^[a-zA-Z0-9_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-25s\033[0m %s\n", $$1, $$2}'
clean: clean-build clean-pyc
@echo "all clean now .."
clean-build: ## remove build artifacts
@rm -fr build/
@rm -fr dist/
@rm -fr htmlcov/
@rm -fr *.egg-info
@rm -rf .coverage
clean-pyc: ## remove Python file artifacts
@find . -name '*.pyc' -exec rm -f {} +
@find . -name '*.pyo' -exec rm -f {} +
@find . -name '*.orig' -exec rm -f {} +
@find . -name '*~' -exec rm -f {} +
release: clean ## package and upload a release (working dir must be clean)
@while true; do \
CURRENT=`python -c "import wagtail_modeltranslation; print(wagtail_modeltranslation.__version__)"`; \
echo ""; \
echo "=== The current version is $$CURRENT - what's the next one?"; \
echo "==========================================================="; \
echo "1 - new major version"; \
echo "2 - new minor version"; \
echo "3 - patch"; \
echo ""; \
read yn; \
case $$yn in \
1 ) bumpversion major; break;; \
2 ) bumpversion minor; break;; \
3 ) bumpversion patch; break;; \
* ) echo "Please answer 1-3.";; \
esac \
done
@python setup.py bdist_wheel && twine upload dist/*

13
Pipfile Normal file
View file

@ -0,0 +1,13 @@
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"
[packages]
bumpversion = "*"
wheel = "*"
[dev-packages]
[requires]
python_version = "3.6"

37
Pipfile.lock generated Normal file
View file

@ -0,0 +1,37 @@
{
"_meta": {
"hash": {
"sha256": "8a50cf92fd274fbd58348130a7ab3568a8f694ad373cb5a67d45da7a46b96827"
},
"pipfile-spec": 6,
"requires": {
"python_version": "3.6"
},
"sources": [
{
"name": "pypi",
"url": "https://pypi.python.org/simple",
"verify_ssl": true
}
]
},
"default": {
"bumpversion": {
"hashes": [
"sha256:6744c873dd7aafc24453d8b6a1a0d6d109faf63cd0cd19cb78fd46e74932c77e",
"sha256:6753d9ff3552013e2130f7bc03c1007e24473b4835952679653fb132367bdd57"
],
"index": "pypi",
"version": "==0.5.3"
},
"wheel": {
"hashes": [
"sha256:1ae8153bed701cb062913b72429bcf854ba824f973735427681882a688cb55ce",
"sha256:9cdc8ab2cc9c3c2e2727a4b67c22881dbb0e1c503d592992594c5e131c867107"
],
"index": "pypi",
"version": "==0.31.0"
}
},
"develop": {}
}

7
setup.cfg Normal file
View file

@ -0,0 +1,7 @@
[bumpversion]
current_version = 0.8.1
commit = True
tag = True
[bumpversion:file:wagtail_modeltranslation/__init__.py]

View file

@ -1,9 +1,24 @@
#!/usr/bin/env python
import re
from builtins import RuntimeError
import os
from setuptools import setup
def get_version(*file_paths):
filename = os.path.join(os.path.dirname(__file__), *file_paths)
version_file = open(filename).read()
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError('Unable to find version string.')
version = get_version("wagtail_modeltranslation", "__init__.py")
setup(
name='wagtail-modeltranslation',
version='0.8.1',
version=version,
description='Translates Wagtail CMS models using a registration approach.',
long_description=(
'The modeltranslation application can be used to translate dynamic '

View file

@ -1,3 +1,3 @@
# coding: utf-8
__version__ = '0.8.1'
default_app_config = 'wagtail_modeltranslation.apps.ModeltranslationConfig'