From 2fb0e4578f5fe0e849653d34c32d20b14d375615 Mon Sep 17 00:00:00 2001 From: PingjunChen Date: Thu, 13 Dec 2018 23:02:04 -0500 Subject: [PATCH] add package setup --- .gitignore | 2 +- MANIFEST.in | 1 + setup.cfg | 5 +++++ setup.py | 45 +++++++++++++++++++++++++++++++++++++++++++++ src/__init__.py | 6 ++++++ src/setup.py | 19 +++++++++++++++++++ 6 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 MANIFEST.in create mode 100644 setup.cfg create mode 100644 setup.py create mode 100644 src/setup.py diff --git a/.gitignore b/.gitignore index a4a90d6..701fecf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ +data/ *.pyc -data/ .venv __pycache__/ .pytest_cache/ diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..656fc26 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include requirements.txt LICENSE diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..6fedc19 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,5 @@ +[metadata] +description-file = README.md + +[bdist_wheel] +universal=1 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..94a2e97 --- /dev/null +++ b/setup.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- + +import os, sys +from setuptools import setup, find_packages + + +PKG_NAME = "TissueLocalizer" +VERSION = 1.0.0 +DESCRIPTION = "Localize the tissue regions in whole slide pathology images." +HOMEPAGE = "https://github.com/PingjunChen/TissueLocalizer" +LICENSE = "MIT" +AUTHOR_NAME = "Pingjun Chen" +AUTHOR_EMAIL = "chenpingjun@gmx.com" + +REQS = "" +with open('requirements.txt') as f: + REQS = [pkg.replace("==", ">=") for pkg in f.read().splitlines()] + +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: Science/Research', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Topic :: Scientific/Engineering', + 'Topic :: Computational Pathology', + 'Topic :: Whole Slide Image Analysis', +] + +args = dict( + name=PKG_NAME, + version=VERSION, + description=DESCRIPTION, + url=HOMEPAGE, + license=LICENSE, + author=AUTHOR_NAME, + author_email=AUTHOR_EMAIL, + packages=find_packages(), + install_requires=REQS, + classifiers=CLASSIFIERS, +) + +setup(**args) diff --git a/src/__init__.py b/src/__init__.py index e69de29..7a169c9 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- + +import os, sys + +from load_slide import * +from locate_tissue import * diff --git a/src/setup.py b/src/setup.py new file mode 100644 index 0000000..0ff39f2 --- /dev/null +++ b/src/setup.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- + +import os, sys + +BASE_PATH = os.path.abspath(os.path.dirname(__file__)) +PKG_NAME = os.path.basename(BASE_PATH) + +def configuration(parent_package='', top_path=None): + from numpy.distutils.misc_util import Configuration + config = Configuration(PKG_NAME, parent_package, top_path) + + return config + + +if __name__ == "__main__": + from numpy.distutils.core import setup + + config = configuration(top_path='').todict() + setup(**config)