4141"""
4242
4343
44- NAME = ' pyrad_mch'
44+ NAME = " pyrad_mch"
4545MAINTAINER = "MeteoSwiss Pyrad Developers"
4646MAINTAINER_EMAIL = "daniel.wolfensberger@meteoswiss.ch"
4747DESCRIPTION = DOCLINES [0 ]
4848LONG_DESCRIPTION = "\n " .join (DOCLINES [2 :])
4949URL = "https://github.com/MeteoSwiss/pyrad.git"
5050DOWNLOAD_URL = "https://github.com/MeteoSwiss/pyrad.git"
51- LICENSE = ' BSD'
52- CLASSIFIERS = list (filter (None , CLASSIFIERS .split (' \n ' )))
51+ LICENSE = " BSD"
52+ CLASSIFIERS = list (filter (None , CLASSIFIERS .split (" \n " )))
5353PLATFORMS = ["Linux" ]
5454MAJOR = 2
5555MINOR = 0
56- MICRO = 0
56+ MICRO = 1
5757ISRELEASED = True
58- VERSION = ' %d.%d.%d' % (MAJOR , MINOR , MICRO )
59- SCRIPTS = glob .glob (' scripts/*' )
58+ VERSION = " %d.%d.%d" % (MAJOR , MINOR , MICRO )
59+ SCRIPTS = glob .glob (" scripts/*" )
6060COMPILE_DATE_TIME = datetime .utcnow ().strftime ("%Y-%m-%d %H:%M" )
6161USERNAME = getpass .getuser ()
6262
@@ -66,21 +66,20 @@ def git_version():
6666 def _minimal_ext_cmd (cmd ):
6767 # construct minimal environment
6868 env = {}
69- for k in [' SYSTEMROOT' , ' PATH' ]:
69+ for k in [" SYSTEMROOT" , " PATH" ]:
7070 v = os .environ .get (k )
7171 if v is not None :
7272 env [k ] = v
7373 # LANGUAGE is used on win32
74- env ['LANGUAGE' ] = 'C'
75- env ['LANG' ] = 'C'
76- env ['LC_ALL' ] = 'C'
77- out = subprocess .Popen (
78- cmd , stdout = subprocess .PIPE , env = env ).communicate ()[0 ]
74+ env ["LANGUAGE" ] = "C"
75+ env ["LANG" ] = "C"
76+ env ["LC_ALL" ] = "C"
77+ out = subprocess .Popen (cmd , stdout = subprocess .PIPE , env = env ).communicate ()[0 ]
7978 return out
8079
8180 try :
82- out = _minimal_ext_cmd ([' git' , ' rev-parse' , ' HEAD' ])
83- GIT_REVISION = out .strip ().decode (' ascii' )
81+ out = _minimal_ext_cmd ([" git" , " rev-parse" , " HEAD" ])
82+ GIT_REVISION = out .strip ().decode (" ascii" )
8483 except OSError :
8584 GIT_REVISION = "Unknown"
8685
@@ -89,8 +88,8 @@ def _minimal_ext_cmd(cmd):
8988
9089# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
9190# update it when the contents of directories change.
92- if os .path .exists (' MANIFEST' ):
93- os .remove (' MANIFEST' )
91+ if os .path .exists (" MANIFEST" ):
92+ os .remove (" MANIFEST" )
9493
9594# This is a bit hackish: we are setting a global variable so that the main
9695# pyrad __init__ can detect if it is being loaded by the setup routine, to
@@ -99,7 +98,7 @@ def _minimal_ext_cmd(cmd):
9998builtins .__PYRAD_SETUP__ = True
10099
101100
102- def write_version_py (filename = ' pyrad/version.py' ):
101+ def write_version_py (filename = " pyrad/version.py" ):
103102 cnt = """
104103# THIS FILE IS GENERATED FROM PYRAD_PROC SETUP.PY
105104short_version = '%(version)s'
@@ -116,49 +115,59 @@ def write_version_py(filename='pyrad/version.py'):
116115 # Adding the git rev number needs to be done inside write_version_py(),
117116 # otherwise the import of pyrad.version messes up the build under Python 3.
118117 FULLVERSION = VERSION
119- if os .path .exists (' ../../.git' ):
118+ if os .path .exists (" ../../.git" ):
120119 GIT_REVISION = git_version ()
121- elif os .path .exists (' pyrad/version.py' ):
120+ elif os .path .exists (" pyrad/version.py" ):
122121 # must be a source distribution, use existing version file
123122 try :
124123 from pyrad .version import git_revision as GIT_REVISION
125124 except ImportError :
126- raise ImportError ("Unable to import git_revision. Try removing "
127- "pyrad/version.py and the build directory "
128- "before building." )
125+ raise ImportError (
126+ "Unable to import git_revision. Try removing "
127+ "pyrad/version.py and the build directory "
128+ "before building."
129+ )
129130 else :
130131 GIT_REVISION = "Unknown"
131132
132133 if not ISRELEASED :
133- FULLVERSION += ' .dev+' + GIT_REVISION [:7 ]
134+ FULLVERSION += " .dev+" + GIT_REVISION [:7 ]
134135
135- a = open (filename , 'w' )
136+ a = open (filename , "w" )
136137 try :
137- a .write (cnt % {'version' : VERSION ,
138- 'full_version' : FULLVERSION ,
139- 'git_revision' : GIT_REVISION ,
140- 'compile_date_time' : COMPILE_DATE_TIME ,
141- 'username' : USERNAME ,
142- 'isrelease' : str (ISRELEASED )})
138+ a .write (
139+ cnt
140+ % {
141+ "version" : VERSION ,
142+ "full_version" : FULLVERSION ,
143+ "git_revision" : GIT_REVISION ,
144+ "compile_date_time" : COMPILE_DATE_TIME ,
145+ "username" : USERNAME ,
146+ "isrelease" : str (ISRELEASED ),
147+ }
148+ )
143149 finally :
144150 a .close ()
145151
146152
147- def configuration (parent_package = '' , top_path = None ):
153+ def configuration (parent_package = "" , top_path = None ):
148154 from numpy .distutils .misc_util import Configuration
155+
149156 config = Configuration (None , parent_package , top_path )
150- config .set_options (ignore_setup_xxx_py = True ,
151- assume_default_configuration = True ,
152- delegate_options_to_subpackages = True ,
153- quiet = True )
157+ config .set_options (
158+ ignore_setup_xxx_py = True ,
159+ assume_default_configuration = True ,
160+ delegate_options_to_subpackages = True ,
161+ quiet = True ,
162+ )
154163
155- config .add_subpackage (' pyrad' )
156- config .add_data_files ((' pyrad' , ' *.txt' ))
164+ config .add_subpackage (" pyrad" )
165+ config .add_data_files ((" pyrad" , " *.txt" ))
157166
158167 return config
159168
160169
161- if __name__ == ' __main__' :
170+ if __name__ == " __main__" :
162171 write_version_py ()
163172 setup (
164173 name = NAME ,
0 commit comments