<s> import sys <EOL> import os <EOL> from glob import glob <EOL> import platform <EOL> def running_under_virtualenv ( ) : <EOL> if hasattr ( sys , '<STR_LIT>' ) : <EOL> return True <EOL> elif sys . prefix != getattr ( sys , "<STR_LIT>" , sys . prefix ) : <EOL> return True <EOL> if os . getenv ( '<STR_LIT>' , False ) : <EOL> return True <EOL> return False <EOL> if os . environ . get ( '<STR_LIT>' ) : <EOL> from setuptools import setup <EOL> setup_kwargs = dict ( zip_safe = <NUM_LIT:0> ) <EOL> else : <EOL> from distutils . core import setup <EOL> setup_kwargs = dict ( ) <EOL> if os . name == '<STR_LIT>' : <EOL> pgm_files = os . environ [ "<STR_LIT>" ] <EOL> base_files = os . path . join ( pgm_files , '<STR_LIT>' ) <EOL> data_files = [ <EOL> ( base_files , [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) , <EOL> ( os . path . join ( base_files , '<STR_LIT>' ) , [ ] ) , <EOL> ( os . path . join ( base_files , '<STR_LIT>' ) , glob ( '<STR_LIT>' ) ) , <EOL> ( os . path . join ( base_files , '<STR_LIT>' ) , glob ( '<STR_LIT>' ) ) , <EOL> ( os . path . join ( base_files , '<STR_LIT>' ) , glob ( '<STR_LIT>' ) ) , <EOL> ] <EOL> install_requires = [ '<STR_LIT>' , '<STR_LIT>' , ] , <EOL> else : <EOL> data_files = [ <EOL> ( '<STR_LIT>' , [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) , <EOL> ( '<STR_LIT>' , [ ] ) , <EOL> ] <EOL> distro = platform . dist ( ) [ <NUM_LIT:0> ] <EOL> distro_major_version = platform . dist ( ) [ <NUM_LIT:1> ] . split ( '<STR_LIT:.>' ) [ <NUM_LIT:0> ] <EOL> if running_under_virtualenv ( ) : <EOL> data_files . append ( ( '<STR_LIT>' , <EOL> glob ( '<STR_LIT>' ) ) ) <EOL> data_files . append ( ( '<STR_LIT>' , <EOL> glob ( '<STR_LIT>' ) ) ) <EOL> data_files . append ( ( '<STR_LIT>' , <EOL> glob ( '<STR_LIT>' ) ) ) <EOL> else : <EOL> data_files . append ( ( '<STR_LIT>' , <EOL> glob ( '<STR_LIT>' ) ) ) <EOL> data_files . append ( ( '<STR_LIT>' , <EOL> glob ( '<STR_LIT>' ) ) ) <EOL> data_files . append ( ( '<STR_LIT>' , <EOL> glob ( '<STR_LIT>' ) ) ) <EOL> if distro == '<STR_LIT>' : <EOL> data_files . append ( ( '<STR_LIT>' , <EOL> [ '<STR_LIT>' ] ) ) <EOL> if distro in [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] : <EOL> data_files . append ( ( '<STR_LIT>' , <EOL> [ '<STR_LIT>' ] ) ) <EOL> data_files . append ( ( '<STR_LIT>' , <EOL> [ '<STR_LIT>' ] ) ) <EOL> if distro_major_version >= '<STR_LIT>' and not distro == '<STR_LIT>' : <EOL> data_files . append ( ( '<STR_LIT>' , <EOL> [ '<STR_LIT>' ] ) ) <EOL> elif distro_major_version >= '<STR_LIT>' and not distro == '<STR_LIT>' : <EOL> data_files . append ( ( '<STR_LIT>' , <EOL> [ '<STR_LIT>' ] ) ) <EOL> if running_under_virtualenv ( ) : <EOL> install_requires = [ '<STR_LIT>' , '<STR_LIT>' , ] <EOL> else : <EOL> if distro == [ '<STR_LIT>' , '<STR_LIT>' ] : <EOL> install_requires = [ '<STR_LIT>' , '<STR_LIT>' , ] <EOL> else : <EOL> install_requires = [ '<STR_LIT>' , '<STR_LIT>' , ] <EOL> def get_version ( ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> f = open ( '<STR_LIT>' ) <EOL> except IOError : <EOL> os . system ( "<STR_LIT>" ) <EOL> f = open ( '<STR_LIT>' ) <EOL> version = '<STR_LIT>' . join ( f . readlines ( ) ) . rstrip ( ) <EOL> f . close ( ) <EOL> return version <EOL> def pkgPath ( root , path , rpath = "<STR_LIT:/>" ) : <EOL> """<STR_LIT>""" <EOL> global data_files <EOL> if not os . path . exists ( path ) : <EOL> return <EOL> files = [ ] <EOL> for spath in os . listdir ( path ) : <EOL> if spath == '<STR_LIT:test>' : <EOL> continue <EOL> subpath = os . path . join ( path , spath ) <EOL> spath = os . path . join ( rpath , spath ) <EOL> if os . path . isfile ( subpath ) : <EOL> files . append ( subpath ) <EOL> if os . path . isdir ( subpath ) : <EOL> pkgPath ( root , subpath , spath ) <EOL> data_files . append ( ( root + rpath , files ) ) <EOL> if os . name == '<STR_LIT>' : <EOL> pkgPath ( os . path . join ( base_files , '<STR_LIT>' ) , '<STR_LIT>' , '<STR_LIT:\\>' ) <EOL> else : <EOL> pkgPath ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> version = get_version ( ) <EOL> setup ( <EOL> name = '<STR_LIT>' , <EOL> version = version , <EOL> url = '<STR_LIT>' , <EOL> author = '<STR_LIT>' , <EOL> author_email = '<STR_LIT>' , <EOL> license = '<STR_LIT>' , <EOL> description = '<STR_LIT>' , <EOL> package_dir = { '<STR_LIT>' : '<STR_LIT:src>' } , <EOL> packages = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> scripts = [ '<STR_LIT>' , '<STR_LIT>' ] , <EOL> data_files = data_files , <EOL> install_requires = install_requires , <EOL> ** setup_kwargs <EOL> ) </s>
