Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaksim Andrianov <maksimandrianov1@gmail.com>2020-05-15 02:32:23 +0300
committerTatiana Yan <tatiana.kondakova@gmail.com>2020-06-03 16:37:10 +0300
commit70116c2a36e5d9f88923dc4fd91ea47764d3a7c5 (patch)
tree9b9bdad56ff6b50049a5373b330b319d518ab964 /pyhelpers
parent9cb1a51ef59e590402af8e0773bcc3c8cfcccbb8 (diff)
[pyhelpers] Review fixes:
- updated the code style - improved building of bindings
Diffstat (limited to 'pyhelpers')
-rw-r--r--pyhelpers/module_version.hpp.in2
-rw-r--r--pyhelpers/setup.py489
2 files changed, 304 insertions, 187 deletions
diff --git a/pyhelpers/module_version.hpp.in b/pyhelpers/module_version.hpp.in
index 635b784e5d..26048b0102 100644
--- a/pyhelpers/module_version.hpp.in
+++ b/pyhelpers/module_version.hpp.in
@@ -1,2 +1,2 @@
-/* Bindings build for Python version @PYTHON_VERSION@ */
+// Bindings build for Python version @PYTHON_VERSION@
#define PYBINDINGS_VERSION "@PYBINDINGS_VERSION@"
diff --git a/pyhelpers/setup.py b/pyhelpers/setup.py
index 2f8a5f6dc5..be1b6f77c1 100644
--- a/pyhelpers/setup.py
+++ b/pyhelpers/setup.py
@@ -1,44 +1,135 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-from contextlib import contextmanager
+import inspect
+import linecache
import multiprocessing
import os
import re
import sys
-
+from contextlib import contextmanager
from distutils import log
-from distutils.command.bdist import bdist as distutils_bdist
-from distutils.command.build import build as distutils_build
+from distutils.command.bdist import bdist
+from distutils.command.build import build
from distutils.core import Command
-from distutils.dir_util import mkpath, remove_tree
+from distutils.dir_util import mkpath
from distutils.file_util import copy_file
from distutils.spawn import spawn, find_executable
from distutils.sysconfig import (
- get_config_var, get_python_inc, get_python_version,
+ get_config_var,
+ get_python_inc,
+ get_python_version,
)
from distutils.version import LooseVersion
-
-from setuptools import dist, setup as setuptools_setup
-from setuptools.command.build_ext import build_ext as setuptools_build_ext
-from setuptools.command.build_py import build_py as setuptools_build_py
-from setuptools.command.egg_info import (
- egg_info as setuptools_egg_info,
- manifest_maker as setuptools_manifest_maker,
+from inspect import (
+ getsourcefile,
+ getfile,
+ getmodule,
+ ismodule,
+ isclass,
+ ismethod,
+ isfunction,
+ istraceback,
+ isframe,
+ iscode,
)
-from setuptools.command.install import install as setuptools_install
-from setuptools.command.install_lib import (
- install_lib as setuptools_install_lib,
-)
-from setuptools.extension import Extension
+from setuptools import dist, setup
+from setuptools.command.build_ext import build_ext
+from setuptools.command.build_py import build_py
+from setuptools.command.egg_info import egg_info, manifest_maker
+from setuptools.command.install import install
+from setuptools.command.install_lib import install_lib
+from setuptools.extension import Extension
-"""Monkey-patching to disable checking package names"""
+# Monkey-patching to disable checking package names
dist.check_packages = lambda dist, attr, value: None
-pyhelpers_dir = os.path.abspath(os.path.dirname(__file__))
-omim_root = os.path.dirname(pyhelpers_dir)
-boost_root = os.path.join(omim_root, '3party', 'boost')
-boost_librarydir = os.path.join(boost_root, 'stage', 'lib')
+
+# Patch from https://github.com/ipython/ipython/issues/1456/
+def findsource(object):
+ """Return the entire source file and starting line number for an object.
+ The argument may be a module, class, method, function, traceback, frame,
+ or code object. The source code is returned as a list of all the lines
+ in the file and the line number indexes a line in that list. An IOError
+ is raised if the source code cannot be retrieved.
+ FIXED version with which we monkeypatch the stdlib to work around a bug."""
+
+ file = getsourcefile(object) or getfile(object)
+ # If the object is a frame, then trying to get the globals dict from its
+ # module won't work. Instead, the frame object itself has the globals
+ # dictionary.
+ globals_dict = None
+ if inspect.isframe(object):
+ # XXX: can this ever be false?
+ globals_dict = object.f_globals
+ else:
+ module = getmodule(object, file)
+ if module:
+ globals_dict = module.__dict__
+ lines = linecache.getlines(file, globals_dict)
+ if not lines:
+ raise IOError('could not get source code')
+
+ if ismodule(object):
+ return lines, 0
+
+ if isclass(object):
+ name = object.__name__
+ pat = re.compile(r'^(\s*)class\s*' + name + r'\b')
+ # make some effort to find the best matching class definition:
+ # use the one with the least indentation, which is the one
+ # that's most probably not inside a function definition.
+ candidates = []
+ for i in range(len(lines)):
+ match = pat.match(lines[i])
+ if match:
+ # if it's at toplevel, it's already the best one
+ if lines[i][0] == 'c':
+ return lines, i
+ # else add whitespace to candidate list
+ candidates.append((match.group(1), i))
+ if candidates:
+ # this will sort by whitespace, and by line number,
+ # less whitespace first
+ candidates.sort()
+ return lines, candidates[0][1]
+ else:
+ raise IOError('could not find class definition')
+
+ if ismethod(object):
+ object = object.im_func
+ if isfunction(object):
+ object = object.func_code
+ if istraceback(object):
+ object = object.tb_frame
+ if isframe(object):
+ object = object.f_code
+ if iscode(object):
+ if not hasattr(object, 'co_firstlineno'):
+ raise IOError('could not find function definition')
+ pat = re.compile(r'^(\s*def\s)|(.*(?<!\w)lambda(:|\s))|^(\s*@)')
+ pmatch = pat.match
+ # fperez - fix: sometimes, co_firstlineno can give a number larger than
+ # the length of lines, which causes an error. Safeguard against that.
+ lnum = min(object.co_firstlineno, len(lines)) - 1
+ while lnum > 0:
+ if pmatch(lines[lnum]):
+ break
+ lnum -= 1
+
+ return lines, lnum
+ raise IOError('could not find code object')
+
+
+# Monkeypatch inspect to apply our bugfix.
+# This code only works with Python >= 2.5
+inspect.findsource = findsource
+
+
+PYHELPERS_DIR = os.path.abspath(os.path.dirname(__file__))
+OMIM_ROOT = os.path.dirname(PYHELPERS_DIR)
+BOOST_ROOT = os.path.join(OMIM_ROOT, '3party', 'boost')
+BOOST_LIBRARYDIR = os.path.join(BOOST_ROOT, 'stage', 'lib')
def python_static_libdir():
@@ -70,87 +161,85 @@ def chdir(target_dir):
os.chdir(saved_cwd)
-class build(distutils_build, object):
- user_options = setuptools_build_ext.user_options + [
+class BuildCommand(build, object):
+ user_options = build_ext.user_options + [
('omim-builddir=', None, 'Path to omim build directory'),
]
def initialize_options(self):
- super(build, self).initialize_options()
- self.omim_builddir = os.path.join(omim_root, 'build')
+ super(BuildCommand, self).initialize_options()
+ self.omim_builddir = os.path.join(OMIM_ROOT, 'build')
def finalize_options(self):
self.build_base = os.path.relpath(
os.path.join(self.omim_builddir, 'pybindings-builddir')
)
self.omim_builddir = os.path.abspath(self.omim_builddir)
- super(build, self).finalize_options()
+ super(BuildCommand, self).finalize_options()
-class build_py(setuptools_build_py, object):
+class BuildPyCommand(build_py, object):
def _get_data_files(self):
- data_files = (
- super(build_py, self)._get_data_files()
- )
+ data_files = super(BuildPyCommand, self)._get_data_files()
if self.distribution.include_package_data:
ei_cmd = self.get_finalized_command('egg_info')
output_data_files = []
for package, src_dir, build_dir, filenames in data_files:
- filenames = list(filter(
- lambda f: not f.startswith(ei_cmd.egg_info),
- filenames
- ))
+ filenames = [
+ f for f in filenames if not f.startswith(ei_cmd.egg_info)
+ ]
output_data_files.append(
(package, src_dir, build_dir, filenames)
)
else:
output_data_files = data_files
+
return output_data_files
-class bdist(distutils_bdist, object):
- user_options = setuptools_build_ext.user_options + [
+class BdistCommand(bdist, object):
+ user_options = build_ext.user_options + [
('omim-builddir=', None, 'Path to omim build directory'),
]
def initialize_options(self):
- super(bdist, self).initialize_options()
+ super(BdistCommand, self).initialize_options()
self.omim_builddir = None
def finalize_options(self):
- super(bdist, self).finalize_options()
- self.set_undefined_options('build',
- ('omim_builddir', 'omim_builddir'),
- )
+ super(BdistCommand, self).finalize_options()
+ self.set_undefined_options(
+ 'build', ('omim_builddir', 'omim_builddir'),
+ )
self.dist_dir = os.path.join(self.omim_builddir, 'pybindings-dist')
-class manifest_maker(setuptools_manifest_maker, object):
+class ManifestMaker(manifest_maker, object):
def add_defaults(self):
- super(manifest_maker, self).add_defaults()
+ super(ManifestMaker, self).add_defaults()
# Our README.md is for entire omim project, no point including it
# into python package, so remove it.
self.filelist.exclude('README.*')
-class egg_info(setuptools_egg_info, object):
- user_options = setuptools_build_ext.user_options + [
+class EggInfoCommand(egg_info, object):
+ user_options = build_ext.user_options + [
('omim-builddir=', None, 'Path to omim build directory'),
]
def initialize_options(self):
- super(egg_info, self).initialize_options()
+ super(EggInfoCommand, self).initialize_options()
self.omim_builddir = None
def finalize_options(self):
- self.set_undefined_options('build',
- ('omim_builddir', 'omim_builddir'),
- )
+ self.set_undefined_options(
+ 'build', ('omim_builddir', 'omim_builddir'),
+ )
self.egg_base = os.path.relpath(
os.path.join(self.omim_builddir, 'pybindings-egg-info')
)
mkpath(self.egg_base)
- super(egg_info, self).finalize_options()
+ super(EggInfoCommand, self).finalize_options()
def find_sources(self):
"""
@@ -160,29 +249,29 @@ class egg_info(setuptools_egg_info, object):
Generate SOURCES.txt manifest file
"""
manifest_filename = os.path.join(self.egg_info, 'SOURCES.txt')
- mm = manifest_maker(self.distribution)
+ mm = ManifestMaker(self.distribution)
mm.manifest = manifest_filename
mm.run()
self.filelist = mm.filelist
-class install(setuptools_install, object):
- user_options = setuptools_install.user_options + [
+class InstallCommand(install, object):
+ user_options = install.user_options + [
('omim-builddir=', None, 'Path to omim build directory'),
]
def initialize_options(self):
- super(install, self).initialize_options()
+ super(InstallCommand, self).initialize_options()
self.omim_builddir = None
def finalize_options(self):
- super(install, self).finalize_options()
- self.set_undefined_options('build',
- ('omim_builddir', 'omim_builddir'),
- )
+ super(InstallCommand, self).finalize_options()
+ self.set_undefined_options(
+ 'build', ('omim_builddir', 'omim_builddir'),
+ )
-class install_lib(setuptools_install_lib, object):
+class InstallLibCommand(install_lib, object):
def get_exclusions(self):
"""
A kludge to allow building all pybindings in one run
@@ -195,28 +284,34 @@ class install_lib(setuptools_install_lib, object):
install_root = self.get_finalized_command('install').root or ''
excludes = set()
for ext_name in set(PYBINDINGS.keys()) - include_ext_names:
- excludes.add(os.path.join(
- install_root, build_ext.get_ext_filename(ext_name)
- ))
+ excludes.add(
+ os.path.join(
+ install_root, build_ext.get_ext_filename(ext_name)
+ )
+ )
for data_path in PYBINDINGS[ext_name].get('package_data', []):
- excludes.add(os.path.join(install_root, data_path))
+ excludes.add(
+ os.path.join(install_root, os.path.normpath(data_path))
+ )
own_files = {
- os.path.join(install_root, data_path)
+ os.path.join(install_root, os.path.normpath(data_path))
for ext_name in include_ext_names
for data_path in PYBINDINGS[ext_name].get('package_data', [])
}
- excludes -= own_files
- return super(install_lib, self).get_exclusions() | excludes
+ excludes -= own_files
+ return super(InstallLibCommand, self).get_exclusions() | excludes
-class build_boost_python(Command, object):
+class BuildBoostPythonCommand(Command, object):
user_options = [
- ('force', 'f',
- 'forcibly build boost_python library (ignore existence)'),
- ('omim-builddir=', None,
- 'Path to omim build directory'),
+ (
+ 'force',
+ 'f',
+ 'forcibly build boost_python library (ignore existence)',
+ ),
+ ('omim-builddir=', None, 'Path to omim build directory'),
]
boolean_options = ['force']
@@ -225,75 +320,82 @@ class build_boost_python(Command, object):
self.omim_builddir = None
def finalize_options(self):
- self.set_undefined_options('build',
- ('force', 'force'),
- ('omim_builddir', 'omim_builddir'),
- )
+ self.set_undefined_options(
+ 'build', ('force', 'force'), ('omim_builddir', 'omim_builddir'),
+ )
def get_boost_python_libname(self):
- return (
- 'boost_python{}{}'
- .format(sys.version_info.major, sys.version_info.minor)
+ return 'boost_python{}{}'.format(
+ sys.version_info.major, sys.version_info.minor
)
def get_boost_config_path(self):
return os.path.join(
self.omim_builddir,
- 'python{}-config.jam'.format(get_python_version())
+ 'python{}-config.jam'.format(get_python_version()),
)
def configure_omim(self):
- with chdir(omim_root):
+ with chdir(OMIM_ROOT):
spawn(['./configure.sh'])
def create_boost_config(self):
mkpath(self.omim_builddir)
with open(self.get_boost_config_path(), 'w') as f:
- f.write('using python : {} : {} : {} : {} ;\n'.format(
- get_python_version(), sys.executable,
- get_python_inc(), python_static_libdir()
- ))
+ f.write(
+ 'using python : {} : {} : {} : {} ;\n'.format(
+ get_python_version(),
+ sys.executable,
+ get_python_inc(),
+ python_static_libdir(),
+ )
+ )
def get_boost_python_builddir(self):
return os.path.join(
self.omim_builddir,
- 'boost-build-python{}'.format(get_python_version())
+ 'boost-build-python{}'.format(get_python_version()),
)
def clean(self):
- with chdir(boost_root):
- spawn([
- './b2',
- '--user-config={}'.format(self.get_boost_config_path()),
- '--with-python',
- 'python={}'.format(get_python_version()),
- '--build-dir={}'.format(self.get_boost_python_builddir()),
- '--clean'
- ])
+ with chdir(BOOST_ROOT):
+ spawn(
+ [
+ './b2',
+ '--user-config={}'.format(self.get_boost_config_path()),
+ '--with-python',
+ 'python={}'.format(get_python_version()),
+ '--build-dir={}'.format(self.get_boost_python_builddir()),
+ '--clean',
+ ]
+ )
def build(self):
if os.path.exists(self.get_boost_python_builddir()):
self.clean()
- with chdir(boost_root):
- spawn([
- './b2',
- '--user-config={}'.format(self.get_boost_config_path()),
- '--with-python',
- 'python={}'.format(get_python_version()),
- '--build-dir={}'.format(self.get_boost_python_builddir()),
- 'cxxflags="-fPIC"'
- ])
+
+ with chdir(BOOST_ROOT):
+ spawn(
+ [
+ './b2',
+ '--user-config={}'.format(self.get_boost_config_path()),
+ '--with-python',
+ 'python={}'.format(get_python_version()),
+ '--build-dir={}'.format(self.get_boost_python_builddir()),
+ 'cxxflags="-fPIC"',
+ ]
+ )
def run(self):
lib_path = os.path.join(
- boost_librarydir,
- 'lib{}.a'.format(self.get_boost_python_libname())
+ BOOST_LIBRARYDIR, 'lib{}.a'.format(self.get_boost_python_libname())
)
if os.path.exists(lib_path) and not self.force:
log.info(
'Boost_python library `{}` for current '
- 'python version already present, skipping build'
- .format(lib_path)
+ 'python version already present, skipping build'.format(
+ lib_path
+ )
)
return
@@ -302,20 +404,20 @@ class build_boost_python(Command, object):
self.build()
-class build_omim_binding(setuptools_build_ext, object):
- user_options = setuptools_build_ext.user_options + [
+class BuildOmimBindingCommand(build_ext, object):
+ user_options = build_ext.user_options + [
('omim-builddir=', None, 'Path to omim build directory'),
]
def initialize_options(self):
- super(build_omim_binding, self).initialize_options()
+ super(BuildOmimBindingCommand, self).initialize_options()
self.omim_builddir = None
def finalize_options(self):
- super(build_omim_binding, self).finalize_options()
- self.set_undefined_options('build',
- ('omim_builddir', 'omim_builddir'),
- )
+ super(BuildOmimBindingCommand, self).finalize_options()
+ self.set_undefined_options(
+ 'build', ('omim_builddir', 'omim_builddir'),
+ )
def cmake_pybindings(self):
# On some linux systems the cmake we need is called cmake3
@@ -323,86 +425,101 @@ class build_omim_binding(setuptools_build_ext, object):
for cmake in ['cmake3', 'cmake']:
if find_executable(cmake):
break
+
mkpath(self.omim_builddir)
with chdir(self.omim_builddir):
- spawn([
- cmake,
- '-DSKIP_DESKTOP=1',
- '-DPYBINDINGS=ON',
- '-DPYTHON_VERSION={}'.format(get_python_version()),
- '-DPYTHON_EXECUTABLE={}'.format(sys.executable),
- '-DPYTHON_INCLUDE_DIR={}'.format(get_python_inc()),
- '-DPYTHON_LIBRARY={}'.format(python_ld_library()),
- omim_root
- ])
+ spawn(
+ [
+ cmake,
+ '-DSKIP_DESKTOP=1',
+ '-DPYBINDINGS=ON',
+ '-DPYTHON_VERSION={}'.format(get_python_version()),
+ '-DPYTHON_EXECUTABLE={}'.format(sys.executable),
+ '-DPYTHON_INCLUDE_DIR={}'.format(get_python_inc()),
+ '-DPYTHON_LIBRARY={}'.format(python_ld_library()),
+ OMIM_ROOT,
+ ]
+ )
def build_extension(self, ext):
with chdir(self.omim_builddir):
- spawn([
- 'make',
- '-j', str(multiprocessing.cpu_count()//2),
- ext.name
- ])
+ spawn(
+ [
+ 'make',
+ '-j',
+ str(max(1, multiprocessing.cpu_count() // 2)),
+ ext.name,
+ ]
+ )
mkpath(self.build_lib)
copy_file(
os.path.join(self.omim_builddir, '{}.so'.format(ext.name)),
- self.get_ext_fullpath(ext.name)
+ self.get_ext_fullpath(ext.name),
)
def run(self):
self.run_command('build_boost_python')
self.cmake_pybindings()
- super(build_omim_binding, self).run()
+ super(BuildOmimBindingCommand, self).run()
-"""{Path_to_file: variable_in_file}"""
VERSIONS_LOCATIONS = {
- ('xcode', 'common.xcconfig',): 'CURRENT_PROJECT_VERSION',
- ('android', 'gradle.properties',): 'propVersionName',
+ 'xcode/common.xcconfig': 'CURRENT_PROJECT_VERSION',
+ 'android/gradle.properties': 'propVersionName',
}
PYBINDINGS = {
'pygen': {
+ 'path': 'generator/pygen',
+ 'py_modules': ['example',],
+ 'data_files': [
+ ('data', ['../../data/classificator.txt', '../../data/types.txt'])
+ ],
'description': 'Binding for working with generation data',
- 'package_data': (
- 'data/classificator.txt',
- 'data/types.txt',
- )
},
'pykmlib': {
+ 'path': 'kml/pykmlib',
+ 'data_files': [
+ ('data', ['../../data/classificator.txt', '../../data/types.txt'])
+ ],
'description': 'Binding for working with maps.me KML files',
- 'package_data': (
- 'data/classificator.txt',
- 'data/types.txt',
- )
},
'pylocal_ads': {
+ 'path': 'local_ads/pylocal_ads',
'description': 'Binding for working with maps.me local ads data',
},
'pymwm_diff': {
+ 'path': 'generator/mwm_diff/pymwm_diff',
'description': 'Binding for working with mwm diffs',
},
'pysearch': {
+ 'path': 'search/pysearch',
'description': 'Binding to access maps.me search engine',
- 'package_data': (
- 'data/categories_brands.txt',
- 'data/categories_cuisines.txt',
- 'data/categories.txt',
- 'data/classificator.txt',
- 'data/types.txt',
- )
+ 'data_files': [
+ (
+ 'data',
+ [
+ '../../data/categories_brands.txt',
+ '../../data/categories_cuisines.txt',
+ '../../data/categories.txt',
+ '../../data/classificator.txt',
+ '../../data/types.txt',
+ ],
+ )
+ ],
},
'pytracking': {
+ 'path': 'tracking/pytracking',
'description': 'Binding for working with user tracks',
},
'pytraffic': {
+ 'path': 'traffic/pytraffic',
'description': 'Binding for generationg traffic '
- 'data for maps.me application',
- 'package_data': (
- 'data/classificator.txt',
- 'data/types.txt',
- )
+ 'data for maps.me application',
+ 'data_files': [
+ ('data', ['../../data/classificator.txt', '../../data/types.txt'])
+ ],
},
}
@@ -410,37 +527,31 @@ PYBINDINGS = {
def get_version():
versions = []
for path, varname in VERSIONS_LOCATIONS.items():
- with open(os.path.join(omim_root, *path), 'r') as f:
+ with open(os.path.join(OMIM_ROOT, os.path.normpath(path))) as f:
for line in f:
match = re.search(
r'^\s*{}\s*=\s*(?P<version>.*)'.format(varname),
- line.strip()
+ line.strip(),
)
if match:
versions.append(LooseVersion(match.group('version')))
break
- return sorted(versions)[-1]
+ return max(versions)
def setup_omim_pybinding(
- name=None,
+ name,
version=None,
author='My.com B.V. (Mail.Ru Group)',
author_email='dev@maps.me',
url='https://github.com/mapsme/omim',
license='Apache-2.0',
- supported_pythons=['2', '2.7', '3', '3.5', '3.6', '3.7'],
+ supported_pythons=('2', '2.7', '3', '3.5', '3.6', '3.7'),
):
- if name is None:
- log("Name not specified, can't setup module")
- sys.exit()
-
if version is None:
version = get_version()
- package_data = PYBINDINGS[name].get('package_data', [])
-
- setuptools_setup(
+ setup(
name='omim-{}'.format(name),
version=str(version),
description=PYBINDINGS[name]['description'],
@@ -448,24 +559,21 @@ def setup_omim_pybinding(
author_email=author_email,
url=url,
license=license,
- packages=[''],
- package_data={
- '': [
- os.path.join(omim_root, path)
- for path in package_data
- ]
- },
- include_package_data=bool(package_data),
+ packages=PYBINDINGS[name].get('packages', []),
+ package_dir=PYBINDINGS[name].get('package_dir', {}),
+ py_modules=PYBINDINGS[name].get('py_modules', []),
+ package_data=PYBINDINGS[name].get('package_data', {}),
+ data_files=PYBINDINGS[name].get('data_files', []),
ext_modules=[Extension(name, [])],
cmdclass={
- 'bdist': bdist,
- 'build': build,
- 'build_boost_python': build_boost_python,
- 'build_ext': build_omim_binding,
- 'build_py': build_py,
- 'egg_info': egg_info,
- 'install': install,
- 'install_lib': install_lib,
+ 'bdist': BdistCommand,
+ 'build': BuildCommand,
+ 'build_boost_python': BuildBoostPythonCommand,
+ 'build_ext': BuildOmimBindingCommand,
+ 'build_py': BuildPyCommand,
+ 'egg_info': EggInfoCommand,
+ 'install': InstallCommand,
+ 'install_lib': InstallLibCommand,
},
classifiers=[
# Trove classifiers
@@ -474,7 +582,8 @@ def setup_omim_pybinding(
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: Implementation :: CPython',
- ] + [
+ ]
+ + [
'Programming Language :: Python :: {}'.format(supported_python)
for supported_python in supported_pythons
],
@@ -482,5 +591,13 @@ def setup_omim_pybinding(
if __name__ == '__main__':
+ log.set_threshold(log.INFO)
+
for binding in PYBINDINGS.keys():
- setup_omim_pybinding(name=binding)
+ log.info('Run {}:'.format(binding))
+ path = os.path.join(
+ OMIM_ROOT, os.path.normpath(PYBINDINGS[binding]['path'])
+ )
+
+ with chdir(path):
+ setup_omim_pybinding(binding)