diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0965477 --- /dev/null +++ b/Makefile @@ -0,0 +1,43 @@ +.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 "4 - keep the current version"; \ + echo ""; \ + read yn; \ + case $$yn in \ + 1 ) bumpversion major; break;; \ + 2 ) bumpversion minor; break;; \ + 3 ) bumpversion patch; break;; \ + 4 ) break;; \ + * ) echo "Please answer 1-3.";; \ + esac \ + done + @python setup.py bdist_wheel && twine upload dist/* diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..e8af0ec --- /dev/null +++ b/Pipfile @@ -0,0 +1,10 @@ +[[source]] +url = "https://pypi.python.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +bumpversion = "*" +wheel = "*" + +[dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 0000000..ce0a5c3 --- /dev/null +++ b/Pipfile.lock @@ -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": {} +} diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..62f8eed --- /dev/null +++ b/setup.cfg @@ -0,0 +1,7 @@ +[bumpversion] +current_version = 0.8.1 +commit = True +tag = True + +[bumpversion:file:wagtail_modeltranslation/__init__.py] + diff --git a/setup.py b/setup.py index 2f41c13..9606ab7 100755 --- a/setup.py +++ b/setup.py @@ -1,9 +1,24 @@ #!/usr/bin/env python +import re + +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('Please assure that the package version is defined as "__version__ = x.x.x" in ' + filename) + + +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 ' diff --git a/wagtail_modeltranslation/__init__.py b/wagtail_modeltranslation/__init__.py index 8011855..a8d9006 100644 --- a/wagtail_modeltranslation/__init__.py +++ b/wagtail_modeltranslation/__init__.py @@ -1,3 +1,3 @@ # coding: utf-8 - +__version__ = '0.8.1' default_app_config = 'wagtail_modeltranslation.apps.ModeltranslationConfig'