Skip to content

Commit

Permalink
updates, deploy 0.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
amoodie committed Oct 6, 2018
1 parent 1930c8a commit d7e8ce5
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 12 deletions.
3 changes: 1 addition & 2 deletions .ci/travis/anaconda_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@
binary_path])

try:
print('Uploading to Anaconda Cloud with command:\n\t',
cmd)
subprocess.check_call(cmd, shell=True)
print('Upload succeeded to {channel} for file:\n\t{file}'.format(channel=channel,file=binary_path))
except subprocess.CalledProcessError:
traceback.print_exc()
else:
Expand Down
44 changes: 44 additions & 0 deletions .ci/travis/pypi_build.py
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.......')
46 changes: 46 additions & 0 deletions .ci/travis/pypi_upload.py
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.......')
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ after_success:
if [[ "$DEPLOY" == "1" ]]; then
echo "DEPLOY = TRUE; building and uploading to Anaconda Cloud and Pypi"
conda install -q conda-build anaconda-client
pip3 install twine wheel
python .ci/travis/anaconda_build.py
python .ci/travis/anaconda_upload.py
bash .ci/travis/pypi_build.sh
bash .ci/travis/pypi_build.sh
python .ci/travis/pypi_build.py
python .ci/travis/pypi_deploy.py
fi
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Explore how a river becomes stratigraphy

<img src="https://github.com/amoodie/rivers2stratigraphy/blob/master/private/rivers2stratigraphy_demo.gif" alt="demo_gif">
<img src="https://github.com/sededu/rivers2stratigraphy/blob/master/private/rivers2stratigraphy_demo.gif" alt="demo_gif">


This readme file provides an overview of the installation and setup process, as well as a brief description of the module worksheets available.
Expand Down Expand Up @@ -43,7 +43,7 @@ See below for detailed instructions on installing `rivers2stratigraphy` for your
If you installed Anaconda Python or Miniconda, you can follow the instructions below for your operating system.
Otherwise see the instructions for PyPi installation below.

__Please__ [open an issue](https://github.com/amoodie/rivers2stratigraphy/issues) if you encounter any troubles installing or any error messages along the way!
__Please__ [open an issue](https://github.com/sededu/rivers2stratigraphy/issues) if you encounter any troubles installing or any error messages along the way!
Please include 1) operating system, 2) installation method, and 3) copy-paste the error.


Expand Down Expand Up @@ -106,7 +106,7 @@ Alternatively, run the module with provided script (this is the hook used for la
python3 <path-to-installation>run_rivers2stratigraphy.py
```

Please [open an issue](https://github.com/amoodie/rivers2stratigraphy/issues) if you encounter any additional error messages!
Please [open an issue](https://github.com/sededu/rivers2stratigraphy/issues) if you encounter any additional error messages!
Please include 1) operating system, 2) installation method, and 3) copy-paste the error.


Expand All @@ -121,18 +121,18 @@ This module is under ongoing development to improve stability and features and o
The module also requires occasional maintenance due to dependency updates.
If you are interested in contributing to the code-base please see below for instructions.

If you are interested in contributing to the accompanying worksheets/activities (which would be greatly appreciated!) please see [Writing Activities for SedEdu](https://github.com/amoodie/sededu/blob/develop/docs/writing_activities.md)
If you are interested in contributing to the accompanying worksheets/activities (which would be greatly appreciated!) please see [Writing Activities for SedEdu](https://github.com/sededu/sededu/blob/develop/docs/writing_activities.md)


#### Download the source code

You can download this entire repository as a `.zip` by clicking the "Clone or download button on this page", or by [clicking here](https://github.com/amoodie/rivers2stratigraphy/archive/master.zip) to get a `.zip` folder.
You can download this entire repository as a `.zip` by clicking the "Clone or download button on this page", or by [clicking here](https://github.com/sededu/rivers2stratigraphy/archive/master.zip) to get a `.zip` folder.
Unzip the folder in your preferred location.

If you have installed `git` and are comfortable working with it, you can simply clone the repository to your preferred location.

```
git clone https://github.com/amoodie/rivers2stratigraphy.git
git clone https://github.com/sededu/rivers2stratigraphy.git
```

Open a pull request when you want a review or some comments!
1 change: 0 additions & 1 deletion private/tweet.txt

This file was deleted.

2 changes: 1 addition & 1 deletion rivers2stratigraphy/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.3.3"
__version__ = "0.3.5"

0 comments on commit d7e8ce5

Please sign in to comment.