Skip to content

Commit

Permalink
🥚 🎡 release 0.0.2, that won't need gease for the end user
Browse files Browse the repository at this point in the history
  • Loading branch information
chfw committed Oct 23, 2017
1 parent 07475f8 commit b405231
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 10 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Change log
===========

0.0.2 - 23.10.2017
--------------------------------------------------------------------------------

#. pyexcel `#105 <https://github.com/pyexcel/pyexcel/issues/105>`_, remove gease
from setup_requires, introduced by 0.1.3.


0.0.1 - unreleased
--------------------------------------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Installation
================================================================================


You can install it via pip:
You can install brython-pack via pip:

.. code-block:: bash
Expand All @@ -34,7 +34,7 @@ or clone it and install it:

.. code-block:: bash
$ git clone http://github.com/chfw/brython-pack.git
$ git clone https://github.com/chfw/brython-pack.git
$ cd brython-pack
$ python setup.py install
Expand Down
38 changes: 30 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Template by setupmobans
import os
import sys
import codecs
from shutil import rmtree
from setuptools import setup, find_packages, Command
import sys
PY2 = sys.version_info[0] == 2
PY26 = PY2 and sys.version_info[1] < 7

Expand Down Expand Up @@ -48,11 +48,15 @@

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 brython-pack v0.0.1 ' +
"Find 0.0.1 in changelog for more details")
here = os.path.abspath(os.path.dirname(__file__))
NO_GS_MESSAGE = ('Automatic github release is disabled. ' +
'Please install gease to enable it.')
UPLOAD_FAILED_MSG = ('Upload failed. please run "%s" yourself.')
HERE = os.path.abspath(os.path.dirname(__file__))


class PublishCommand(Command):
Expand All @@ -74,18 +78,37 @@ def finalize_options(self):

def run(self):
try:
self.status('Removing previous builds')
rmtree(os.path.join(here, 'dist'))
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)
self.status('Building Source and Wheel (universal) distribution...')
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 = ""
Expand Down Expand Up @@ -147,7 +170,6 @@ def filter_out_test_code(file_handle):
zip_safe=False,
entry_points=ENTRY_POINTS,
classifiers=CLASSIFIERS,
setup_requires=['gease'],
cmdclass={
'publish': PublishCommand,
}
Expand Down

0 comments on commit b405231

Please sign in to comment.