thiomajid commited on
Commit
26a5c6e
·
verified ·
1 Parent(s): f5e652b

Delete parsed_commits

Browse files
parsed_commits/partition_0.json DELETED
The diff for this file is too large to render. See raw diff
 
parsed_commits/partition_1.json DELETED
@@ -1,885 +0,0 @@
1
- [
2
- {
3
- "hash": "64ffff9d53d2c26f0b7c014fb0152ccfc6568c34",
4
- "msg": "Fixed bug in build_ext.py",
5
- "author": {
6
- "name": "Pearu Peterson",
7
- "email": "pearu.peterson@gmail.com"
8
- },
9
- "committer": {
10
- "name": "Pearu Peterson",
11
- "email": "pearu.peterson@gmail.com"
12
- },
13
- "author_date": "2002-02-19T17:33:57+00:00",
14
- "author_timezone": 0,
15
- "committer_date": "2002-02-19T17:33:57+00:00",
16
- "committer_timezone": 0,
17
- "branches": [
18
- "main"
19
- ],
20
- "in_main_branch": true,
21
- "merge": false,
22
- "parents": [
23
- "5ba533b4b7b4562c36df4d0a698efff872a98086"
24
- ],
25
- "project_name": "repo_copy",
26
- "project_path": "/tmp/tmp76x_jct4/repo_copy",
27
- "deletions": 1,
28
- "insertions": 1,
29
- "lines": 2,
30
- "files": 1,
31
- "dmm_unit_size": null,
32
- "dmm_unit_complexity": null,
33
- "dmm_unit_interfacing": null,
34
- "modified_files": [
35
- {
36
- "old_path": "scipy_distutils/command/build_ext.py",
37
- "new_path": "scipy_distutils/command/build_ext.py",
38
- "filename": "build_ext.py",
39
- "extension": "py",
40
- "change_type": "MODIFY",
41
- "diff": "@@ -71,7 +71,7 @@ def build_extension(self, ext):\n #self.compiler.libraries = self.compiler.libraries + l\n lib_dirs = build_flib.get_fcompiler_library_dirs()\n for lib_dir in lib_dirs:\n- if lib_dir not in self.compiler.libraries_dirs:\n+ if lib_dir not in self.compiler.library_dirs:\n self.compiler.libraries.append(lib_dir)\n #self.compiler.library_dirs = self.compiler.library_dirs + l\n \n",
42
- "added_lines": 1,
43
- "deleted_lines": 1,
44
- "source_code": "\"\"\" Modified version of build_ext that handles fortran source files.\n\"\"\"\n\nimport os, string\nfrom types import *\n\nfrom distutils.dep_util import newer_group, newer\nfrom distutils.command.build_ext import *\nfrom distutils.command.build_ext import build_ext as old_build_ext\n\nfrom scipy_distutils.command.build_clib import get_headers,get_directories\n\nclass build_ext (old_build_ext):\n\n def build_extension(self, ext):\n #XXX: anything else we need to save?\n save_linker_so = self.compiler.linker_so\n save_compiler_libs = self.compiler.libraries\n save_compiler_libs_dirs = self.compiler.library_dirs\n \n # support for building static fortran libraries\n need_f_libs = 0\n ext_name = string.split(ext.name,'.')[-1]\n\n if self.distribution.has_f_libraries():\n build_flib = self.get_finalized_command('build_flib')\n if build_flib.has_f_library(ext_name):\n need_f_libs = 1\n else:\n for lib_name in ext.libraries:\n if build_flib.has_f_library(lib_name):\n need_f_libs = 1\n break\n print ext.name,ext_name,'needs fortran libraries',need_f_libs\n \n if need_f_libs:\n moreargs = build_flib.fcompiler.get_extra_link_args()\n if moreargs != []:\n if ext.extra_link_args is None:\n ext.extra_link_args = moreargs\n else:\n ext.extra_link_args += moreargs\n if build_flib.has_f_library(ext_name) and \\\n ext_name not in ext.libraries:\n ext.libraries.append(ext_name)\n for lib_name in ext.libraries[:]:\n ext.libraries.extend(build_flib.get_library_names(lib_name))\n ext.library_dirs.extend(build_flib.get_library_dirs(lib_name))\n \n ext.library_dirs.append(build_flib.build_flib)\n runtime_dirs = build_flib.get_runtime_library_dirs()\n ext.runtime_library_dirs.extend(runtime_dirs or [])\n \n linker_so = build_flib.fcompiler.get_linker_so()\n\n if linker_so is not None:\n if linker_so is not save_linker_so:\n print 'replacing linker_so %s with %s' %(save_linker_so,linker_so)\n self.compiler.linker_so = linker_so\n l = build_flib.get_fcompiler_library_names()\n #l = self.compiler.libraries + l\n self.compiler.libraries = l\n l = build_flib.get_fcompiler_library_dirs()\n #l = self.compiler.library_dirs + l\n self.compiler.library_dirs = l\n else:\n libs = build_flib.get_fcompiler_library_names()\n for lib in libs:\n if lib not in self.compiler.libraries:\n self.compiler.libraries.append(lib)\n #self.compiler.libraries = self.compiler.libraries + l\n lib_dirs = build_flib.get_fcompiler_library_dirs()\n for lib_dir in lib_dirs:\n if lib_dir not in self.compiler.library_dirs:\n self.compiler.libraries.append(lib_dir)\n #self.compiler.library_dirs = self.compiler.library_dirs + l\n \n # end of fortran source support\n res = old_build_ext.build_extension(self,ext)\n\n if save_linker_so is not self.compiler.linker_so:\n print 'restoring linker_so',save_linker_so\n self.compiler.linker_so = save_linker_so\n self.compiler.libraries = save_compiler_libs\n self.compiler.library_dirs = save_compiler_libs_dirs\n\n return res\n\n def get_source_files (self):\n self.check_extensions_list(self.extensions)\n filenames = []\n\n # Get sources and any include files in the same directory.\n for ext in self.extensions:\n filenames.extend(ext.sources)\n filenames.extend(get_headers(get_directories(ext.sources)))\n\n return filenames\n",
45
- "source_code_before": "\"\"\" Modified version of build_ext that handles fortran source files.\n\"\"\"\n\nimport os, string\nfrom types import *\n\nfrom distutils.dep_util import newer_group, newer\nfrom distutils.command.build_ext import *\nfrom distutils.command.build_ext import build_ext as old_build_ext\n\nfrom scipy_distutils.command.build_clib import get_headers,get_directories\n\nclass build_ext (old_build_ext):\n\n def build_extension(self, ext):\n #XXX: anything else we need to save?\n save_linker_so = self.compiler.linker_so\n save_compiler_libs = self.compiler.libraries\n save_compiler_libs_dirs = self.compiler.library_dirs\n \n # support for building static fortran libraries\n need_f_libs = 0\n ext_name = string.split(ext.name,'.')[-1]\n\n if self.distribution.has_f_libraries():\n build_flib = self.get_finalized_command('build_flib')\n if build_flib.has_f_library(ext_name):\n need_f_libs = 1\n else:\n for lib_name in ext.libraries:\n if build_flib.has_f_library(lib_name):\n need_f_libs = 1\n break\n print ext.name,ext_name,'needs fortran libraries',need_f_libs\n \n if need_f_libs:\n moreargs = build_flib.fcompiler.get_extra_link_args()\n if moreargs != []:\n if ext.extra_link_args is None:\n ext.extra_link_args = moreargs\n else:\n ext.extra_link_args += moreargs\n if build_flib.has_f_library(ext_name) and \\\n ext_name not in ext.libraries:\n ext.libraries.append(ext_name)\n for lib_name in ext.libraries[:]:\n ext.libraries.extend(build_flib.get_library_names(lib_name))\n ext.library_dirs.extend(build_flib.get_library_dirs(lib_name))\n \n ext.library_dirs.append(build_flib.build_flib)\n runtime_dirs = build_flib.get_runtime_library_dirs()\n ext.runtime_library_dirs.extend(runtime_dirs or [])\n \n linker_so = build_flib.fcompiler.get_linker_so()\n\n if linker_so is not None:\n if linker_so is not save_linker_so:\n print 'replacing linker_so %s with %s' %(save_linker_so,linker_so)\n self.compiler.linker_so = linker_so\n l = build_flib.get_fcompiler_library_names()\n #l = self.compiler.libraries + l\n self.compiler.libraries = l\n l = build_flib.get_fcompiler_library_dirs()\n #l = self.compiler.library_dirs + l\n self.compiler.library_dirs = l\n else:\n libs = build_flib.get_fcompiler_library_names()\n for lib in libs:\n if lib not in self.compiler.libraries:\n self.compiler.libraries.append(lib)\n #self.compiler.libraries = self.compiler.libraries + l\n lib_dirs = build_flib.get_fcompiler_library_dirs()\n for lib_dir in lib_dirs:\n if lib_dir not in self.compiler.libraries_dirs:\n self.compiler.libraries.append(lib_dir)\n #self.compiler.library_dirs = self.compiler.library_dirs + l\n \n # end of fortran source support\n res = old_build_ext.build_extension(self,ext)\n\n if save_linker_so is not self.compiler.linker_so:\n print 'restoring linker_so',save_linker_so\n self.compiler.linker_so = save_linker_so\n self.compiler.libraries = save_compiler_libs\n self.compiler.library_dirs = save_compiler_libs_dirs\n\n return res\n\n def get_source_files (self):\n self.check_extensions_list(self.extensions)\n filenames = []\n\n # Get sources and any include files in the same directory.\n for ext in self.extensions:\n filenames.extend(ext.sources)\n filenames.extend(get_headers(get_directories(ext.sources)))\n\n return filenames\n",
46
- "methods": [
47
- {
48
- "name": "build_extension",
49
- "long_name": "build_extension( self , ext )",
50
- "filename": "build_ext.py",
51
- "nloc": 57,
52
- "complexity": 19,
53
- "token_count": 408,
54
- "parameters": [
55
- "self",
56
- "ext"
57
- ],
58
- "start_line": 15,
59
- "end_line": 87,
60
- "fan_in": 0,
61
- "fan_out": 0,
62
- "general_fan_out": 0,
63
- "length": 73,
64
- "top_nesting_level": 1
65
- },
66
- {
67
- "name": "get_source_files",
68
- "long_name": "get_source_files( self )",
69
- "filename": "build_ext.py",
70
- "nloc": 7,
71
- "complexity": 2,
72
- "token_count": 48,
73
- "parameters": [
74
- "self"
75
- ],
76
- "start_line": 89,
77
- "end_line": 98,
78
- "fan_in": 0,
79
- "fan_out": 0,
80
- "general_fan_out": 0,
81
- "length": 10,
82
- "top_nesting_level": 1
83
- }
84
- ],
85
- "methods_before": [
86
- {
87
- "name": "build_extension",
88
- "long_name": "build_extension( self , ext )",
89
- "filename": "build_ext.py",
90
- "nloc": 57,
91
- "complexity": 19,
92
- "token_count": 408,
93
- "parameters": [
94
- "self",
95
- "ext"
96
- ],
97
- "start_line": 15,
98
- "end_line": 87,
99
- "fan_in": 0,
100
- "fan_out": 0,
101
- "general_fan_out": 0,
102
- "length": 73,
103
- "top_nesting_level": 1
104
- },
105
- {
106
- "name": "get_source_files",
107
- "long_name": "get_source_files( self )",
108
- "filename": "build_ext.py",
109
- "nloc": 7,
110
- "complexity": 2,
111
- "token_count": 48,
112
- "parameters": [
113
- "self"
114
- ],
115
- "start_line": 89,
116
- "end_line": 98,
117
- "fan_in": 0,
118
- "fan_out": 0,
119
- "general_fan_out": 0,
120
- "length": 10,
121
- "top_nesting_level": 1
122
- }
123
- ],
124
- "changed_methods": [
125
- {
126
- "name": "build_extension",
127
- "long_name": "build_extension( self , ext )",
128
- "filename": "build_ext.py",
129
- "nloc": 57,
130
- "complexity": 19,
131
- "token_count": 408,
132
- "parameters": [
133
- "self",
134
- "ext"
135
- ],
136
- "start_line": 15,
137
- "end_line": 87,
138
- "fan_in": 0,
139
- "fan_out": 0,
140
- "general_fan_out": 0,
141
- "length": 73,
142
- "top_nesting_level": 1
143
- }
144
- ],
145
- "nloc": 73,
146
- "complexity": 21,
147
- "token_count": 509,
148
- "diff_parsed": {
149
- "added": [
150
- " if lib_dir not in self.compiler.library_dirs:"
151
- ],
152
- "deleted": [
153
- " if lib_dir not in self.compiler.libraries_dirs:"
154
- ]
155
- }
156
- }
157
- ]
158
- },
159
- {
160
- "hash": "1fb3905e0f4987b02c11de1954e9b8e31636c551",
161
- "msg": "Finalized scipy version hooks",
162
- "author": {
163
- "name": "Pearu Peterson",
164
- "email": "pearu.peterson@gmail.com"
165
- },
166
- "committer": {
167
- "name": "Pearu Peterson",
168
- "email": "pearu.peterson@gmail.com"
169
- },
170
- "author_date": "2002-02-20T15:33:06+00:00",
171
- "author_timezone": 0,
172
- "committer_date": "2002-02-20T15:33:06+00:00",
173
- "committer_timezone": 0,
174
- "branches": [
175
- "main"
176
- ],
177
- "in_main_branch": true,
178
- "merge": false,
179
- "parents": [
180
- "64ffff9d53d2c26f0b7c014fb0152ccfc6568c34"
181
- ],
182
- "project_name": "repo_copy",
183
- "project_path": "/tmp/tmp76x_jct4/repo_copy",
184
- "deletions": 7,
185
- "insertions": 3,
186
- "lines": 10,
187
- "files": 3,
188
- "dmm_unit_size": null,
189
- "dmm_unit_complexity": null,
190
- "dmm_unit_interfacing": null,
191
- "modified_files": [
192
- {
193
- "old_path": "scipy_distutils/__version__.py",
194
- "new_path": null,
195
- "filename": "__version__.py",
196
- "extension": "py",
197
- "change_type": "DELETE",
198
- "diff": "@@ -1,4 +0,0 @@\n-# This file is automatically updated with update_version\n-# function from scipy_distutils.misc_util.py\n-version = '0.6.23-alpha-116'\n-version_info = (0, 6, 23, 'alpha', 116)\n",
199
- "added_lines": 0,
200
- "deleted_lines": 4,
201
- "source_code": null,
202
- "source_code_before": "# This file is automatically updated with update_version\n# function from scipy_distutils.misc_util.py\nversion = '0.6.23-alpha-116'\nversion_info = (0, 6, 23, 'alpha', 116)\n",
203
- "methods": [],
204
- "methods_before": [],
205
- "changed_methods": [],
206
- "nloc": null,
207
- "complexity": null,
208
- "token_count": null,
209
- "diff_parsed": {
210
- "added": [],
211
- "deleted": [
212
- "# This file is automatically updated with update_version",
213
- "# function from scipy_distutils.misc_util.py",
214
- "version = '0.6.23-alpha-116'",
215
- "version_info = (0, 6, 23, 'alpha', 116)"
216
- ]
217
- }
218
- },
219
- {
220
- "old_path": "scipy_distutils/atlas_info.py",
221
- "new_path": "scipy_distutils/atlas_info.py",
222
- "filename": "atlas_info.py",
223
- "extension": "py",
224
- "change_type": "MODIFY",
225
- "diff": "@@ -1,7 +1,7 @@\n import sys, os\n from misc_util import get_path\n \n-library_path = ''\n+library_path = ['/home/peterson/opt/lib/atlas']\n \n def get_atlas_info():\n if sys.platform == 'win32':\n",
226
- "added_lines": 1,
227
- "deleted_lines": 1,
228
- "source_code": "import sys, os\nfrom misc_util import get_path\n\nlibrary_path = ['/home/peterson/opt/lib/atlas']\n\ndef get_atlas_info():\n if sys.platform == 'win32':\n if not library_path:\n atlas_library_dirs=['C:\\\\atlas\\\\WinNT_PIIISSE1']\n else:\n atlas_library_dirs = library_path\n blas_libraries = ['f77blas', 'cblas', 'atlas', 'g2c']\n lapack_libraries = ['lapack'] + blas_libraries \n else:\n if not library_path:\n atlas_library_dirs = unix_atlas_directory(sys.platform)\n else:\n atlas_library_dirs = library_path\n blas_libraries = ['cblas','f77blas','atlas','g2c']\n lapack_libraries = ['lapack'] + blas_libraries\n return blas_libraries, lapack_libraries, atlas_library_dirs\n\ndef unix_atlas_directory(platform):\n \"\"\" Search a list of common locations looking for the atlas directory.\n \n Return None if the directory isn't found, otherwise return the\n directory name. This isn't very sophisticated right now. I can\n imagine doing an ftp to our server on platforms that we know about.\n \n Atlas is a highly optimized version of lapack and blas that is fast\n on almost all platforms.\n \"\"\"\n result = [] #None\n # do a little looking for the linalg directory for atlas libraries\n #path = get_path(__name__)\n #local_atlas0 = os.path.join(path,platform,'atlas')\n #local_atlas1 = os.path.join(path,platform[:-1],'atlas')\n \n # first look for a system defined atlas directory\n dir_search = ['/usr/local/lib/atlas','/usr/lib/atlas']#,\n # local_atlas0, local_atlas1]\n for directory in dir_search:\n if os.path.exists(directory):\n result = [directory]\n # we should really do an ftp search or something like that at this point.\n return result \n",
229
- "source_code_before": "import sys, os\nfrom misc_util import get_path\n\nlibrary_path = ''\n\ndef get_atlas_info():\n if sys.platform == 'win32':\n if not library_path:\n atlas_library_dirs=['C:\\\\atlas\\\\WinNT_PIIISSE1']\n else:\n atlas_library_dirs = library_path\n blas_libraries = ['f77blas', 'cblas', 'atlas', 'g2c']\n lapack_libraries = ['lapack'] + blas_libraries \n else:\n if not library_path:\n atlas_library_dirs = unix_atlas_directory(sys.platform)\n else:\n atlas_library_dirs = library_path\n blas_libraries = ['cblas','f77blas','atlas','g2c']\n lapack_libraries = ['lapack'] + blas_libraries\n return blas_libraries, lapack_libraries, atlas_library_dirs\n\ndef unix_atlas_directory(platform):\n \"\"\" Search a list of common locations looking for the atlas directory.\n \n Return None if the directory isn't found, otherwise return the\n directory name. This isn't very sophisticated right now. I can\n imagine doing an ftp to our server on platforms that we know about.\n \n Atlas is a highly optimized version of lapack and blas that is fast\n on almost all platforms.\n \"\"\"\n result = [] #None\n # do a little looking for the linalg directory for atlas libraries\n #path = get_path(__name__)\n #local_atlas0 = os.path.join(path,platform,'atlas')\n #local_atlas1 = os.path.join(path,platform[:-1],'atlas')\n \n # first look for a system defined atlas directory\n dir_search = ['/usr/local/lib/atlas','/usr/lib/atlas']#,\n # local_atlas0, local_atlas1]\n for directory in dir_search:\n if os.path.exists(directory):\n result = [directory]\n # we should really do an ftp search or something like that at this point.\n return result \n",
230
- "methods": [
231
- {
232
- "name": "get_atlas_info",
233
- "long_name": "get_atlas_info( )",
234
- "filename": "atlas_info.py",
235
- "nloc": 16,
236
- "complexity": 4,
237
- "token_count": 86,
238
- "parameters": [],
239
- "start_line": 6,
240
- "end_line": 21,
241
- "fan_in": 0,
242
- "fan_out": 0,
243
- "general_fan_out": 0,
244
- "length": 16,
245
- "top_nesting_level": 0
246
- },
247
- {
248
- "name": "unix_atlas_directory",
249
- "long_name": "unix_atlas_directory( platform )",
250
- "filename": "atlas_info.py",
251
- "nloc": 7,
252
- "complexity": 3,
253
- "token_count": 39,
254
- "parameters": [
255
- "platform"
256
- ],
257
- "start_line": 23,
258
- "end_line": 46,
259
- "fan_in": 0,
260
- "fan_out": 0,
261
- "general_fan_out": 0,
262
- "length": 24,
263
- "top_nesting_level": 0
264
- }
265
- ],
266
- "methods_before": [
267
- {
268
- "name": "get_atlas_info",
269
- "long_name": "get_atlas_info( )",
270
- "filename": "atlas_info.py",
271
- "nloc": 16,
272
- "complexity": 4,
273
- "token_count": 86,
274
- "parameters": [],
275
- "start_line": 6,
276
- "end_line": 21,
277
- "fan_in": 0,
278
- "fan_out": 0,
279
- "general_fan_out": 0,
280
- "length": 16,
281
- "top_nesting_level": 0
282
- },
283
- {
284
- "name": "unix_atlas_directory",
285
- "long_name": "unix_atlas_directory( platform )",
286
- "filename": "atlas_info.py",
287
- "nloc": 7,
288
- "complexity": 3,
289
- "token_count": 39,
290
- "parameters": [
291
- "platform"
292
- ],
293
- "start_line": 23,
294
- "end_line": 46,
295
- "fan_in": 0,
296
- "fan_out": 0,
297
- "general_fan_out": 0,
298
- "length": 24,
299
- "top_nesting_level": 0
300
- }
301
- ],
302
- "changed_methods": [],
303
- "nloc": 26,
304
- "complexity": 7,
305
- "token_count": 140,
306
- "diff_parsed": {
307
- "added": [
308
- "library_path = ['/home/peterson/opt/lib/atlas']"
309
- ],
310
- "deleted": [
311
- "library_path = ''"
312
- ]
313
- }
314
- },
315
- {
316
- "old_path": "scipy_distutils/misc_util.py",
317
- "new_path": "scipy_distutils/misc_util.py",
318
- "filename": "misc_util.py",
319
- "extension": "py",
320
- "change_type": "MODIFY",
321
- "diff": "@@ -244,9 +244,9 @@ def default_config_dict(name = None, parent_name = None):\n frame = sys._getframe(1)\n caller_name = eval('__name__',frame.f_globals,frame.f_locals)\n local_path = get_path(caller_name)\n- if name and not parent_name:\n+ if name and parent_name is None:\n # Useful for local builds\n- d['version'] = update_version(path=local_path)\n+ d['version'] = get_version(path=local_path)\n \n if os.path.exists(os.path.join(local_path,'__init__.py')):\n d['packages'].append(full_name)\n",
322
- "added_lines": 2,
323
- "deleted_lines": 2,
324
- "source_code": "import os,sys,string\n\ndef update_version(release_level='alpha',\n path='.',\n version_template = \\\n '%(major)d.%(minor)d.%(micro)d-%(release_level)s-%(serial)d',\n major=None,\n overwrite_version_py = 1):\n \"\"\"\n Return version string calculated from CVS/Entries file(s) starting\n at <path>. If the version information is different from the one\n found in the <path>/__version__.py file, update_version updates\n the file automatically. The version information will be always\n increasing in time.\n If CVS tree does not exist (e.g. as in distribution packages),\n return the version string found from <path>/__version__.py.\n If no version information is available, return None.\n\n Default version string is in the form\n\n <major>.<minor>.<micro>-<release_level>-<serial>\n\n The items have the following meanings:\n\n serial - shows cumulative changes in all files in the CVS\n repository\n micro - a number that is equivalent to the number of files\n minor - indicates the changes in micro value (files are added\n or removed)\n release_level - is alpha, beta, canditate, or final\n major - indicates changes in release_level.\n\n \"\"\"\n # Issues:\n # *** Recommend or not to add __version__.py file to CVS\n # repository? If it is in CVS, then when commiting, the\n # version information will change, but __version__.py\n # is commited with the old version information. To get\n # __version__.py also up to date, a second commit of the\n # __version__.py file is required after you re-run\n # update_version(..). To summarize:\n # 1) cvs commit ...\n # 2) python setup.py # that should call update_version\n # 3) cvs commit -m \"updating version\" __version__.py\n\n release_level_map = {'alpha':0,\n 'beta':1,\n 'canditate':2,\n 'final':3}\n release_level_value = release_level_map.get(release_level)\n if release_level_value is None:\n print 'Warning: release_level=%s is not %s'\\\n % (release_level,\n string.join(release_level_map.keys(),','))\n\n cwd = os.getcwd()\n os.chdir(path)\n try:\n version_module = __import__('__version__')\n reload(version_module)\n old_version_info = version_module.version_info\n old_version = version_module.version\n except:\n print sys.exc_value\n old_version_info = None\n old_version = None\n os.chdir(cwd)\n\n cvs_revs = get_cvs_revision(path)\n if cvs_revs is None:\n return old_version\n\n minor = 1\n micro,serial = cvs_revs\n if old_version_info is not None:\n minor = old_version_info[1]\n old_release_level_value = release_level_map.get(old_version_info[3])\n if micro != old_version_info[2]: # files have beed added or removed\n minor = minor + 1\n if major is None:\n major = old_version_info[0]\n if old_release_level_value is not None:\n if old_release_level_value > release_level_value:\n major = major + 1\n if major is None:\n major = 0\n\n version_info = (major,minor,micro,release_level,serial)\n version_dict = {'major':major,'minor':minor,'micro':micro,\n 'release_level':release_level,'serial':serial\n }\n version = version_template % version_dict\n\n if version_info != old_version_info:\n print 'version increase detected: %s -> %s'%(old_version,version)\n version_file = os.path.join(path,'__version__.py')\n if not overwrite_version_py:\n print 'keeping %s with old version, returing new version' \\\n % (version_file)\n return version\n print 'updating version in %s' % version_file\n version_file = os.path.abspath(version_file)\n f = open(version_file,'w')\n f.write('# This file is automatically updated with update_version\\n'\\\n '# function from scipy_distutils.misc_util.py\\n'\\\n 'version = %s\\n'\\\n 'version_info = %s\\n'%(repr(version),version_info))\n f.close()\n return version\n\ndef get_version(release_level='alpha',\n path='.',\n version_template = \\\n '%(major)d.%(minor)d.%(micro)d-%(release_level)s-%(serial)d',\n major=None,\n ):\n \"\"\"\n Return version string calculated from CVS/Entries file(s) starting\n at <path>. Does not change <path>/__version__.py.\n See also update_version(..) function.\n \"\"\"\n return update_version(release_level = release_level,path = path,\n version_template = version_template,\n major = major,overwrite_version_py = 0)\n\n\ndef get_cvs_revision(path):\n \"\"\"\n Return two last cumulative revision numbers of a CVS tree starting\n at <path>. The first number shows the number of files in the CVS\n tree (this is often true, but not always) and the second number\n characterizes the changes in these files.\n If <path>/CVS/Entries is not existing then return None.\n \"\"\"\n entries_file = os.path.join(path,'CVS','Entries')\n if os.path.exists(entries_file):\n rev1,rev2 = 0,0\n for line in open(entries_file).readlines():\n items = string.split(line,'/')\n if items[0]=='D' and len(items)>1:\n try:\n d1,d2 = get_cvs_revision(os.path.join(path,items[1]))\n except:\n d1,d2 = 0,0\n elif items[0]=='' and len(items)>3 and items[1]!='__version__.py':\n\t\tlast_numbers = map(eval,string.split(items[2],'.')[-2:])\n\t\tif len(last_numbers)==2:\n\t\t d1,d2 = last_numbers\n\t\telse: # this is when 'cvs add' but not yet 'cvs commit'\n\t\t d1,d2 = 0,0\n else:\n continue\n rev1,rev2 = rev1+d1,rev2+d2\n return rev1,rev2\n\ndef get_path(mod_name):\n \"\"\" This function makes sure installation is done from the\n correct directory no matter if it is installed from the\n command line or from another package or run_setup function.\n \n \"\"\"\n if mod_name == '__main__':\n d = os.path.abspath('.')\n elif mod_name == '__builtin__':\n #builtin if/then added by Pearu for use in core.run_setup. \n d = os.path.dirname(os.path.abspath(sys.argv[0]))\n else:\n #import scipy_distutils.setup\n mod = __import__(mod_name)\n file = mod.__file__\n d = os.path.dirname(os.path.abspath(file))\n return d\n \ndef add_local_to_path(mod_name):\n local_path = get_path(mod_name)\n sys.path.insert(0,local_path)\n\n\ndef add_grandparent_to_path(mod_name):\n local_path = get_path(mod_name)\n gp_dir = os.path.split(local_path)[0]\n sys.path.insert(0,gp_dir)\n\ndef restore_path():\n del sys.path[0]\n\ndef append_package_dir_to_path(package_name): \n \"\"\" Search for a directory with package_name and append it to PYTHONPATH\n \n The local directory is searched first and then the parent directory.\n \"\"\"\n # first see if it is in the current path\n # then try parent. If it isn't found, fail silently\n # and let the import error occur.\n \n # not an easy way to clean up after this...\n import os,sys\n if os.path.exists(package_name):\n sys.path.append(package_name)\n elif os.path.exists(os.path.join('..',package_name)):\n sys.path.append(os.path.join('..',package_name))\n\ndef get_package_config(package_name):\n \"\"\" grab the configuration info from the setup_xxx.py file\n in a package directory. The package directory is searched\n from the current directory, so setting the path to the\n setup.py file directory of the file calling this is usually\n needed to get search the path correct.\n \"\"\"\n append_package_dir_to_path(package_name)\n mod = __import__('setup_'+package_name)\n config = mod.configuration()\n return config\n\ndef package_config(primary,dependencies=[]):\n \"\"\" Create a configuration dictionary ready for setup.py from\n a list of primary and dependent package names. Each\n package listed must have a directory with the same name\n in the current or parent working directory. Further, it\n should have a setup_xxx.py module within that directory that\n has a configuration() file in it. \n \"\"\"\n config = []\n config.extend([get_package_config(x) for x in primary])\n config.extend([get_package_config(x) for x in dependencies]) \n config_dict = merge_config_dicts(config)\n return config_dict\n \nlist_keys = ['packages', 'ext_modules', 'data_files',\n 'include_dirs', 'libraries', 'fortran_libraries',\n 'headers']\ndict_keys = ['package_dir'] \n\ndef default_config_dict(name = None, parent_name = None):\n d={}\n for key in list_keys: d[key] = []\n for key in dict_keys: d[key] = {}\n\n full_name = dot_join(parent_name,name)\n\n if full_name:\n # XXX: The following assumes that default_config_dict is called\n # only from setup_<name>.configuration().\n frame = sys._getframe(1)\n caller_name = eval('__name__',frame.f_globals,frame.f_locals)\n local_path = get_path(caller_name)\n if name and parent_name is None:\n # Useful for local builds\n d['version'] = get_version(path=local_path)\n\n if os.path.exists(os.path.join(local_path,'__init__.py')):\n d['packages'].append(full_name)\n d['package_dir'][full_name] = local_path\n d['name'] = full_name\n if not parent_name:\n # Include scipy_distutils to local distributions\n for p in ['.','..']:\n dir_name = os.path.abspath(os.path.join(local_path,\n p,'scipy_distutils'))\n if os.path.exists(dir_name):\n d['packages'].append('scipy_distutils')\n d['packages'].append('scipy_distutils.command')\n d['package_dir']['scipy_distutils'] = dir_name\n break\n return d\n\ndef merge_config_dicts(config_list):\n result = default_config_dict()\n for d in config_list:\n for key in list_keys:\n result[key].extend(d.get(key,[]))\n for key in dict_keys:\n result[key].update(d.get(key,{}))\n return result\n\ndef dot_join(*args):\n return string.join(filter(None,args),'.')\n\ndef fortran_library_item(lib_name,\n sources,\n **attrs\n ):\n \"\"\" Helper function for creating fortran_libraries items. \"\"\"\n build_info = {'sources':sources}\n known_attrs = ['module_files','module_dirs',\n 'libraries','library_dirs']\n for key,value in attrs.items():\n if key not in known_attrs:\n raise TypeError,\\\n \"fortran_library_item() got an unexpected keyword \"\\\n \"argument '%s'\" % key\n build_info[key] = value\n \n return (lib_name,build_info)\n",
325
- "source_code_before": "import os,sys,string\n\ndef update_version(release_level='alpha',\n path='.',\n version_template = \\\n '%(major)d.%(minor)d.%(micro)d-%(release_level)s-%(serial)d',\n major=None,\n overwrite_version_py = 1):\n \"\"\"\n Return version string calculated from CVS/Entries file(s) starting\n at <path>. If the version information is different from the one\n found in the <path>/__version__.py file, update_version updates\n the file automatically. The version information will be always\n increasing in time.\n If CVS tree does not exist (e.g. as in distribution packages),\n return the version string found from <path>/__version__.py.\n If no version information is available, return None.\n\n Default version string is in the form\n\n <major>.<minor>.<micro>-<release_level>-<serial>\n\n The items have the following meanings:\n\n serial - shows cumulative changes in all files in the CVS\n repository\n micro - a number that is equivalent to the number of files\n minor - indicates the changes in micro value (files are added\n or removed)\n release_level - is alpha, beta, canditate, or final\n major - indicates changes in release_level.\n\n \"\"\"\n # Issues:\n # *** Recommend or not to add __version__.py file to CVS\n # repository? If it is in CVS, then when commiting, the\n # version information will change, but __version__.py\n # is commited with the old version information. To get\n # __version__.py also up to date, a second commit of the\n # __version__.py file is required after you re-run\n # update_version(..). To summarize:\n # 1) cvs commit ...\n # 2) python setup.py # that should call update_version\n # 3) cvs commit -m \"updating version\" __version__.py\n\n release_level_map = {'alpha':0,\n 'beta':1,\n 'canditate':2,\n 'final':3}\n release_level_value = release_level_map.get(release_level)\n if release_level_value is None:\n print 'Warning: release_level=%s is not %s'\\\n % (release_level,\n string.join(release_level_map.keys(),','))\n\n cwd = os.getcwd()\n os.chdir(path)\n try:\n version_module = __import__('__version__')\n reload(version_module)\n old_version_info = version_module.version_info\n old_version = version_module.version\n except:\n print sys.exc_value\n old_version_info = None\n old_version = None\n os.chdir(cwd)\n\n cvs_revs = get_cvs_revision(path)\n if cvs_revs is None:\n return old_version\n\n minor = 1\n micro,serial = cvs_revs\n if old_version_info is not None:\n minor = old_version_info[1]\n old_release_level_value = release_level_map.get(old_version_info[3])\n if micro != old_version_info[2]: # files have beed added or removed\n minor = minor + 1\n if major is None:\n major = old_version_info[0]\n if old_release_level_value is not None:\n if old_release_level_value > release_level_value:\n major = major + 1\n if major is None:\n major = 0\n\n version_info = (major,minor,micro,release_level,serial)\n version_dict = {'major':major,'minor':minor,'micro':micro,\n 'release_level':release_level,'serial':serial\n }\n version = version_template % version_dict\n\n if version_info != old_version_info:\n print 'version increase detected: %s -> %s'%(old_version,version)\n version_file = os.path.join(path,'__version__.py')\n if not overwrite_version_py:\n print 'keeping %s with old version, returing new version' \\\n % (version_file)\n return version\n print 'updating version in %s' % version_file\n version_file = os.path.abspath(version_file)\n f = open(version_file,'w')\n f.write('# This file is automatically updated with update_version\\n'\\\n '# function from scipy_distutils.misc_util.py\\n'\\\n 'version = %s\\n'\\\n 'version_info = %s\\n'%(repr(version),version_info))\n f.close()\n return version\n\ndef get_version(release_level='alpha',\n path='.',\n version_template = \\\n '%(major)d.%(minor)d.%(micro)d-%(release_level)s-%(serial)d',\n major=None,\n ):\n \"\"\"\n Return version string calculated from CVS/Entries file(s) starting\n at <path>. Does not change <path>/__version__.py.\n See also update_version(..) function.\n \"\"\"\n return update_version(release_level = release_level,path = path,\n version_template = version_template,\n major = major,overwrite_version_py = 0)\n\n\ndef get_cvs_revision(path):\n \"\"\"\n Return two last cumulative revision numbers of a CVS tree starting\n at <path>. The first number shows the number of files in the CVS\n tree (this is often true, but not always) and the second number\n characterizes the changes in these files.\n If <path>/CVS/Entries is not existing then return None.\n \"\"\"\n entries_file = os.path.join(path,'CVS','Entries')\n if os.path.exists(entries_file):\n rev1,rev2 = 0,0\n for line in open(entries_file).readlines():\n items = string.split(line,'/')\n if items[0]=='D' and len(items)>1:\n try:\n d1,d2 = get_cvs_revision(os.path.join(path,items[1]))\n except:\n d1,d2 = 0,0\n elif items[0]=='' and len(items)>3 and items[1]!='__version__.py':\n\t\tlast_numbers = map(eval,string.split(items[2],'.')[-2:])\n\t\tif len(last_numbers)==2:\n\t\t d1,d2 = last_numbers\n\t\telse: # this is when 'cvs add' but not yet 'cvs commit'\n\t\t d1,d2 = 0,0\n else:\n continue\n rev1,rev2 = rev1+d1,rev2+d2\n return rev1,rev2\n\ndef get_path(mod_name):\n \"\"\" This function makes sure installation is done from the\n correct directory no matter if it is installed from the\n command line or from another package or run_setup function.\n \n \"\"\"\n if mod_name == '__main__':\n d = os.path.abspath('.')\n elif mod_name == '__builtin__':\n #builtin if/then added by Pearu for use in core.run_setup. \n d = os.path.dirname(os.path.abspath(sys.argv[0]))\n else:\n #import scipy_distutils.setup\n mod = __import__(mod_name)\n file = mod.__file__\n d = os.path.dirname(os.path.abspath(file))\n return d\n \ndef add_local_to_path(mod_name):\n local_path = get_path(mod_name)\n sys.path.insert(0,local_path)\n\n\ndef add_grandparent_to_path(mod_name):\n local_path = get_path(mod_name)\n gp_dir = os.path.split(local_path)[0]\n sys.path.insert(0,gp_dir)\n\ndef restore_path():\n del sys.path[0]\n\ndef append_package_dir_to_path(package_name): \n \"\"\" Search for a directory with package_name and append it to PYTHONPATH\n \n The local directory is searched first and then the parent directory.\n \"\"\"\n # first see if it is in the current path\n # then try parent. If it isn't found, fail silently\n # and let the import error occur.\n \n # not an easy way to clean up after this...\n import os,sys\n if os.path.exists(package_name):\n sys.path.append(package_name)\n elif os.path.exists(os.path.join('..',package_name)):\n sys.path.append(os.path.join('..',package_name))\n\ndef get_package_config(package_name):\n \"\"\" grab the configuration info from the setup_xxx.py file\n in a package directory. The package directory is searched\n from the current directory, so setting the path to the\n setup.py file directory of the file calling this is usually\n needed to get search the path correct.\n \"\"\"\n append_package_dir_to_path(package_name)\n mod = __import__('setup_'+package_name)\n config = mod.configuration()\n return config\n\ndef package_config(primary,dependencies=[]):\n \"\"\" Create a configuration dictionary ready for setup.py from\n a list of primary and dependent package names. Each\n package listed must have a directory with the same name\n in the current or parent working directory. Further, it\n should have a setup_xxx.py module within that directory that\n has a configuration() file in it. \n \"\"\"\n config = []\n config.extend([get_package_config(x) for x in primary])\n config.extend([get_package_config(x) for x in dependencies]) \n config_dict = merge_config_dicts(config)\n return config_dict\n \nlist_keys = ['packages', 'ext_modules', 'data_files',\n 'include_dirs', 'libraries', 'fortran_libraries',\n 'headers']\ndict_keys = ['package_dir'] \n\ndef default_config_dict(name = None, parent_name = None):\n d={}\n for key in list_keys: d[key] = []\n for key in dict_keys: d[key] = {}\n\n full_name = dot_join(parent_name,name)\n\n if full_name:\n # XXX: The following assumes that default_config_dict is called\n # only from setup_<name>.configuration().\n frame = sys._getframe(1)\n caller_name = eval('__name__',frame.f_globals,frame.f_locals)\n local_path = get_path(caller_name)\n if name and not parent_name:\n # Useful for local builds\n d['version'] = update_version(path=local_path)\n\n if os.path.exists(os.path.join(local_path,'__init__.py')):\n d['packages'].append(full_name)\n d['package_dir'][full_name] = local_path\n d['name'] = full_name\n if not parent_name:\n # Include scipy_distutils to local distributions\n for p in ['.','..']:\n dir_name = os.path.abspath(os.path.join(local_path,\n p,'scipy_distutils'))\n if os.path.exists(dir_name):\n d['packages'].append('scipy_distutils')\n d['packages'].append('scipy_distutils.command')\n d['package_dir']['scipy_distutils'] = dir_name\n break\n return d\n\ndef merge_config_dicts(config_list):\n result = default_config_dict()\n for d in config_list:\n for key in list_keys:\n result[key].extend(d.get(key,[]))\n for key in dict_keys:\n result[key].update(d.get(key,{}))\n return result\n\ndef dot_join(*args):\n return string.join(filter(None,args),'.')\n\ndef fortran_library_item(lib_name,\n sources,\n **attrs\n ):\n \"\"\" Helper function for creating fortran_libraries items. \"\"\"\n build_info = {'sources':sources}\n known_attrs = ['module_files','module_dirs',\n 'libraries','library_dirs']\n for key,value in attrs.items():\n if key not in known_attrs:\n raise TypeError,\\\n \"fortran_library_item() got an unexpected keyword \"\\\n \"argument '%s'\" % key\n build_info[key] = value\n \n return (lib_name,build_info)\n",
326
- "methods": [
327
- {
328
- "name": "update_version",
329
- "long_name": "update_version( release_level = 'alpha' , path = '.' , version_template = \\\n '%(major)d.%(minor)d.%(micro)d-%(release_level)s-%(serial)d' , major = None , overwrite_version_py = 1 )",
330
- "filename": "misc_util.py",
331
- "nloc": 65,
332
- "complexity": 12,
333
- "token_count": 351,
334
- "parameters": [
335
- "release_level",
336
- "path",
337
- "major",
338
- "overwrite_version_py"
339
- ],
340
- "start_line": 3,
341
- "end_line": 109,
342
- "fan_in": 0,
343
- "fan_out": 0,
344
- "general_fan_out": 0,
345
- "length": 107,
346
- "top_nesting_level": 0
347
- },
348
- {
349
- "name": "get_version",
350
- "long_name": "get_version( release_level = 'alpha' , path = '.' , version_template = \\\n '%(major)d.%(minor)d.%(micro)d-%(release_level)s-%(serial)d' , major = None , )",
351
- "filename": "misc_util.py",
352
- "nloc": 9,
353
- "complexity": 1,
354
- "token_count": 45,
355
- "parameters": [
356
- "release_level",
357
- "path",
358
- "major"
359
- ],
360
- "start_line": 111,
361
- "end_line": 124,
362
- "fan_in": 0,
363
- "fan_out": 0,
364
- "general_fan_out": 0,
365
- "length": 14,
366
- "top_nesting_level": 0
367
- },
368
- {
369
- "name": "get_cvs_revision",
370
- "long_name": "get_cvs_revision( path )",
371
- "filename": "misc_util.py",
372
- "nloc": 21,
373
- "complexity": 10,
374
- "token_count": 190,
375
- "parameters": [
376
- "path"
377
- ],
378
- "start_line": 127,
379
- "end_line": 154,
380
- "fan_in": 0,
381
- "fan_out": 0,
382
- "general_fan_out": 0,
383
- "length": 28,
384
- "top_nesting_level": 0
385
- },
386
- {
387
- "name": "get_path",
388
- "long_name": "get_path( mod_name )",
389
- "filename": "misc_util.py",
390
- "nloc": 10,
391
- "complexity": 3,
392
- "token_count": 80,
393
- "parameters": [
394
- "mod_name"
395
- ],
396
- "start_line": 156,
397
- "end_line": 172,
398
- "fan_in": 0,
399
- "fan_out": 0,
400
- "general_fan_out": 0,
401
- "length": 17,
402
- "top_nesting_level": 0
403
- },
404
- {
405
- "name": "add_local_to_path",
406
- "long_name": "add_local_to_path( mod_name )",
407
- "filename": "misc_util.py",
408
- "nloc": 3,
409
- "complexity": 1,
410
- "token_count": 21,
411
- "parameters": [
412
- "mod_name"
413
- ],
414
- "start_line": 174,
415
- "end_line": 176,
416
- "fan_in": 0,
417
- "fan_out": 0,
418
- "general_fan_out": 0,
419
- "length": 3,
420
- "top_nesting_level": 0
421
- },
422
- {
423
- "name": "add_grandparent_to_path",
424
- "long_name": "add_grandparent_to_path( mod_name )",
425
- "filename": "misc_util.py",
426
- "nloc": 4,
427
- "complexity": 1,
428
- "token_count": 34,
429
- "parameters": [
430
- "mod_name"
431
- ],
432
- "start_line": 179,
433
- "end_line": 182,
434
- "fan_in": 0,
435
- "fan_out": 0,
436
- "general_fan_out": 0,
437
- "length": 4,
438
- "top_nesting_level": 0
439
- },
440
- {
441
- "name": "restore_path",
442
- "long_name": "restore_path( )",
443
- "filename": "misc_util.py",
444
- "nloc": 2,
445
- "complexity": 1,
446
- "token_count": 11,
447
- "parameters": [],
448
- "start_line": 184,
449
- "end_line": 185,
450
- "fan_in": 0,
451
- "fan_out": 0,
452
- "general_fan_out": 0,
453
- "length": 2,
454
- "top_nesting_level": 0
455
- },
456
- {
457
- "name": "append_package_dir_to_path",
458
- "long_name": "append_package_dir_to_path( package_name )",
459
- "filename": "misc_util.py",
460
- "nloc": 6,
461
- "complexity": 3,
462
- "token_count": 64,
463
- "parameters": [
464
- "package_name"
465
- ],
466
- "start_line": 187,
467
- "end_line": 201,
468
- "fan_in": 0,
469
- "fan_out": 0,
470
- "general_fan_out": 0,
471
- "length": 15,
472
- "top_nesting_level": 0
473
- },
474
- {
475
- "name": "get_package_config",
476
- "long_name": "get_package_config( package_name )",
477
- "filename": "misc_util.py",
478
- "nloc": 5,
479
- "complexity": 1,
480
- "token_count": 27,
481
- "parameters": [
482
- "package_name"
483
- ],
484
- "start_line": 203,
485
- "end_line": 213,
486
- "fan_in": 0,
487
- "fan_out": 0,
488
- "general_fan_out": 0,
489
- "length": 11,
490
- "top_nesting_level": 0
491
- },
492
- {
493
- "name": "package_config",
494
- "long_name": "package_config( primary , dependencies = [ ] )",
495
- "filename": "misc_util.py",
496
- "nloc": 6,
497
- "complexity": 3,
498
- "token_count": 53,
499
- "parameters": [
500
- "primary",
501
- "dependencies"
502
- ],
503
- "start_line": 215,
504
- "end_line": 227,
505
- "fan_in": 0,
506
- "fan_out": 0,
507
- "general_fan_out": 0,
508
- "length": 13,
509
- "top_nesting_level": 0
510
- },
511
- {
512
- "name": "default_config_dict",
513
- "long_name": "default_config_dict( name = None , parent_name = None )",
514
- "filename": "misc_util.py",
515
- "nloc": 25,
516
- "complexity": 10,
517
- "token_count": 213,
518
- "parameters": [
519
- "name",
520
- "parent_name"
521
- ],
522
- "start_line": 234,
523
- "end_line": 265,
524
- "fan_in": 0,
525
- "fan_out": 0,
526
- "general_fan_out": 0,
527
- "length": 32,
528
- "top_nesting_level": 0
529
- },
530
- {
531
- "name": "merge_config_dicts",
532
- "long_name": "merge_config_dicts( config_list )",
533
- "filename": "misc_util.py",
534
- "nloc": 8,
535
- "complexity": 4,
536
- "token_count": 61,
537
- "parameters": [
538
- "config_list"
539
- ],
540
- "start_line": 267,
541
- "end_line": 274,
542
- "fan_in": 0,
543
- "fan_out": 0,
544
- "general_fan_out": 0,
545
- "length": 8,
546
- "top_nesting_level": 0
547
- },
548
- {
549
- "name": "dot_join",
550
- "long_name": "dot_join( * args )",
551
- "filename": "misc_util.py",
552
- "nloc": 2,
553
- "complexity": 1,
554
- "token_count": 20,
555
- "parameters": [
556
- "args"
557
- ],
558
- "start_line": 276,
559
- "end_line": 277,
560
- "fan_in": 0,
561
- "fan_out": 0,
562
- "general_fan_out": 0,
563
- "length": 2,
564
- "top_nesting_level": 0
565
- },
566
- {
567
- "name": "fortran_library_item",
568
- "long_name": "fortran_library_item( lib_name , sources , ** attrs )",
569
- "filename": "misc_util.py",
570
- "nloc": 14,
571
- "complexity": 3,
572
- "token_count": 67,
573
- "parameters": [
574
- "lib_name",
575
- "sources",
576
- "attrs"
577
- ],
578
- "start_line": 279,
579
- "end_line": 294,
580
- "fan_in": 0,
581
- "fan_out": 0,
582
- "general_fan_out": 0,
583
- "length": 16,
584
- "top_nesting_level": 0
585
- }
586
- ],
587
- "methods_before": [
588
- {
589
- "name": "update_version",
590
- "long_name": "update_version( release_level = 'alpha' , path = '.' , version_template = \\\n '%(major)d.%(minor)d.%(micro)d-%(release_level)s-%(serial)d' , major = None , overwrite_version_py = 1 )",
591
- "filename": "misc_util.py",
592
- "nloc": 65,
593
- "complexity": 12,
594
- "token_count": 351,
595
- "parameters": [
596
- "release_level",
597
- "path",
598
- "major",
599
- "overwrite_version_py"
600
- ],
601
- "start_line": 3,
602
- "end_line": 109,
603
- "fan_in": 0,
604
- "fan_out": 0,
605
- "general_fan_out": 0,
606
- "length": 107,
607
- "top_nesting_level": 0
608
- },
609
- {
610
- "name": "get_version",
611
- "long_name": "get_version( release_level = 'alpha' , path = '.' , version_template = \\\n '%(major)d.%(minor)d.%(micro)d-%(release_level)s-%(serial)d' , major = None , )",
612
- "filename": "misc_util.py",
613
- "nloc": 9,
614
- "complexity": 1,
615
- "token_count": 45,
616
- "parameters": [
617
- "release_level",
618
- "path",
619
- "major"
620
- ],
621
- "start_line": 111,
622
- "end_line": 124,
623
- "fan_in": 0,
624
- "fan_out": 0,
625
- "general_fan_out": 0,
626
- "length": 14,
627
- "top_nesting_level": 0
628
- },
629
- {
630
- "name": "get_cvs_revision",
631
- "long_name": "get_cvs_revision( path )",
632
- "filename": "misc_util.py",
633
- "nloc": 21,
634
- "complexity": 10,
635
- "token_count": 190,
636
- "parameters": [
637
- "path"
638
- ],
639
- "start_line": 127,
640
- "end_line": 154,
641
- "fan_in": 0,
642
- "fan_out": 0,
643
- "general_fan_out": 0,
644
- "length": 28,
645
- "top_nesting_level": 0
646
- },
647
- {
648
- "name": "get_path",
649
- "long_name": "get_path( mod_name )",
650
- "filename": "misc_util.py",
651
- "nloc": 10,
652
- "complexity": 3,
653
- "token_count": 80,
654
- "parameters": [
655
- "mod_name"
656
- ],
657
- "start_line": 156,
658
- "end_line": 172,
659
- "fan_in": 0,
660
- "fan_out": 0,
661
- "general_fan_out": 0,
662
- "length": 17,
663
- "top_nesting_level": 0
664
- },
665
- {
666
- "name": "add_local_to_path",
667
- "long_name": "add_local_to_path( mod_name )",
668
- "filename": "misc_util.py",
669
- "nloc": 3,
670
- "complexity": 1,
671
- "token_count": 21,
672
- "parameters": [
673
- "mod_name"
674
- ],
675
- "start_line": 174,
676
- "end_line": 176,
677
- "fan_in": 0,
678
- "fan_out": 0,
679
- "general_fan_out": 0,
680
- "length": 3,
681
- "top_nesting_level": 0
682
- },
683
- {
684
- "name": "add_grandparent_to_path",
685
- "long_name": "add_grandparent_to_path( mod_name )",
686
- "filename": "misc_util.py",
687
- "nloc": 4,
688
- "complexity": 1,
689
- "token_count": 34,
690
- "parameters": [
691
- "mod_name"
692
- ],
693
- "start_line": 179,
694
- "end_line": 182,
695
- "fan_in": 0,
696
- "fan_out": 0,
697
- "general_fan_out": 0,
698
- "length": 4,
699
- "top_nesting_level": 0
700
- },
701
- {
702
- "name": "restore_path",
703
- "long_name": "restore_path( )",
704
- "filename": "misc_util.py",
705
- "nloc": 2,
706
- "complexity": 1,
707
- "token_count": 11,
708
- "parameters": [],
709
- "start_line": 184,
710
- "end_line": 185,
711
- "fan_in": 0,
712
- "fan_out": 0,
713
- "general_fan_out": 0,
714
- "length": 2,
715
- "top_nesting_level": 0
716
- },
717
- {
718
- "name": "append_package_dir_to_path",
719
- "long_name": "append_package_dir_to_path( package_name )",
720
- "filename": "misc_util.py",
721
- "nloc": 6,
722
- "complexity": 3,
723
- "token_count": 64,
724
- "parameters": [
725
- "package_name"
726
- ],
727
- "start_line": 187,
728
- "end_line": 201,
729
- "fan_in": 0,
730
- "fan_out": 0,
731
- "general_fan_out": 0,
732
- "length": 15,
733
- "top_nesting_level": 0
734
- },
735
- {
736
- "name": "get_package_config",
737
- "long_name": "get_package_config( package_name )",
738
- "filename": "misc_util.py",
739
- "nloc": 5,
740
- "complexity": 1,
741
- "token_count": 27,
742
- "parameters": [
743
- "package_name"
744
- ],
745
- "start_line": 203,
746
- "end_line": 213,
747
- "fan_in": 0,
748
- "fan_out": 0,
749
- "general_fan_out": 0,
750
- "length": 11,
751
- "top_nesting_level": 0
752
- },
753
- {
754
- "name": "package_config",
755
- "long_name": "package_config( primary , dependencies = [ ] )",
756
- "filename": "misc_util.py",
757
- "nloc": 6,
758
- "complexity": 3,
759
- "token_count": 53,
760
- "parameters": [
761
- "primary",
762
- "dependencies"
763
- ],
764
- "start_line": 215,
765
- "end_line": 227,
766
- "fan_in": 0,
767
- "fan_out": 0,
768
- "general_fan_out": 0,
769
- "length": 13,
770
- "top_nesting_level": 0
771
- },
772
- {
773
- "name": "default_config_dict",
774
- "long_name": "default_config_dict( name = None , parent_name = None )",
775
- "filename": "misc_util.py",
776
- "nloc": 25,
777
- "complexity": 10,
778
- "token_count": 212,
779
- "parameters": [
780
- "name",
781
- "parent_name"
782
- ],
783
- "start_line": 234,
784
- "end_line": 265,
785
- "fan_in": 0,
786
- "fan_out": 0,
787
- "general_fan_out": 0,
788
- "length": 32,
789
- "top_nesting_level": 0
790
- },
791
- {
792
- "name": "merge_config_dicts",
793
- "long_name": "merge_config_dicts( config_list )",
794
- "filename": "misc_util.py",
795
- "nloc": 8,
796
- "complexity": 4,
797
- "token_count": 61,
798
- "parameters": [
799
- "config_list"
800
- ],
801
- "start_line": 267,
802
- "end_line": 274,
803
- "fan_in": 0,
804
- "fan_out": 0,
805
- "general_fan_out": 0,
806
- "length": 8,
807
- "top_nesting_level": 0
808
- },
809
- {
810
- "name": "dot_join",
811
- "long_name": "dot_join( * args )",
812
- "filename": "misc_util.py",
813
- "nloc": 2,
814
- "complexity": 1,
815
- "token_count": 20,
816
- "parameters": [
817
- "args"
818
- ],
819
- "start_line": 276,
820
- "end_line": 277,
821
- "fan_in": 0,
822
- "fan_out": 0,
823
- "general_fan_out": 0,
824
- "length": 2,
825
- "top_nesting_level": 0
826
- },
827
- {
828
- "name": "fortran_library_item",
829
- "long_name": "fortran_library_item( lib_name , sources , ** attrs )",
830
- "filename": "misc_util.py",
831
- "nloc": 14,
832
- "complexity": 3,
833
- "token_count": 67,
834
- "parameters": [
835
- "lib_name",
836
- "sources",
837
- "attrs"
838
- ],
839
- "start_line": 279,
840
- "end_line": 294,
841
- "fan_in": 0,
842
- "fan_out": 0,
843
- "general_fan_out": 0,
844
- "length": 16,
845
- "top_nesting_level": 0
846
- }
847
- ],
848
- "changed_methods": [
849
- {
850
- "name": "default_config_dict",
851
- "long_name": "default_config_dict( name = None , parent_name = None )",
852
- "filename": "misc_util.py",
853
- "nloc": 25,
854
- "complexity": 10,
855
- "token_count": 213,
856
- "parameters": [
857
- "name",
858
- "parent_name"
859
- ],
860
- "start_line": 234,
861
- "end_line": 265,
862
- "fan_in": 0,
863
- "fan_out": 0,
864
- "general_fan_out": 0,
865
- "length": 32,
866
- "top_nesting_level": 0
867
- }
868
- ],
869
- "nloc": 185,
870
- "complexity": 54,
871
- "token_count": 1279,
872
- "diff_parsed": {
873
- "added": [
874
- " if name and parent_name is None:",
875
- " d['version'] = get_version(path=local_path)"
876
- ],
877
- "deleted": [
878
- " if name and not parent_name:",
879
- " d['version'] = update_version(path=local_path)"
880
- ]
881
- }
882
- }
883
- ]
884
- }
885
- ]