-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
41 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,9 @@ organisation: "moremoban" | |
author: "C. W." | ||
contact: "[email protected]" | ||
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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
|
||
NAME = 'gease' | ||
AUTHOR = 'C. W.' | ||
VERSION = '0.0.2' | ||
VERSION = '0.0.3' | ||
EMAIL = '[email protected]' | ||
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, | ||
} | ||
|