Commit 66c9ef51 authored by ymir's avatar ymir

add setup

parents
#!/usr/bin/env python3
# coding=utf-8
# import generic modules
from os.path import join, dirname, isdir
from setuptools import setup
from importlib import import_module
from pkgutil import walk_packages
# constants
YGGDRASIL_REP="http://91.121.9.53:81/"
# parse recursively a module
# this code is an adaptation from https://stackoverflow.com/questions/3365740/how-to-import-all-submodules
def import_submodules(package):
if isinstance(package, str):
package = import_module(package)
modules = list()
for loader, name, is_pkg in walk_packages(package.__path__):
full_name = package.__name__ + '.' + name
full_path=join(loader.path,name)
# continue recursion only if module is folder
if is_pkg and isdir(full_path):
modules.append(full_name)
modules=modules+(import_submodules(full_name))
return modules
# import and parse dedicated module
import neuralnetworktrainerservice
rootPackage=neuralnetworktrainerservice
modules=[rootPackage.__name__]+import_submodules (rootPackage)
print("loaded modules : " + str(modules))
# define setup parameters
setup(
name="NeuralNetworkTrainerService",
version="0.0.0",
description="Neural network trainer CLI",
packages=modules,
#dependency_links=[YGGDRASIL_REP+"neuralnetworkcommon"],
#install_requires=["neuralnetworkcommon","psycopg2","psycopg2-binary","flask","flask_restful"],
classifiers=[
'Programming Language :: Python :: 3',
],
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment