diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 83bc45b..47196b4 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,14 @@ Change log ================================================================================ +0.5.1 - 20.10.2017 +-------------------------------------------------------------------------------- + +added +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +#. `#103 `_, include LICENSE file + in MANIFEST.in, meaning LICENSE file will appear in the released tar ball. 0.5.0 - 30.08.2017 -------------------------------------------------------------------------------- diff --git a/MANIFEST.in b/MANIFEST.in index 5f13ef0..c2e4b1b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,3 @@ include README.rst +include LICENSE include CHANGELOG.rst diff --git a/docs/source/conf.py b/docs/source/conf.py index 3836c77..fed1d80 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -20,8 +20,8 @@ project = u'pyexcel-ods' copyright = u'2015-2017 Onni Software Ltd.' -version = '0.5.0' -release = '0.5.0' +version = '0.5.1' +release = '0.5.1' exclude_patterns = [] pygments_style = 'sphinx' html_theme = 'default' diff --git a/pyexcel_ods.yaml b/pyexcel_ods.yaml index c72ed07..33358f0 100644 --- a/pyexcel_ods.yaml +++ b/pyexcel_ods.yaml @@ -1,9 +1,9 @@ overrides: "pyexcel.yaml" name: "pyexcel-ods" nick_name: ods -version: 0.5.0 -current_version: 0.5.0 -release: 0.5.0 +version: 0.5.1 +current_version: 0.5.1 +release: 0.5.1 file_type: ods dependencies: - pyexcel-io>=0.5.0 diff --git a/setup.py b/setup.py index 513c5c7..ffd20ba 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,12 @@ -try: - from setuptools import setup, find_packages -except ImportError: - from ez_setup import use_setuptools - use_setuptools() - from setuptools import setup, find_packages +# Template by setupmobans +import os +import codecs +from shutil import rmtree +from setuptools import setup, find_packages, Command NAME = 'pyexcel-ods' AUTHOR = 'C.W.' -VERSION = '0.5.0' +VERSION = '0.5.1' EMAIL = 'wangc_2011@hotmail.com' LICENSE = 'New BSD' DESCRIPTION = ( @@ -15,8 +14,8 @@ '' ) URL = 'https://github.com/pyexcel/pyexcel-ods' -DOWNLOAD_URL = '%s/archive/0.5.0.tar.gz' % URL -FILES = ['README.rst', 'CHANGELOG.rst'] +DOWNLOAD_URL = '%s/archive/0.5.1.tar.gz' % URL +FILES = ['README.rst', 'CHANGELOG.rst'] KEYWORDS = [ 'python' ] @@ -44,6 +43,42 @@ PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests']) EXTRAS_REQUIRE = { } +PUBLISH_COMMAND = '{0} setup.py sdist bdist_wheel upload -r pypi'.format( + sys.executable) +GS_COMMAND = ('gs pyexcel-ods v0.5.1 ' + + "Find 0.5.1 in changelog for more details") +here = os.path.abspath(os.path.dirname(__file__)) + + +class PublishCommand(Command): + """Support setup.py upload.""" + + description = 'Build and publish the package on github and pypi' + user_options = [] + + @staticmethod + def status(s): + """Prints things in bold.""" + print('\033[1m{0}\033[0m'.format(s)) + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + try: + self.status('Removing previous builds…') + rmtree(os.path.join(here, 'dist')) + except OSError: + pass + + self.status('Building Source and Wheel (universal) distribution…') + if os.system(GS_COMMAND) == 0: + os.system(PUBLISH_COMMAND) + + sys.exit() def read_files(*files): @@ -57,7 +92,7 @@ def read_files(*files): def read(afile): """Read a file into setup""" - with open(afile, 'r') as opened_file: + with codecs.open(afile, 'r', 'utf-8') as opened_file: content = filter_out_test_code(opened_file) content = "".join(list(content)) return content @@ -105,5 +140,9 @@ def filter_out_test_code(file_handle): packages=PACKAGES, include_package_data=True, zip_safe=False, - classifiers=CLASSIFIERS + classifiers=CLASSIFIERS, + setup_requires=['gease'], + cmdclass={ + 'publish': PublishCommand, + } ) diff --git a/test.bat b/test.bat index 7e4a6fa..ae229d9 100644 --- a/test.bat +++ b/test.bat @@ -1,2 +1,2 @@ pip freeze -nosetests --with-cov --cover-package pyexcel_ods --cover-package tests --with-doctest --doctest-extension=.rst README.rst tests docs/source pyexcel_ods && flake8 . --exclude=.moban.d --builtins=unicode,xrange,long +nosetests --with-coverage --cover-package pyexcel_ods --cover-package tests --with-doctest --doctest-extension=.rst README.rst tests docs/source pyexcel_ods && flake8 . --exclude=.moban.d --builtins=unicode,xrange,long diff --git a/test.sh b/test.sh index 7e4a6fa..ae229d9 100644 --- a/test.sh +++ b/test.sh @@ -1,2 +1,2 @@ pip freeze -nosetests --with-cov --cover-package pyexcel_ods --cover-package tests --with-doctest --doctest-extension=.rst README.rst tests docs/source pyexcel_ods && flake8 . --exclude=.moban.d --builtins=unicode,xrange,long +nosetests --with-coverage --cover-package pyexcel_ods --cover-package tests --with-doctest --doctest-extension=.rst README.rst tests docs/source pyexcel_ods && flake8 . --exclude=.moban.d --builtins=unicode,xrange,long