diff --git a/setup.cfg b/setup.cfg index 957131e..886a283 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,9 +5,87 @@ # # Invenio-Circulation is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. +[metadata] +name = invenio-circulation +version = attr: invenio_circulation.__version__ +description = Invenio Circulation Module +long_description = file: README.rst, CHANGES.rst +keywords = invenio-circulation Invenio +license = MIT +author = CERN +author_email = info@inveniosoftware.org +platforms = any +url = https://github.com/inveniosoftware/invenio-circulation +classifiers = + Development Status :: 4 - Beta -[aliases] -test = pytest +[options] +include_package_data = True +packages = find: +python_requires = >=3.8 +zip_safe = False +install_requires = + Babel>=2.8 + arrow>=0.15.0 + invenio-base>=1.2.4 + invenio-access>=2.0.0 + invenio-indexer>=2.0.0 + invenio-logging>=2.0.0 + invenio-pidstore>=1.3.0 + invenio-records-rest>=2.2.0 + invenio-jsonschemas>=1.1.4 + jsonschema>=3.0.0 + +[options.extras_require] +tests = + mock>=2.0.0 + pytest-invenio>=2.0.0,<2.2.0 + pytest-mock>=1.6.0 + # Temporary, until fixed in `pytest-invenio` + celery[pytest]>=4.4.0,<5.3 + invenio-app>=1.3.1 + invenio-jsonschemas>=1.0.1 + Flask>=2.2.0,<2.3.0 + # due to https://github.com/PyCQA/pydocstyle/issues/620 + pydocstyle==6.1.1 + sphinx>=5 +mysql = + invenio-db[mysql,versioning]>=2.0.0,<3.0.0 +postgresql = + invenio-db[postgresql,versioning]>=2.0.0,<3.0.0 +sqlite = + invenio-db[versioning]>=2.0.0,<3.0.0 +opensearch2 = + invenio-search[opensearch2]>=2.0.0,<3.0.0 +elasticsearch7 = + invenio-search[elasticsearch7]>=2.0.0,<3.0.0 + # unsupported ES version issue + elasticsearch>=7.0.0,<7.14 +docs = + # Kept for backwards compatibility + +[options.entry_points] +invenio_base.apps = + invenio_circulation = invenio_circulation:InvenioCirculation +invenio_base.api_apps = + invenio_circulation = invenio_circulation:InvenioCirculation +invenio_base.api_blueprints = + invenio_circulation_loan_actions = invenio_circulation.views:create_loan_actions_blueprint + invenio_circulation_loan_replace_item = invenio_circulation.views:create_loan_replace_item_blueprint +invenio_i18n.translations = + messages = invenio_circulation +invenio_pidstore.fetchers = + loanid = invenio_circulation.pidstore.fetchers:loan_pid_fetcher +invenio_pidstore.minters = + loanid = invenio_circulation.pidstore.minters:loan_pid_minter +invenio_jsonschemas.schemas = + loans = invenio_circulation.schemas +invenio_search.mappings = + loans = invenio_circulation.mappings +invenio_records.jsonresolver = + item_resolver = invenio_circulation.records.jsonresolver.item + patron_resolver = invenio_circulation.records.jsonresolver.patron + document_resolver = invenio_circulation.records.jsonresolver.document [build_sphinx] source-dir = docs/ @@ -40,3 +118,14 @@ output-dir = invenio_circulation/translations/ [update_catalog] input-file = invenio_circulation/translations/messages.pot output-dir = invenio_circulation/translations/ + +[isort] +profile=black + +[check-manifest] +ignore = + *-requirements.txt + +[tool:pytest] +addopts = --black --isort --pydocstyle --doctest-glob="*.rst" --doctest-modules --cov=invenio_circulation --cov-report=term-missing +testpaths = tests invenio_circulation diff --git a/setup.py b/setup.py index 97817ec..a55b117 100644 --- a/setup.py +++ b/setup.py @@ -8,137 +8,6 @@ """Invenio module for the circulation of bibliographic items.""" -import os +from setuptools import setup -from setuptools import find_packages, setup - -readme = open("README.rst").read() -history = open("CHANGES.rst").read() - -tests_require = [ - "mock>=2.0.0", - "pytest-invenio>=1.4.1,<1.5.0", - "pytest-mock>=1.6.0", - "celery[pytest]>=4.4.0,<5.1", # Temporary, until fixed in `pytest-invenio` - "invenio-app>=1.3.1", - "invenio-jsonschemas>=1.0.1", - "Flask>=1.1.0,<2.0.0", -] - -invenio_db_version = "1.0.9,<1.1.0" -invenio_search_version = "1.4.0,<1.5.0" - -extras_require = { - "elasticsearch7": [ - "invenio-search[elasticsearch7]>={}".format(invenio_search_version), - # unsupported ES version issue - "elasticsearch>=7.0.0,<7.14", - ], - "docs": [ - "Sphinx>=4.2.0", - ], - "mysql": ["invenio-db[mysql,versioning]>={}".format(invenio_db_version)], - "postgresql": [ - "invenio-db[postgresql,versioning]>={}".format(invenio_db_version) - ], - "sqlite": ["invenio-db[versioning]>={}".format(invenio_db_version)], - "tests": tests_require, -} - -extras_require["all"] = [] -for name, reqs in extras_require.items(): - if name in ( - "mysql", - "postgresql", - "sqlite", - "elasticsearch7", - ): - continue - extras_require["all"].extend(reqs) - -setup_requires = ["Babel>=2.8"] - -install_requires = [ - "arrow>=0.15.0", - "invenio-base>=1.2.4", - "invenio-access>=1.3.1", - "invenio-indexer>=1.3.0,<1.4.0", - "invenio-logging>=1.2.1", - "invenio-pidstore>=1.1.0", - "invenio-records-rest>=1.6.4", - "invenio-jsonschemas>=1.0.1", - "jsonschema>=3.0.0,<4.0.0", -] - -packages = find_packages() - - -# Get the version string. Cannot be done with import! -g = {} -with open(os.path.join("invenio_circulation", "version.py"), "rt") as fp: - exec(fp.read(), g) - version = g["__version__"] - -setup( - name="invenio-circulation", - version=version, - description=__doc__, - long_description=readme + "\n\n" + history, - keywords="invenio", - license="MIT", - author="CERN", - author_email="info@inveniosoftware.org", - url="https://github.com/inveniosoftware/invenio-circulation", - packages=packages, - zip_safe=False, - include_package_data=True, - platforms="any", - python_requires=">=3", - entry_points={ - "invenio_base.apps": [ - "invenio_circulation = invenio_circulation:InvenioCirculation" - ], - "invenio_base.api_apps": [ - "invenio_circulation = invenio_circulation:InvenioCirculation" - ], - "invenio_base.api_blueprints": [ - "invenio_circulation_loan_actions = " - "invenio_circulation.views:create_loan_actions_blueprint", - "invenio_circulation_loan_replace_item = " - "invenio_circulation.views:create_loan_replace_item_blueprint", - ], - "invenio_i18n.translations": ["messages = invenio_circulation"], - "invenio_pidstore.fetchers": [ - "loanid = invenio_circulation.pidstore.fetchers:loan_pid_fetcher" - ], - "invenio_pidstore.minters": [ - "loanid = invenio_circulation.pidstore.minters:loan_pid_minter" - ], - "invenio_jsonschemas.schemas": ["loans = invenio_circulation.schemas"], - "invenio_search.mappings": ["loans = invenio_circulation.mappings"], - "invenio_records.jsonresolver": [ - "item_resolver = invenio_circulation.records.jsonresolver.item", - "patron_resolver = invenio_circulation.records.jsonresolver.patron", - "document_resolver = invenio_circulation.records.jsonresolver.document", - ], - }, - extras_require=extras_require, - install_requires=install_requires, - setup_requires=setup_requires, - tests_require=tests_require, - classifiers=[ - "Environment :: Web Environment", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Programming Language :: Python", - "Topic :: Internet :: WWW/HTTP :: Dynamic Content", - "Topic :: Software Development :: Libraries :: Python Modules", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Development Status :: 1 - Planning", - ], -) +setup()