From 43cd7516c85e66010e9cc0318d80d80c741734d3 Mon Sep 17 00:00:00 2001 From: chfw Date: Sat, 25 Nov 2017 09:34:50 +0000 Subject: [PATCH] :egg: :ferris_wheel: release 0.0.3 --- CHANGELOG.rst | 5 ++++- README.rst | 8 +------- gease.yml | 6 +++--- gease/_version.py | 2 +- setup.py | 41 ++++++++++++++++++++++++++++++++--------- 5 files changed, 41 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index cc27780..c786f94 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,7 +1,7 @@ Change log =========== -v0.0.2 - 25.11.2017 +v0.0.3 - 25.11.2017 -------------------------------------------------------------------------------- added @@ -10,6 +10,9 @@ added #. `issue 1`_, release repos of the organisation that you belong to. +v0.0.2 - 15.10.2017 +-------------------------------------------------------------------------------- + updated ******************************************************************************** diff --git a/README.rst b/README.rst index d9b7e1d..1b041e5 100644 --- a/README.rst +++ b/README.rst @@ -48,18 +48,12 @@ First, please create `personal access token` for yourself `on github `_. .. image:: https://github.com/moremoban/gease/raw/master/images/generate_token.png + Next, please create a gease file(`.gease`) in your home directory and place the token inside it. Gease file is a simple json file. Here is an example:: {"user":"chfw","personal_access_token":"AAFDAFASDFADFADFADFADFADF"} -Organisation ----------------- - -In order to make a release for your organisation, "read:org" right is required: - -.. image:: https://user-images.githubusercontent.com/4280312/33229231-0220f60e-d1c3-11e7-8c95-3e1207415929.png - Command Line ================================================================================ diff --git a/gease.yml b/gease.yml index 347521c..b4b0307 100644 --- a/gease.yml +++ b/gease.yml @@ -4,9 +4,9 @@ organisation: "moremoban" author: "C. W." contact: "wangc_2011@hotmail.com" company: "Onni Software Ltd." -version: "0.0.2" -current_version: 0.0.2 -release: "0.0.2" +version: "0.0.3" +current_version: 0.0.3 +release: "0.0.3" copyright_year: 2017 command_line_interface: "gs" entry_point: "gease.main:main" diff --git a/gease/_version.py b/gease/_version.py index 0204dc0..deee25d 100644 --- a/gease/_version.py +++ b/gease/_version.py @@ -1,3 +1,3 @@ -__version__ = '0.0.2' +__version__ = '0.0.3' __author__ = 'C. W.' __description__ = 'simply makes a git release using github api v3' diff --git a/setup.py b/setup.py index c68998b..afe9d79 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ NAME = 'gease' AUTHOR = 'C. W.' -VERSION = '0.0.2' +VERSION = '0.0.3' EMAIL = 'wangc_2011@hotmail.com' LICENSE = 'MIT' ENTRY_POINTS = { @@ -22,7 +22,7 @@ '' ) URL = 'https://github.com/moremoban/gease' -DOWNLOAD_URL = '%s/archive/0.0.2.tar.gz' % URL +DOWNLOAD_URL = '%s/archive/0.0.3.tar.gz' % URL FILES = ['README.rst', 'CHANGELOG.rst'] KEYWORDS = [ 'python' @@ -51,11 +51,16 @@ PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests']) EXTRAS_REQUIRE = { } +# You do not need to read beyond this line PUBLISH_COMMAND = '{0} setup.py sdist bdist_wheel upload -r pypi'.format( sys.executable) -GS_COMMAND = ('gs gease v0.0.2 ' + - "Find 0.0.2 in changelog for more details") -here = os.path.abspath(os.path.dirname(__file__)) +GS_COMMAND = ('gs gease v0.0.3 ' + + "Find 0.0.3 in changelog for more details") +NO_GS_MESSAGE = ('Automatic github release is disabled. ' + + 'Please install gease to enable it.') +UPLOAD_FAILED_MSG = ( + 'Upload failed. please run "%s" yourself.' % PUBLISH_COMMAND) +HERE = os.path.abspath(os.path.dirname(__file__)) class PublishCommand(Command): @@ -78,17 +83,36 @@ def finalize_options(self): def run(self): try: self.status('Removing previous builds...') - rmtree(os.path.join(here, 'dist')) + 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) + run_status = True + if has_gease(): + run_status = os.system(GS_COMMAND) == 0 + else: + self.status(NO_GS_MESSAGE) + if run_status: + if os.system(PUBLISH_COMMAND) != 0: + self.status(UPLOAD_FAILED_MSG % PUBLISH_COMMAND) sys.exit() +def has_gease(): + """ + test if github release command is installed + + visit http://github.com/moremoban/gease for more info + """ + try: + import gease # noqa + return True + except ImportError: + return False + + def read_files(*files): """Read files into setup""" text = "" @@ -150,7 +174,6 @@ def filter_out_test_code(file_handle): zip_safe=False, entry_points=ENTRY_POINTS, classifiers=CLASSIFIERS, - setup_requires=['gease'], cmdclass={ 'publish': PublishCommand, }