109 lines
		
	
	
		
			2.9 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			109 lines
		
	
	
		
			2.9 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
"""
 | 
						|
  _____           _     _______             _ 
 | 
						|
 |  __ \         | |   |__   __|           | |  
 | 
						|
 | |__) | __ ___ | |_ ___ | | ___  _ __ ___| |__
 | 
						|
 |  ___/ '__/ _ \| __/ _ \| |/ _ \| '__/ __| '_ \ 
 | 
						|
 | |   | | | (_) | || (_) | | (_) | | | (__| | | |
 | 
						|
 |_|   |_|  \___/ \__\___/|_|\___/|_|  \___|_| |_|
 | 
						|
 | 
						|
ProtoTorch Core Package
 | 
						|
"""
 | 
						|
 | 
						|
from setuptools import setup
 | 
						|
from setuptools import find_packages
 | 
						|
 | 
						|
from pkg_resources import safe_name
 | 
						|
 | 
						|
import ast
 | 
						|
import importlib.util
 | 
						|
 | 
						|
PKG_DIR = "prototorch"
 | 
						|
 | 
						|
 | 
						|
def find_version():
 | 
						|
    """Return value of __version__.
 | 
						|
 | 
						|
    Reference: https://stackoverflow.com/a/42269185/
 | 
						|
    """
 | 
						|
    file_path = importlib.util.find_spec(PKG_DIR).origin
 | 
						|
    with open(file_path) as file_obj:
 | 
						|
        root_node = ast.parse(file_obj.read())
 | 
						|
    for node in ast.walk(root_node):
 | 
						|
        if isinstance(node, ast.Assign):
 | 
						|
            if len(node.targets) == 1 and node.targets[0].id == "__version_core__":
 | 
						|
                return node.value.s
 | 
						|
    raise RuntimeError("Unable to find version string.")
 | 
						|
 | 
						|
 | 
						|
version = find_version()
 | 
						|
 | 
						|
PROJECT_URL = "https://github.com/si-cim/prototorch"
 | 
						|
DOWNLOAD_URL = "https://github.com/si-cim/prototorch.git"
 | 
						|
 | 
						|
with open("README.md", "r") as fh:
 | 
						|
    long_description = fh.read()
 | 
						|
 | 
						|
INSTALL_REQUIRES = [
 | 
						|
    "torch>=1.3.1",
 | 
						|
    "torchvision>=0.5.0",
 | 
						|
    "numpy>=1.9.1",
 | 
						|
]
 | 
						|
DOCS = [
 | 
						|
    "recommonmark",
 | 
						|
    "sphinx",
 | 
						|
    "sphinx_rtd_theme",
 | 
						|
    "sphinxcontrib-katex",
 | 
						|
]
 | 
						|
DATASETS = [
 | 
						|
    "requests",
 | 
						|
    "tqdm",
 | 
						|
]
 | 
						|
EXAMPLES = [
 | 
						|
    "sklearn",
 | 
						|
    "matplotlib",
 | 
						|
    "torchinfo",
 | 
						|
]
 | 
						|
TESTS = ["pytest"]
 | 
						|
ALL = DOCS + DATASETS + EXAMPLES + TESTS
 | 
						|
 | 
						|
setup(
 | 
						|
    name=safe_name(PKG_DIR),
 | 
						|
    version=version,
 | 
						|
    description="Highly extensible, GPU-supported "
 | 
						|
    "Learning Vector Quantization (LVQ) toolbox "
 | 
						|
    "built using PyTorch and its nn API.",
 | 
						|
    long_description=long_description,
 | 
						|
    long_description_content_type="text/markdown",
 | 
						|
    author="Jensun Ravichandran",
 | 
						|
    author_email="jjensun@gmail.com",
 | 
						|
    url=PROJECT_URL,
 | 
						|
    download_url=DOWNLOAD_URL,
 | 
						|
    license="MIT",
 | 
						|
    install_requires=INSTALL_REQUIRES,
 | 
						|
    extras_require={
 | 
						|
        "docs": DOCS,
 | 
						|
        "datasets": DATASETS,
 | 
						|
        "examples": EXAMPLES,
 | 
						|
        "tests": TESTS,
 | 
						|
        "all": ALL,
 | 
						|
    },
 | 
						|
    classifiers=[
 | 
						|
        "Development Status :: 2 - Pre-Alpha",
 | 
						|
        "Environment :: Console",
 | 
						|
        "Intended Audience :: Developers",
 | 
						|
        "Intended Audience :: Education",
 | 
						|
        "Intended Audience :: Science/Research",
 | 
						|
        "License :: OSI Approved :: MIT License",
 | 
						|
        "Natural Language :: English",
 | 
						|
        "Programming Language :: Python :: 3.6",
 | 
						|
        "Programming Language :: Python :: 3.7",
 | 
						|
        "Programming Language :: Python :: 3.8",
 | 
						|
        "Operating System :: OS Independent",
 | 
						|
        "Topic :: Scientific/Engineering :: Artificial Intelligence",
 | 
						|
        "Topic :: Software Development :: Libraries",
 | 
						|
        "Topic :: Software Development :: Libraries :: Python Modules",
 | 
						|
    ],
 | 
						|
    packages=find_packages(),
 | 
						|
    zip_safe=False,
 | 
						|
)
 |