Skip to content

Commit

Permalink
Remove tests from the wheel and simplify setup.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
sputt committed Dec 27, 2024
1 parent 7a6348a commit be1661d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 31 deletions.
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[build-system]
# Suggest a reasonably modern floor for setuptools to ensure
# the source dist package is assembled with all the expected resources.
requires = ["setuptools >= 60", "wheel"]
build-backend = "setuptools.build_meta"
33 changes: 2 additions & 31 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@
:license: Apache 2.0
"""

import sys

from setuptools import setup
from setuptools.command.test import test as TestCommand

setup_requires = []

install_requires = [
"requests>=2.30.0,<3.0",
Expand All @@ -37,31 +32,11 @@
"tomli-w",
]

if "test" in sys.argv:
setup_requires.extend(tests_require)

extras_require = {"tests": tests_require}


class PyTest(TestCommand):
"""Designed to be run via `python setup.py test`"""

def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True

def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest

errno = pytest.main(self.test_args)
sys.exit(errno)


setup(
name="responses",
version="0.25.3",
version="0.25.4",
author="David Cramer",
description="A utility library for mocking out the `requests` Python library.",
url="https://github.com/getsentry/responses",
Expand All @@ -72,17 +47,13 @@ def run_tests(self):
"Source Code": "https://github.com/getsentry/responses",
},
license="Apache 2.0",
long_description=open("README.rst").read(),
long_description=open("README.rst", encoding="utf-8").read(),
long_description_content_type="text/x-rst",
packages=["responses"],
zip_safe=False,
python_requires=">=3.8",
install_requires=install_requires,
extras_require=extras_require,
tests_require=tests_require,
setup_requires=setup_requires,
cmdclass={"test": PyTest},
include_package_data=True,
classifiers=[
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
Expand Down

0 comments on commit be1661d

Please sign in to comment.