Commit 76a15c44 authored by Jason R Laura's avatar Jason R Laura
Browse files

Added a setup.py

parent 7dc976c3
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -5,6 +5,10 @@ branches:
only:
  - master

os: 
  - linux
  - osx

python:
  - "3.5"

@@ -35,6 +39,8 @@ install:

script:
  - nosetests --with-coverage --cover-package=plio
  # After test success, package and upload to Anaconda
  - python build.py --project plio

after_success:
  - coveralls

build.py

0 → 100644
+50 −0
Original line number Diff line number Diff line
#!/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.cfg

0 → 100644
+0 −0

Empty file added.

setup.py

0 → 100644
+31 −0
Original line number Diff line number Diff line
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',
    ],
)
+1 −1

File changed.

Contains only whitespace changes.