From 84ba619d4f39f3ed0aacb019a911ad1e061e99a0 Mon Sep 17 00:00:00 2001 From: Jeff Franklin Date: Fri, 21 Dec 2018 14:56:30 -0800 Subject: [PATCH] Deploy to pypi on tags. --- .travis.yml | 21 +++++++++++++++++---- resttools/VERSION | 2 ++ setup.py | 18 ++++++++++++++---- 3 files changed, 33 insertions(+), 8 deletions(-) create mode 100644 resttools/VERSION diff --git a/.travis.yml b/.travis.yml index 7b384fe..18b56cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,28 @@ language: python python: - - "2.7" - - "3.6" + - '2.7' + - '3.6' install: - pip install -r requirements.txt + - set | grep TRAVIS + - set | grep GIT before_script: - pip install coverage - pip install pep8 script: - pep8 --max-line-length=120 resttools - - nosetests --with-coverage --cover-package=resttools + - nosetests --with-coverage --cover-package=resttools after_script: - coverage report - +before_deploy: + - find resttools/ -name \*.pyc -exec rm {} \; + - git describe --tags > resttools/VERSION +deploy: + provider: pypi + skip_cleanup: true + user: jeffrouw + password: + secure: Hk16fdmiYvODsFjQl6hVF8LwphRUzIXOO7KA8bD3m2xM6hw9a01Tf0sv37wSUEJSJOURv1K8MBSOdE7yFGaYB5it7DvGI3ozGX2RMcCdkKWD6wtRHxTy1r8iOpQXEaOkYo32ZbVYQGAjVoJHlIf5U/IkyJAV2khJwiWd66PTX/8= + on: + tags: true + python: '3.6' diff --git a/resttools/VERSION b/resttools/VERSION new file mode 100644 index 0000000..3d16293 --- /dev/null +++ b/resttools/VERSION @@ -0,0 +1,2 @@ +# Updated by CI at deploy-time +0.0.1 diff --git a/setup.py b/setup.py index 48b8993..74c8607 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,18 @@ -# from distutils.core import setup +import os from setuptools import setup, find_packages -setup(name='resttools', - version='1.0', - description='UW-IT REST library', + +BASE_DIR = os.path.abspath(os.path.dirname(__file__)) +VERSION_FILE = os.path.join(BASE_DIR, 'resttools', 'VERSION') +with open(VERSION_FILE) as f: + VERSION = f.readlines()[-1].strip() + +setup(name='uw-iam-resttools', + version=VERSION, + url='https://github.com/UWIT-IAM/iam-resttools', + author='UW-IT Identity and Access Management', + author_email='help@uw.edu', + description='UW-IT REST library for IAM APIs', + license='Apache License, Version 2.0', packages=find_packages(), include_package_data=True, install_requires=['lxml', 'python-dateutil', 'urllib3', 'jinja2', 'six']