diff --git a/requirements-azure.txt b/requirements-azure.txt new file mode 100644 index 0000000..c0e4b0c --- /dev/null +++ b/requirements-azure.txt @@ -0,0 +1 @@ +azure-storage-blob >= 12.0, != 12.9.0 # version 12.9.0 breaks mypy https://github.com/Azure/azure-sdk-for-python/pull/20891 diff --git a/requirements-libcloud.txt b/requirements-libcloud.txt new file mode 100644 index 0000000..5d1cd7e --- /dev/null +++ b/requirements-libcloud.txt @@ -0,0 +1 @@ +apache-libcloud diff --git a/requirements-test.txt b/requirements-test.txt index d197d8d..6366880 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,11 +1,9 @@ -apache-libcloud -azure-storage-blob >= 12.0, != 12.9.0 # version 12.9.0 breaks mypy https://github.com/Azure/azure-sdk-for-python/pull/20891 pytest < 7.0.0 # v7.0.0 removed _pytest.tmpdir.TempdirFactory, which is used by some of the pytest plugins we use pytest-asyncio pytest-mock requests_mock[fixture] >= 1.9 requests_toolbelt types-pyyaml types-requests pytest-postgresql < 4.0.0 # version 4.0 depends on psycopg 3. https://github.com/ClearcodeHQ/pytest-postgresql/blob/main/CHANGES.rst#400 diff --git a/requirements-winery.txt b/requirements-winery.txt new file mode 100644 index 0000000..a93e1f1 --- /dev/null +++ b/requirements-winery.txt @@ -0,0 +1,2 @@ +psycopg2 +sh diff --git a/requirements.txt b/requirements.txt index 252f61a..6170110 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,14 +1,9 @@ # Add here external Python modules dependencies, one per line. Module names # should match https://pypi.python.org/pypi names. For the full spec or # dependency lines, see https://pip.readthedocs.org/en/1.1/requirements.html -# remote storage API server click -requests -psycopg2 -sh typing-extensions -# optional dependencies -# apache-libcloud -# azure-storage-blob >= 12.0 +# seaweedfs backend +requests diff --git a/setup.py b/setup.py index 91c4fd0..1e76487 100755 --- a/setup.py +++ b/setup.py @@ -1,70 +1,78 @@ #!/usr/bin/env python3 # Copyright (C) 2015-2020 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information from io import open from os import path from setuptools import find_packages, setup here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, "README.md"), encoding="utf-8") as f: long_description = f.read() def parse_requirements(name=None): if name: reqf = "requirements-%s.txt" % name else: reqf = "requirements.txt" requirements = [] if not path.exists(reqf): return requirements with open(reqf) as f: for line in f.readlines(): line = line.strip() if not line or line.startswith("#"): continue requirements.append(line) return requirements setup( name="swh.objstorage", description="Software Heritage Object Storage", long_description=long_description, long_description_content_type="text/markdown", python_requires=">=3.7", author="Software Heritage developers", author_email="swh-devel@inria.fr", url="https://forge.softwareheritage.org/diffusion/DOBJS", packages=find_packages(), install_requires=parse_requirements() + parse_requirements("swh"), setup_requires=["setuptools-scm"], use_scm_version=True, - extras_require={"testing": parse_requirements("test")}, + extras_require={ + "testing": parse_requirements("test") + + parse_requirements("azure") + + parse_requirements("libcloud") + + parse_requirements("winery"), + "azure": parse_requirements("azure"), + "libcloud": parse_requirements("libcloud"), + "winery": parse_requirements("winery"), + }, include_package_data=True, entry_points=""" [swh.cli.subcommands] objstorage=swh.objstorage.cli """, classifiers=[ "Programming Language :: Python :: 3", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Development Status :: 5 - Production/Stable", ], project_urls={ "Bug Reports": "https://forge.softwareheritage.org/maniphest", "Funding": "https://www.softwareheritage.org/donate", "Source": "https://forge.softwareheritage.org/source/swh-objstorage", "Documentation": "https://docs.softwareheritage.org/devel/swh-objstorage/", }, )