Skip to content
Snippets Groups Projects
Commit 76a15c44 authored by Jason R Laura's avatar Jason R Laura
Browse files

Added a setup.py

parent 7dc976c3
No related branches found
No related tags found
Loading
...@@ -71,4 +71,4 @@ target/ ...@@ -71,4 +71,4 @@ target/
#Data and output files #Data and output files
.csv .csv
.png .png
.SAV .SAV
\ No newline at end of file
...@@ -5,6 +5,10 @@ branches: ...@@ -5,6 +5,10 @@ branches:
only: only:
- master - master
os:
- linux
- osx
python: python:
- "3.5" - "3.5"
...@@ -35,6 +39,8 @@ install: ...@@ -35,6 +39,8 @@ install:
script: script:
- nosetests --with-coverage --cover-package=plio - nosetests --with-coverage --cover-package=plio
# After test success, package and upload to Anaconda
- python build.py --project plio
after_success: after_success:
- coveralls - coveralls
...@@ -48,4 +54,4 @@ notifications: ...@@ -48,4 +54,4 @@ notifications:
recipients: recipients:
- jlaura@usgs.gov - jlaura@usgs.gov
on_success: always on_success: always
on_failure: always on_failure: always
\ No newline at end of file
build.py 0 → 100644
#!/usr/bin/env python
import sys
import os
import sh
from argparse import ArgumentParser
# Initialize
try:
token = os.environ['BINSTAR_KEYN']
except KeyError:
sys.exit("Must set $BINSTAR_KEY")
binstar = sh.Command('binstar').bake(t=token)
conda = sh.Command('conda')
def build_and_publish(path, channel):
binfile = conda.build("--output", path).strip()
print "Building..."
conda.build(path)
print "Upload to Anaconda.org..."
binstar.upload(binfile, force=True, channel=channel)
def conda_paths(project_name):
conda_recipes_dir = os.path.join(project_name, 'conda')
if not os.path.isdir(conda_recipes_dir):
sys.exit('no such dir: {}'.format(conda_recipes_dir))
for name in sorted(os.listdir(conda_recipes_dir)):
yield os.path.join(conda_recipes_dir, name)
def main():
parser = ArgumentParser()
parser.add_argument('-p', '--project', required=True)
parser.add_argument('-c', '--channel', required=False, default='main')
parser.add_argument('-s', '--site', required=False, default=None)
args = parser.parse_args()
for conda_path in conda_paths(args.project):
build_and_publish(conda_path, channel=args.channel)
return 0
if __name__ == '__main__':
sys.exit(main())
setup.py 0 → 100644
from setuptools import setup
setup(
name = "plio",
version = "0.1.0",
author = "Jay Laura",
author_email = "jlaura@usgs.gov",
description = ("I/O API to support planetary data formats."),
license = "Public Domain",
keywords = "planetary io",
url = "http://packages.python.org/plio",
packages=['plio'],
install_requires=[
'gdal>=2',
'pvl',
'protobuf=3.0.0b2',
'h5py',
'pandas',
'sqlalchemy',
'pyyaml'],
classifiers=[
"Development Status :: 3 - Alpha",
"Topic :: Utilities",
"License :: Public Domain",
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment