Skip to content
Snippets Groups Projects
  • Eli Schwartz's avatar
    a49c25d8
    setup.py: drop deprecated and no longer functional "setup.py test" command · a49c25d8
    Eli Schwartz authored
    
    If you try to use it for the last year, you get this fatal error:
    
    ```
    /usr/lib/python3.12/site-packages/setuptools/_distutils/dist.py:270: UserWarning: Unknown distribution option: 'tests_require'
      warnings.warn(msg)
    running test
    [...]
    RuntimeError: Support for the test command was removed in Setuptools 72
    ```
    
    All it did was allow you to do the same thing you could already do via
    `pytest` except that in theory it permitted you to have setuptools
    download and inject an egg of pytest into the local source tree before
    launching pytest itself. By and large, nobody used it, instead using
    pytest directly. None of diffoscope's own packaging utilized it either.
    
    It also annoyed me in Gentoo packaging every time I built it:
    
    ```
     * QA Notice: setuptools warnings detected:
     *
     * 	Unknown distribution option: 'tests_require'
    ```
    
    Signed-off-by: default avatarEli Schwartz <eschwartz@gentoo.org>
    setup.py: drop deprecated and no longer functional "setup.py test" command
    Eli Schwartz authored
    
    If you try to use it for the last year, you get this fatal error:
    
    ```
    /usr/lib/python3.12/site-packages/setuptools/_distutils/dist.py:270: UserWarning: Unknown distribution option: 'tests_require'
      warnings.warn(msg)
    running test
    [...]
    RuntimeError: Support for the test command was removed in Setuptools 72
    ```
    
    All it did was allow you to do the same thing you could already do via
    `pytest` except that in theory it permitted you to have setuptools
    download and inject an egg of pytest into the local source tree before
    launching pytest itself. By and large, nobody used it, instead using
    pytest directly. None of diffoscope's own packaging utilized it either.
    
    It also annoyed me in Gentoo packaging every time I built it:
    
    ```
     * QA Notice: setuptools warnings detected:
     *
     * 	Unknown distribution option: 'tests_require'
    ```
    
    Signed-off-by: default avatarEli Schwartz <eschwartz@gentoo.org>
setup.py 2.01 KiB
#!/usr/bin/env python3

import diffoscope
import json
import sys

from setuptools import setup, find_packages


if sys.version_info < (3, 7):
    print("diffoscope requires at least python 3.7", file=sys.stderr)
    sys.exit(1)


# Load extras_require dict from external JSON file. This allows it to be easily
# shared by the debian/tests/generate-recommends.py script.
with open("extras_require.json") as f:
    extras_require = json.load(f)

setup(
    name="diffoscope",
    version=diffoscope.VERSION,
    description="in-depth comparison of files, archives, and directories",
    long_description=open("README.rst", encoding="utf-8").read(),
    long_description_content_type="text/x-rst",
    author="Diffoscope developers",
    author_email="diffoscope@lists.reproducible-builds.org",
    license="GPL-3+",
    url="https://diffoscope.org/",
    packages=find_packages(exclude=["tests", "tests.*"]),
    package_data={"diffoscope": ["scripts/*"]},
    entry_points={
        "console_scripts": ["diffoscope=diffoscope.main:main"],
    },
    install_requires=[
        "python-magic",
        "libarchive-c",
    ],
    extras_require=extras_require,
    python_requires=">=3.7",
    classifiers=[
        "Development Status :: 5 - Production/Stable",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
        "Operating System :: POSIX",
        "Programming Language :: Python",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
        "Topic :: Utilities",
    ],
    # https://packaging.python.org/guides/distributing-packages-using-setuptools/#project-urls
    project_urls={
        "Issues": "https://salsa.debian.org/reproducible-builds/diffoscope/-/issues",
        "Merge requests": "https://salsa.debian.org/reproducible-builds/diffoscope/-/merge_requests",
    },
)