Skip to content

Commit

Permalink
Issue 21: start PyPI (#22)
Browse files Browse the repository at this point in the history
* update setup.py

Following the PyPI documentation, try building the package for distribution on PyPI. Will need a parent script to do more work than this.

* start of deploying via PyPI

An instiall script to build the a deployment. Right now the script builds this directory rather than collecting a released version from github.com. It will come with time, but here the mechanics of how to build the artifact for PyPI and deliver it is complete. The script is left in safe mode where it will deploy to test.pypi instead of pypi.

Updated the setup.py to work correctly with PyPI. It does a description (poorly) but does one. It has a license and describes it nicely on the website. All inall, it looks like the setup.py is sufficient.
  • Loading branch information
al-niessner authored Jul 27, 2019
1 parent c9d3993 commit 137cd79
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 30 deletions.
61 changes: 61 additions & 0 deletions .ci/pypi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#! /usr/bin/env bash

# COPYRIGHT:
# Copyright (c) 2015-2019, California Institute of Technology ("Caltech").
# U.S. Government sponsorship acknowledged.
#
# All rights reserved.
#
# LICENSE:
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# - Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# - Neither the name of Caltech nor its operating division, the Jet
# Propulsion Laboratory, nor the names of its contributors may be used to
# endorse or promote products derived from this software without specific
# prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# NTR:

if [[ $# -ne 1 ]]
then
echo "usage: $0 <version>"
echo " where <version> is the release number to get from github.com"
exit
fi

# sudo pip3 install -U twine wheel setuptools
export DAWGIE_VERSION=$1
#wdir=$(mkdtemp -d)
#cd $wdir
cd Python
cp ../README.md README.md
cat ../COPYRIGHT.txt > LICENSE
echo "" >> LICENSE
echo "" >> LICENSE
cat ../LICENSE.txt >> LICENSE
python3 setup.py sdist bdist_wheel
twine check dist/*
twine upload --verbose --repository-url https://test.pypi.org/legacy/ dist/*
#twine upload --verbose dist/*
#cd -
#rm -rf $wdir
50 changes: 20 additions & 30 deletions Python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,31 +41,29 @@
import os
import setuptools

base = 'DAWGIE-'
dawgie = os.path.join ('dawgie', '__init__.py')
deps = ['bokeh==0.13.0',
deps = ['bokeh>=1.2',
'boto3>=1.7.80',
'cryptography>=2.1.4',
'GitPython>=2.1.11',
'gnupg>=2.3.1',
'matplotlib>=2.1.1',
'psycopg2>=2.7.4',
'pydot3==1.0.9',
'pyparsing>=2.2',
'python-gnupg==0.4.3',
'pyxb==1.2.6',
'requests>=2.20.0',
'transitions==0.6.8',
'twisted>=18.7.0',
]
version = 'ghrVersion'

if version == 'ghr' + 'Version':
version = os.path.basename (os.path.abspath
(os.path.join (os.path.dirname (__file__),
'..')))
version = version[len(base):] if version.startswith (base) else '0.0.0'
pass

version = os.environ.get ('DAWGIE_VERSION', '0.0.0')
with open (os.path.join (os.path.dirname (__file__), dawgie)) as f: t = f.read()
t = t.replace ('${UNDEFINED}', version)
t = t.replace ("'0.0.0'", "'{0}'".format (version))
with open (os.path.join (os.path.dirname (__file__), dawgie), 'tw') as f:\
f.write (t)
with open (os.path.join (os.path.dirname (__file__), 'README.md'), 'rt') as f:\
description = f.read()

setuptools.setup (name='dawgie',
version=version,
packages=['dawgie',
Expand Down Expand Up @@ -103,21 +101,13 @@
'stylesheets/*.css']},
author='Al Niessner',
author_email='[email protected]',
description='Data and Algorithm Work-flow Generation, Introspection, and Execution (DAWGIE) -- dynamically schedules dawgie.Tasks to be done a worker farm (cloud) and persists the dawgie.Values within the dawgie.StateVectors generated from the dawgie.Algorithms that make up the dawgie.Task.',
license='''*******************************************************************************
**
** Copyright 2017, by the California Institute of Technology
** ALL RIGHTS RESERVED. United States Government Sponsorship acknowledged.
** Any commercial use must be negotiated with the Office of Technology Transfer
** at the California Institute of Technology.
**
** This software may be subject to U.S. export control laws and regulations.
** By accepting this document, the user agrees to comply with all applicable
** U.S. export laws and regulations.
** User has the responsibility to obtain export licenses, or other export
** authority as may be required before exporting such information to foreign
** countries or providing access to foreign persons.
******************************************************************************
** NTR: 50482''',
classifiers=["Programming Language :: Python :: 3",
"Operating System :: OS Independent",
'License :: Free To Use But Restricted',
'Development Status :: 5 - Production/Stable'],
description='Data and Algorithm Work-flow Generation, Introspection, and Execution (DAWGIE)',
license='see LICENSE file for details',
long_description=description,
long_description_content_type="text/markdown",
keywords='adaptive pipeline',
url='https://github.jpl.nasa.gov/niessner/SDS')
url='https://github.com/al-niessner/DAWGIE')

0 comments on commit 137cd79

Please sign in to comment.