<s> import inspect <EOL> import os <EOL> import platform <EOL> import sys <EOL> from setuptools import setup , find_packages <EOL> from setuptools . command . test import test as TestCommand <EOL> __location__ = os . path . join ( os . getcwd ( ) , os . path . dirname ( inspect . getfile ( inspect . currentframe ( ) ) ) ) <EOL> def read_version ( package ) : <EOL> with open ( os . path . join ( package , '<STR_LIT>' ) , '<STR_LIT:r>' ) as fd : <EOL> for line in fd : <EOL> if line . startswith ( '<STR_LIT>' ) : <EOL> return line . split ( ) [ - <NUM_LIT:1> ] . strip ( ) . strip ( "<STR_LIT:'>" ) <EOL> version = read_version ( '<STR_LIT>' ) <EOL> py_major_version , py_minor_version , _ = ( int ( v . rstrip ( '<STR_LIT:+>' ) ) for v in platform . python_version_tuple ( ) ) <EOL> def get_install_requirements ( path ) : <EOL> content = open ( os . path . join ( __location__ , path ) ) . read ( ) <EOL> requires = [ req for req in content . split ( '<STR_LIT>' ) if req != '<STR_LIT>' ] <EOL> if py_major_version == <NUM_LIT:2> or ( py_major_version == <NUM_LIT:3> and py_minor_version < <NUM_LIT:4> ) : <EOL> requires . append ( '<STR_LIT>' ) <EOL> return requires <EOL> class PyTest ( TestCommand ) : <EOL> user_options = [ ( '<STR_LIT>' , None , '<STR_LIT>' ) ] <EOL> def initialize_options ( self ) : <EOL> TestCommand . initialize_options ( self ) <EOL> self . cov = None <EOL> self . pytest_args = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> self . cov_html = False <EOL> def finalize_options ( self ) : <EOL> TestCommand . finalize_options ( self ) <EOL> if self . cov_html : <EOL> self . pytest_args . extend ( [ '<STR_LIT>' , '<STR_LIT:html>' ] ) <EOL> def run_tests ( self ) : <EOL> import pytest <EOL> errno = pytest . main ( self . pytest_args ) <EOL> sys . exit ( errno ) <EOL> setup ( <EOL> name = '<STR_LIT>' , <EOL> packages = find_packages ( ) , <EOL> version = version , <EOL> description = '<STR_LIT>' , <EOL> long_description = open ( '<STR_LIT>' ) . read ( ) , <EOL> author = '<STR_LIT>' , <EOL> url = '<STR_LIT>' , <EOL> keywords = '<STR_LIT>' , <EOL> license = '<STR_LIT>' , <EOL> setup_requires = [ '<STR_LIT>' ] , <EOL> install_requires = get_install_requirements ( '<STR_LIT>' ) , <EOL> tests_require = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> cmdclass = { '<STR_LIT:test>' : PyTest } , <EOL> test_suite = '<STR_LIT>' , <EOL> classifiers = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ] , <EOL> include_package_data = True , <EOL> ) </s>
