-
Notifications
You must be signed in to change notification settings - Fork 4
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
amoodie
committed
Oct 6, 2018
1 parent
1930c8a
commit d7e8ce5
Showing
7 changed files
with
101 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import os | ||
import sys | ||
import subprocess | ||
import traceback | ||
import glob | ||
|
||
print('Using python: {prefix}'.format(prefix=sys.prefix)) | ||
|
||
tag_name = os.environ.get('TRAVIS_TAG', 'false') | ||
repo_branch = os.environ.get('TRAVIS_BRANCH', '') | ||
is_pull_request = os.environ.get('TRAVIS_PULL_REQUEST', 'false') | ||
|
||
if is_pull_request == 'false': | ||
is_pull_request = False | ||
elif is_pull_request == 'true': | ||
is_pull_request = True | ||
else: | ||
raise RuntimeError('{val} defined for "is_pull_request"'.format(name=val)) | ||
|
||
if tag_name and tag_name.startswith('v'): | ||
print('Tag made for release:') | ||
print('Building for Pypi release') | ||
_build = True | ||
elif repo_branch == 'master' and not is_pull_request: | ||
print('Commit made to master, and not PR:') | ||
print('Not building......') | ||
_build = False | ||
elif is_pull_request: | ||
print('Build is for a PR, not building.....') | ||
_build = False | ||
else: | ||
_build = False | ||
|
||
if _build: | ||
try: | ||
cmd = 'python setup.py sdist bdist_wheel' | ||
response = subprocess.check_output(cmd, shell=True) | ||
print('Build succeeded.') | ||
except subprocess.CalledProcessError: | ||
print('\n\nBuild failed.\n\n') | ||
traceback.print_exc() | ||
else: | ||
print('No indicators made to build:') | ||
print('Not building.......') |
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import os | ||
import sys | ||
import subprocess | ||
import traceback | ||
import glob | ||
|
||
print('Using python: {prefix}'.format(prefix=sys.prefix)) | ||
|
||
tag_name = os.environ.get('TRAVIS_TAG', 'false') | ||
repo_branch = os.environ.get('TRAVIS_BRANCH', '') | ||
is_pull_request = os.environ.get('TRAVIS_PULL_REQUEST', 'false') | ||
pypi_pass = os.environ.get('PYPI_PASS', 'NOT_A_PASS') | ||
|
||
if is_pull_request == 'false': | ||
is_pull_request = False | ||
elif is_pull_request == 'true': | ||
is_pull_request = True | ||
else: | ||
raise RuntimeError('{val} defined for "is_pull_request"'.format(name=val)) | ||
|
||
if tag_name and tag_name.startswith('v'): | ||
print('Tag made for release:') | ||
print('Uploading to Pypi') | ||
_build = True | ||
channel = 'main' | ||
elif repo_branch == 'master' and not is_pull_request: | ||
print('Commit made to master, and not PR:') | ||
print('Not uploading to Pypi.') | ||
_build = False | ||
elif is_pull_request: | ||
print('Build is for a PR, not uploading to Pypi.') | ||
_build = False | ||
else: | ||
_build = False | ||
|
||
if _build: | ||
try: | ||
cmd = 'twine upload -u amoodie -p{0} dist/*'.format(pypi_pass) | ||
response = subprocess.check_output(cmd, shell=True) | ||
print('Deploy to Pypi succeeded.') | ||
except subprocess.CalledProcessError: | ||
print('\n\tDeploy to PyPi failed.\n\n') | ||
traceback.print_exc() | ||
else: | ||
print('No indicators made to deploy to Pypi:') | ||
print('Not Deploying.......') |
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 was deleted.
Oops, something went wrong.
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 +1 @@ | ||
__version__ = "0.3.3" | ||
__version__ = "0.3.5" |