Skip to content

Commit

Permalink
feat(v0.0.5): Upgrade version to be v0.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
dwisulfahnur committed Jul 30, 2020
1 parent 4634d33 commit df7bbf9
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
36 changes: 35 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,45 @@
import os
import re
import shutil
import sys

from setuptools import setup

with open("README.md", "r") as fh:
long_description = fh.read()


def get_version(package):
"""
Return package version as listed in `__version__` in `init.py`.
"""
init_py = open(os.path.join(package, '__init__.py')).read()
return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)


version = get_version('xenditclient')

if sys.argv[-1] == 'publish':
if os.system("pip freeze | grep twine"):
print("twine not installed.\nUse `pip install twine`.\nExiting.")
sys.exit()
os.system("python setup.py sdist bdist_wheel")
if os.system("twine check dist/*"):
print("twine check failed. Packages might be outdated.")
print("Try using `pip install -U twine wheel`.\nExiting.")
sys.exit()
os.system("twine upload dist/*")
print("You probably want to also tag the version now:")
print(" git tag -a %s -m 'version %s'" % (version, version))
print(" git push --tags")
shutil.rmtree('dist')
shutil.rmtree('build')
shutil.rmtree('xenditclient.egg-info')
sys.exit()

setup(
name='xenditclient',
version='0.0.4',
version=version,
packages=['tests', 'xenditclient'],
url='https://github.com/dwisulfahnur/python-xendit-client',
license='BSD 3-Clause',
Expand Down
2 changes: 2 additions & 0 deletions xenditclient/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
__version__ = 'v0.0.5'

from .client import XenditClient

0 comments on commit df7bbf9

Please sign in to comment.