32
32
logger = logging .getLogger ("editor" )
33
33
34
34
35
- core_dependencies = ['numpy ' , 'pandas ' , 'matplotlib ' , 'pytables ' , 'xlwings ' , 'xlsxwriter' , 'xlrd' , 'openpyxl ' ]
36
- editor_dependencies = ['larray' , 'larray_eurostat' , 'qt' ] + core_dependencies
37
- eurostat_dependencies = ['larray' ]
38
- dependencies = {'editor' : editor_dependencies , 'larray' : core_dependencies , 'larray_eurostat' : eurostat_dependencies }
35
+ CORE_DEPENDENCIES = ['matplotlib ' , 'numpy ' , 'openpyxl ' , 'pandas ' , 'pytables ' , 'xlsxwriter' , 'xlrd' , 'xlwings ' ]
36
+ EDITOR_DEPENDENCIES = ['larray' , 'larray_eurostat' , 'qt' ] + CORE_DEPENDENCIES
37
+ EUROSTAT_DEPENDENCIES = ['larray' ]
38
+ DEPENDENCIES = {'editor' : EDITOR_DEPENDENCIES , 'larray' : CORE_DEPENDENCIES , 'larray_eurostat' : EUROSTAT_DEPENDENCIES }
39
39
40
40
41
- doc = "http://larray.readthedocs.io/en/{version}"
42
- urls = {"fpb" : "http://www.plan.be/index.php?lang=en" ,
41
+ DOC = "http://larray.readthedocs.io/en/{version}"
42
+ URLS = {"fpb" : "http://www.plan.be/index.php?lang=en" ,
43
43
"GPL3" : "https://www.gnu.org/licenses/gpl-3.0.html" ,
44
- "doc_index" : f"{ doc } /index.html" ,
45
- "doc_tutorial" : f"{ doc } /tutorial.html" ,
46
- "doc_api" : f"{ doc } /api.html" ,
44
+ "doc_index" : f"{ DOC } /index.html" ,
45
+ "doc_tutorial" : f"{ DOC } /tutorial.html" ,
46
+ "doc_api" : f"{ DOC } /api.html" ,
47
47
"new_issue_editor" : "https://github.com/larray-project/larray-editor/issues/new" ,
48
48
"new_issue_larray" : "https://github.com/larray-project/larray/issues/new" ,
49
49
"new_issue_larray_eurostat" : "https://github.com/larray-project/larray_eurostat/issues/new" ,
@@ -74,19 +74,21 @@ def get_module_version(module_name):
74
74
75
75
76
76
def get_versions (package ):
77
- """Get version information of dependencies of a package"""
77
+ """Get version information of dependencies of one of our packages
78
+ `package` can be one of 'editor', 'larray' or 'larray_eurostat'
79
+ """
78
80
import platform
79
- modules = {'editor' : 'larray_editor' , 'qt' : 'qtpy.QtCore' , 'pytables' : 'tables' }
81
+ module_with_version = {'editor' : 'larray_editor' , 'qt' : 'qtpy.QtCore' , 'pytables' : 'tables' }
80
82
81
83
versions = {
82
84
'system' : platform .system () if sys .platform != 'darwin' else 'Darwin' ,
83
85
'python' : platform .python_version (),
84
86
'bitness' : 64 if sys .maxsize > 2 ** 32 else 32 ,
85
87
}
86
88
87
- versions [package ] = get_module_version (modules .get (package , package ))
88
- for dep in dependencies [package ]:
89
- versions [dep ] = get_module_version (modules .get (dep , dep ))
89
+ versions [package ] = get_module_version (module_with_version .get (package , package ))
90
+ for dep in DEPENDENCIES [package ]:
91
+ versions [dep ] = get_module_version (module_with_version .get (dep , dep ))
90
92
91
93
return versions
92
94
@@ -95,7 +97,7 @@ def get_documentation_url(key):
95
97
version = get_module_version ('larray' )
96
98
if version == 'N/A' :
97
99
version = 'stable'
98
- return urls [key ].format (version = version )
100
+ return URLS [key ].format (version = version )
99
101
100
102
101
103
# Note: string and unicode data types will be formatted with '%s' (see below)
0 commit comments