Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 25 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,40 @@
addons:
apt:
packages:
- expect-dev # provides unbuffer utility
apt:
packages:
- expect-dev # provides unbuffer utility

language: python

python:
- "2.7"
- "2.7"

virtualenv:
system_site_packages: true
system_site_packages: true

env:
global:
- TESTS="0" LINT_CHECK="0" DOCS="0" VERSION="0.1.0" RELEASE="0.1.0" PROJECT="Python CFSSL" BRANCH_PROD="master" BRANCH_DOC="gh-pages"
matrix:
- TESTS="1"
- DOCS="1"
global:
- VERSION="0.1.0"
- RELEASE="0.0.2"
- PROJECT="Python CFSSL"
- BRANCH_PROD="master"
- BRANCH_DOC="gh-pages"
- TESTS="0"
- LINT_CHECK="0"
- DOCS="0"
- PYPI="0"
- secure: "m5bpPi2ZU6vNchdCjGrj75NR2AWeGHTdPzpU7GIkintcaNA/wX9HPly7NsC91bZ0M3gzuY+xcJuUhKCTlHmDTnr2owP9bS21UFl6sd+WX1SfWcJibrcBdYVtqi3iJphoRnGFcPVq6KAx2s3IcitZivE++PdyLNac1gQgOzcshYcFEenVT+Q1kemPf8uC7bYZHrm75o6ukoeJXA1ydMxBk479YLtWkx6GefMJdCE4vN73SKUakuwZSgBD6s3EqntBWtf6jvFrIKnq0taGe8bSu0GMgX2BwBRrDkLzk0bKRH8B4cmb1MJ/0wCHboKculPVNNrqsYJ7tPlExUnLloPUUKXQKQHNJkaNV77fI8OrRyqu/jZW2IMsN/VgPHrzofmewM++Zd8IRugBjAJAC5BPl2nZQNn4QGoS7rDCjhG6phL+0YyM4wCdzcLBPrqJ4p1hDE6s2Hw6pSmDRie8lKHVMmxasbVUi/SP4lSUMzE/0UeRbTlWAoSA4ogIhWhOUy9P46tfzm2PhRjckx2MCH9Z4fPTWA44lK1SjwPRxBjC4o5Cj6fa4B5PRMSz+DaXyuB0uW0OB7pN9aLozkv7gKemv4GEeid8IWyHl7RwRv/OsCdLJ26+mJ/vqpei33ZxzhGHKjFxechCLa5n3SJm8jGAZicWv3xbiWyxR2SHsJH7PIw="
matrix:
- TESTS="1"
- PYPI="1"
- DOCS="1"

install:
- git clone --depth=1 https://github.com/LasLabs/python-quality-tools.git ${HOME}/python-quality-tools
- export PATH=${HOME}/python-quality-tools/travis:${PATH}
- travis_install
- git clone --depth=1 https://github.com/LasLabs/python-quality-tools.git ${HOME}/python-quality-tools
- export PATH=${HOME}/python-quality-tools/travis:${PATH}
- travis_install

script:
- travis_run
- travis_run

after_success:
- travis_after_success
- travis_after_success
89 changes: 68 additions & 21 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,42 +1,89 @@
# -*- coding: utf-8 -*-
# Copyright 2015-TODAY LasLabs Inc.
# Copyright 2016-TODAY LasLabs Inc.
# License MIT (https://opensource.org/licenses/MIT).

from setuptools import setup
from setuptools import Command, setup
from setuptools import find_packages
from tests import Tests
from unittest import TestLoader, TextTestRunner

from os import environ, path


PROJECT = 'cfssl'
SHORT_DESC = (
'This library will allow you to interact with a remote CFSSL '
'server using Python.'
)
README_FILE = 'README.rst'

version = environ.get('RELEASE') or environ.get('VERSION') or '0.0.0'

if environ.get('TRAVIS_BUILD_NUMBER'):
version += 'b%s' % environ.get('TRAVIS_BUILD_NUMBER')


setup_vals = {
'name': 'cfssl',
'version': '0.0.2',
'name': PROJECT,
'author': 'LasLabs Inc.',
'author_email': 'support@laslabs.com',
'description': 'This library will allow you to interact with CFSSL '
'using Python.',
'url': 'https://laslabs.github.io/python-cfssl',
'download_url': 'https://github.com/LasLabs/python-cfssl',
'description': SHORT_DESC,
'url': 'https://laslabs.github.io/%s' % PROJECT,
'download_url': 'https://github.com/LasLabs/%s' % PROJECT,
'license': 'MIT',
'classifiers': [
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
'version': version,
}


setup(
packages=find_packages(exclude=('tests')),
cmdclass={'test': Tests},
tests_require=[
'mock',
],
install_requires=[
'requests',
],
**setup_vals
)
if path.exists(README_FILE):
with open(README_FILE) as fh:
setup_vals['long_description'] = fh.read()


install_requires = []
if path.exists('requirements.txt'):
with open('requirements.txt') as fh:
install_requires = fh.read().splitlines()


class FailTestException(Exception):
""" It provides a failing build """
pass


class Tests(Command):
''' Run test & coverage, save reports as XML '''

user_options = [] # < For Command API compatibility

def initialize_options(self, ):
pass

def finalize_options(self, ):
pass

def run(self, ):
loader = TestLoader()
tests = loader.discover('.', 'test_*.py')
t = TextTestRunner(verbosity=1)
res = t.run(tests)
if not res.wasSuccessful():
raise FailTestException()

if __name__ == "__main__":
setup(
packages=find_packages(exclude=('tests')),
cmdclass={'test': Tests},
tests_require=[
'mock',
],
install_requires=install_requires,
**setup_vals
)
34 changes: 0 additions & 34 deletions tests.py

This file was deleted.