From 8f09dd43b62d685d945baddba8b8b93292d63405 Mon Sep 17 00:00:00 2001 From: Joo-Won Jung Date: Wed, 5 Oct 2016 03:05:41 +0900 Subject: [PATCH] refactor setup.py to fit setuptools --- setup.py | 23 ++++++++++++++++------- unzipmbcs.py | 1 + 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 268cdbd..ae0c56a 100644 --- a/setup.py +++ b/setup.py @@ -1,22 +1,31 @@ -from distutils.core import setup +from setuptools import setup +import pypandoc + +long_description = pypandoc.convert('README.md', 'rst') + +def find_version(filename): + with open(filename) as f: + for line in f: + if line.startswith('__version__'): + return eval(line.split('=')[-1]) + setup( name='unzipmbcs', - py_modules=['unzipmbcs'], - version='0.1.1', + version=find_version('unzipmbcs.py'), description='UnZip for non-UTF8 encoding such as cp949, sjis, gbk, euc-kr, euc-jp, and gb2312', + long_description=long_description, + keywords='unzip, pkzip, non-UTF8, mbcs, cp949, sjis, shift_jis, gbk, gb18030', author='Joo-Won Jung', author_email='sanori@gmail.com', url='https://github.com/sanori/unzip-mbcs', - download_url='https://github.com/sanori/unzip-mbcs/tarball/0.1.1', - keywords=['unzip', 'pkzip', 'non-UTF8', 'mbcs', 'cp949', - 'sjis', 'shift_jis', 'gbk', 'gb18030'], + py_modules=['unzipmbcs'], classifiers=['Development Status :: 3 - Alpha', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3'], entry_points={ 'console_scripts': [ - 'unzipmbcs=unzipmbcs:_main', + 'unzipmbcs = unzipmbcs:_main', ], }, ) diff --git a/unzipmbcs.py b/unzipmbcs.py index 1d1a712..56bf898 100644 --- a/unzipmbcs.py +++ b/unzipmbcs.py @@ -26,6 +26,7 @@ import zlib import argparse +__version__ = '0.1.1' def fixZipFilename(filename, enc): """