diff --git a/excalibur/__version__.py b/excalibur/__version__.py index d4291e7..2350736 100644 --- a/excalibur/__version__.py +++ b/excalibur/__version__.py @@ -14,10 +14,4 @@ def generate_version(version, prerelease=None, revision=None): return ''.join(version_parts) -__title__ = 'excalibur-py' -__description__ = 'A web interface to extract tabular data from PDFs.' -__url__ = 'https://excalibur-py.readthedocs.io/' __version__ = '.'.join(map(str, VERSION)) -__author__ = 'Vinayak Mehta' -__author_email__ = 'vmehta94@gmail.com' -__license__ = 'MIT License' diff --git a/setup.cfg b/setup.cfg index 1b48058..5d05c6b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,55 @@ +[metadata] +name = excalibur-py +version = attr: version +author = Vinayak Mehta +author_email = vmehta94@gmail.com +license = MIT +description = A web interface to extract tabular data from PDFs. +url = https://excalibur-py.readthedocs.io/ +long_description = file: README.md +long_description_content_type = text/markdown +classifiers = + License :: OSI Approved :: MIT License + Programming Language :: Python :: 3.5 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + +[options] +packages = find: +install_requires = + camelot-py[cv]>=0.7.1 + celery>=4.1.1 + Click>=7.0 + configparser>=3.5.0, <3.6.0 + Flask>=1.0.2 + SQLAlchemy>=1.2.12 +include_package_data = True + +[options.packages.find] + exclude = + tests + +[options.entry_points] +console_scripts = excalibur = excalibur.cli:cli + +[options.extras_require] +all = + camelot-py[cv]>=0.7.1 + celery>=4.1.1 + Click>=7.0 + configparser>=3.5.0, <3.6.0 + Flask>=1.0.2 + SQLAlchemy>=1.2.12 + mysqlclient>=1.3.6 +mysql = mysqlclient>=1.3.6 +dev = + codecov>=2.0.15 + pytest>=3.8.0 + pytest-cov>=2.6.0 + pytest-runner>=4.2 + Sphinx>=1.8.1 + + [aliases] test=pytest diff --git a/setup.py b/setup.py index 2ef9073..aeff945 100644 --- a/setup.py +++ b/setup.py @@ -1,75 +1,13 @@ # -*- coding: utf-8 -*- import os -from setuptools import find_packages +from setuptools import find_packages, setup +if __name__ == "__main__": + here = os.path.abspath(os.path.dirname(__file__)) + about = {} + with open(os.path.join(here, 'excalibur', '__version__.py'), 'r') as f: + exec(f.read(), about) + __version__ = about['__version__'] -here = os.path.abspath(os.path.dirname(__file__)) -about = {} -with open(os.path.join(here, 'excalibur', '__version__.py'), 'r') as f: - exec(f.read(), about) - -with open('README.md', 'r') as f: - readme = f.read() - -requires = [ - 'camelot-py[cv]>=0.7.1', - 'celery>=4.1.1', - 'Click>=7.0', - 'configparser>=3.5.0, <3.6.0', - 'Flask>=1.0.2', - 'SQLAlchemy>=1.2.12' -] -mysql = ['mysqlclient>=1.3.6'] -all_requires = requires + mysql -dev_requires = [ - 'codecov>=2.0.15', - 'pytest>=3.8.0', - 'pytest-cov>=2.6.0', - 'pytest-runner>=4.2', - 'Sphinx>=1.8.1' -] - - -def setup_package(): - metadata = dict(name=about['__title__'], - version=about['__version__'], - description=about['__description__'], - long_description=readme, - long_description_content_type="text/markdown", - url=about['__url__'], - author=about['__author__'], - author_email=about['__author_email__'], - license=about['__license__'], - packages=find_packages(exclude=('tests',)), - include_package_data=True, - install_requires=requires, - extras_require={ - 'all': all_requires, - 'mysql': mysql, - 'dev': dev_requires - }, - entry_points={ - 'console_scripts': [ - 'excalibur = excalibur.cli:cli', - ], - }, - classifiers=[ - # Trove classifiers - # Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers - 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7' - ]) - - try: - from setuptools import setup - except ImportError: - from distutils.core import setup - - setup(**metadata) - - -if __name__ == '__main__': - setup_package() + setup(use_scm_version=True)