<s> import logging <EOL> import os <EOL> import sys <EOL> import subprocess <EOL> import warnings <EOL> import codecs <EOL> from setuptools import setup , find_packages , Command <EOL> from setuptools . command . test import test as TestCommand <EOL> NAME = "<STR_LIT>" <EOL> here = os . path . dirname ( __file__ ) <EOL> if here not in sys . path : <EOL> sys . path . insert ( <NUM_LIT:0> , here ) <EOL> from jira . version import __version__ <EOL> warnings . simplefilter ( '<STR_LIT:ignore>' , UserWarning ) <EOL> def _is_ordereddict_needed ( ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> return False <EOL> except ImportError : <EOL> pass <EOL> return True <EOL> class PyTest ( TestCommand ) : <EOL> user_options = [ ( '<STR_LIT>' , '<STR_LIT:a>' , "<STR_LIT>" ) ] <EOL> def initialize_options ( self ) : <EOL> TestCommand . initialize_options ( self ) <EOL> self . pytest_args = [ ] <EOL> logging . basicConfig ( format = '<STR_LIT>' ) <EOL> logging . getLogger ( "<STR_LIT>" ) . setLevel ( logging . INFO ) <EOL> try : <EOL> import pytest_cache <EOL> self . pytest_args . append ( "<STR_LIT>" ) <EOL> except ImportError : <EOL> pass <EOL> self . pytest_args . append ( "<STR_LIT>" ) <EOL> if sys . stdout . isatty ( ) : <EOL> self . pytest_args . append ( "<STR_LIT>" ) <EOL> try : <EOL> import coveralls <EOL> self . pytest_args . append ( "<STR_LIT>" % NAME ) <EOL> self . pytest_args . extend ( [ "<STR_LIT>" , "<STR_LIT>" ] ) <EOL> self . pytest_args . extend ( [ "<STR_LIT>" , "<STR_LIT>" ] ) <EOL> except ImportError : <EOL> pass <EOL> def finalize_options ( self ) : <EOL> TestCommand . finalize_options ( self ) <EOL> self . test_args = [ ] <EOL> self . test_suite = True <EOL> def run_tests ( self ) : <EOL> try : <EOL> subprocess . check_call ( <EOL> "<STR_LIT>" , <EOL> shell = True ) <EOL> except subprocess . CalledProcessError : <EOL> logging . warning ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> import pytest <EOL> errno = pytest . main ( self . pytest_args ) <EOL> sys . exit ( errno ) <EOL> class Release ( Command ) : <EOL> user_options = [ ] <EOL> def initialize_options ( self ) : <EOL> pass <EOL> def finalize_options ( self ) : <EOL> pass <EOL> def run ( self ) : <EOL> import json <EOL> try : <EOL> from urllib . request import urlopen <EOL> except ImportError : <EOL> from urllib2 import urlopen <EOL> response = urlopen ( <EOL> "<STR_LIT>" % NAME ) <EOL> data = json . load ( codecs . getreader ( "<STR_LIT:utf-8>" ) ( response ) ) <EOL> released_version = data [ '<STR_LIT:info>' ] [ '<STR_LIT:version>' ] <EOL> if released_version == __version__ : <EOL> raise RuntimeError ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" % NAME ) <EOL> elif released_version > __version__ : <EOL> raise RuntimeError ( "<STR_LIT>" % ( <EOL> __version__ , released_version ) ) <EOL> class PreRelease ( Command ) : <EOL> user_options = [ ] <EOL> def initialize_options ( self ) : <EOL> pass <EOL> def finalize_options ( self ) : <EOL> pass <EOL> def run ( self ) : <EOL> import json <EOL> try : <EOL> from urllib . request import urlopen <EOL> except ImportError : <EOL> from urllib2 import urlopen <EOL> response = urlopen ( <EOL> "<STR_LIT>" % NAME ) <EOL> data = json . load ( codecs . getreader ( "<STR_LIT:utf-8>" ) ( response ) ) <EOL> released_version = data [ '<STR_LIT:info>' ] [ '<STR_LIT:version>' ] <EOL> if released_version >= __version__ : <EOL> raise RuntimeError ( <EOL> "<STR_LIT>" ) <EOL> setup ( <EOL> name = NAME , <EOL> version = __version__ , <EOL> cmdclass = { '<STR_LIT:test>' : PyTest , '<STR_LIT>' : Release , '<STR_LIT>' : PreRelease } , <EOL> packages = find_packages ( exclude = [ '<STR_LIT>' , '<STR_LIT>' ] ) , <EOL> include_package_data = True , <EOL> install_requires = [ '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ] + ( [ '<STR_LIT>' ] if _is_ordereddict_needed ( ) else [ ] ) , <EOL> tests_require = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] , <EOL> extras_require = { <EOL> '<STR_LIT>' : [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' : [ '<STR_LIT>' ] } , <EOL> entry_points = { <EOL> '<STR_LIT>' : <EOL> [ '<STR_LIT>' ] } , <EOL> license = '<STR_LIT>' , <EOL> description = '<STR_LIT>' , <EOL> long_description = open ( "<STR_LIT>" ) . read ( ) , <EOL> maintainer = '<STR_LIT>' , <EOL> maintainer_email = '<STR_LIT>' , <EOL> author = '<STR_LIT>' , <EOL> author_email = '<STR_LIT>' , <EOL> provides = [ NAME ] , <EOL> url = '<STR_LIT>' , <EOL> bugtrack_url = '<STR_LIT>' , <EOL> home_page = '<STR_LIT>' , <EOL> download_url = '<STR_LIT>' % __version__ , <EOL> keywords = '<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> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ] ) </s>
