Skip to content

Commit 01febfe

Browse files
committed
New version mechanics via tags.
1 parent 4a54ec0 commit 01febfe

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

.travis.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@ install:
1010
- pip install pytest-runner
1111
script:
1212
- python setup.py test
13-
14-
notifications:
15-
email:
16-
on_success: change
17-
on_failure: always
13+
before_deploy:
14+
- echo "__version__ = '$(git describe --tags)'" > django_admin_json_editor/version.py
15+
deploy:
16+
provider: pypi
17+
user: abogushov
18+
on:
19+
tags: true
20+
condition: "$TRAVIS_PYTHON_VERSION = 3.6"
21+
skip_cleanup: true
22+
password:
23+
secure: Zz3au9EC3ahxdwnsiYEPpX8LNzP3bbdoyfM/7lZ1NS3dozRXemGhTTST2PxPmQ+ZolNoeItFOgIPq9MziDVSfuV2AarDG/rFMGw9dZHLOMFPC9Lm9ObEreHDyO8vSLkQGJn9kAkylMMf5RwoyADCRhgDZsXWDq9SGQF89RygMYryOcSPrEJb9d3ZNs1bv8ZT5WhpU8zYdmg0rc/5FIUb/qntoIRuIfEzaF3US8yuF9O43zrUREDZQWedXCBcUGXuyj7x/z0Nnsgex3dbIL1IdHUyPwgP6dC++pc9McHritbUrOtH7tvBWDGjsax4Lo9eeE0n3nG3btyJfmhf8hhPeqrpf3Ag7EKfbvkD7JZWOESgjG+fkcbmYLjTAFS2YENwIhd2V9zftiCn/k5RwCCj1941/0Jt78pvME+XaLVCSKfs7CePCqQu/zSNmQ4Ac1pb9/ipxkM8Qk87N7Lz2eutiZH+UiqHENaa8JwMp2iLN4QdzYeTAcMpOpqkv2J+FISHzV4s5erVdlaIvJcfRx2VBuHKhYrPzxo7wtOPJ3FA4+lFqsXTfoMZZnf0aUQZ0CHO3cIeU62gZ7vFNtFk+FtnYiU6RVvtddO5EEoOiwifPQ06u44bBBq6My+vp3i5veC711ULZjP1yZKvKI3c0/Zo2reCI9owhBgliqfZVA9cDh0=
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
from .admin import JSONEditorWidget # noqa
22

3-
__version__ = '0.1.5'
3+
try:
4+
from .version import __version__
5+
except ImportError:
6+
__version__ = 'dev'

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
import re
32
from setuptools import setup
43

54

@@ -9,7 +8,7 @@
98
with open(os.path.join(project_path, 'django_admin_json_editor', '__init__.py'), 'r') as fout:
109
version_text = fout.read()
1110

12-
VERSION = re.compile(r'.*__version__ = \'(.*?)\'', re.S).match(version_text).group(1)
11+
version = __import__('django_admin_json_editor').__version__
1312

1413
# allow setup.py to be run from any path
1514
os.chdir(project_path)
@@ -27,7 +26,7 @@
2726

2827
setup(
2928
name='django-admin-json-editor',
30-
version=VERSION,
29+
version=version,
3130
packages=['django_admin_json_editor'],
3231
include_package_data=True,
3332
license='MIT License',

0 commit comments

Comments
 (0)