From c7cc71f3e1253a53242714bd9f22bedfa3921260 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 11 Feb 2024 19:25:35 -0800 Subject: [PATCH 1/3] pyproject.toml: Move metadata here from setup.cfg --- pyproject.toml | 47 +++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 35 ----------------------------------- 2 files changed, 47 insertions(+), 35 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8e6c7b0..e7556b3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,6 +5,53 @@ requires = [ ] build-backend = "setuptools.build_meta" +[project] +name = "pytest-mock" +version = "0.1.0" +description = "Thin-wrapper around the mock package for easier use with pytest" +authors = [ + {name = "Bruno Oliveira", email = "nicoddemus@gmail.com"}, +] +dependencies = [ + "pytest>=6.2.5", +] +requires-python = ">=3.8" +readme = "README.md" +license = {text = "MIT"} +keywords = ["pytest mock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Framework :: Pytest", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Software Development :: Testing", +] + +[project.urls] +Homepage = "https://github.com/pytest-dev/pytest-mock/" +Documentation = "https://pytest-mock.readthedocs.io/en/latest/" +Changelog = "https://pytest-mock.readthedocs.io/en/latest/changelog.html" +Source = "https://github.com/pytest-dev/pytest-mock/" +Tracker = "https://github.com/pytest-dev/pytest-mock/issues" + +[project.optional-dependencies] +dev = [ + "pre-commit", + "pytest-asyncio", + "tox", +] + +[project.entry-points.pytest11] +pytest_mock = "pytest_mock" + [tool.ruff.lint] extend-select = ["I001"] diff --git a/setup.py b/setup.py index 5e89ed3..a70028a 100644 --- a/setup.py +++ b/setup.py @@ -2,46 +2,11 @@ from setuptools import setup setup( - name="pytest-mock", - entry_points={"pytest11": ["pytest_mock = pytest_mock"]}, packages=find_packages(where="src"), package_dir={"": "src"}, platforms="any", package_data={ "pytest_mock": ["py.typed"], }, - python_requires=">=3.8", - install_requires=["pytest>=6.2.5"], use_scm_version={"write_to": "src/pytest_mock/_version.py"}, - setup_requires=["setuptools_scm"], - url="https://github.com/pytest-dev/pytest-mock/", - license="MIT", - author="Bruno Oliveira", - author_email="nicoddemus@gmail.com", - description="Thin-wrapper around the mock package for easier use with pytest", - long_description=open("README.rst", encoding="utf-8").read(), - long_description_content_type="text/x-rst", - keywords="pytest mock", - extras_require={"dev": ["pre-commit", "tox", "pytest-asyncio"]}, - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Framework :: Pytest", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3 :: Only", - "Topic :: Software Development :: Testing", - ], - project_urls={ - "Documentation": "https://pytest-mock.readthedocs.io/en/latest/", - "Changelog": "https://pytest-mock.readthedocs.io/en/latest/changelog.html", - "Source": "https://github.com/pytest-dev/pytest-mock/", - "Tracker": "https://github.com/pytest-dev/pytest-mock/issues", - }, ) From 24656bd74d5113d002b46f41ffcd129bc1c5202e Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 12 Feb 2024 10:21:07 -0300 Subject: [PATCH 2/3] Move completely to pyproject.toml --- CHANGELOG.rst | 3 +++ pyproject.toml | 8 +++++++- setup.py | 12 ------------ 3 files changed, 10 insertions(+), 13 deletions(-) delete mode 100644 setup.py diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c576196..cccef3f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,9 @@ UNRELEASED ---------- * ``pytest-mock`` now requires ``pytest>=6.2.5``. +* `#410 `_: pytest-mock's ``setup.py`` file is removed. + If you relied on this file, e.g. to install pytest using ``setup.py install``, + please see `Why you shouldn't invoke setup.py directly `_ for alternatives. 3.12.0 (2023-10-19) ------------------- diff --git a/pyproject.toml b/pyproject.toml index e7556b3..7faef6d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ dependencies = [ requires-python = ">=3.8" readme = "README.md" license = {text = "MIT"} -keywords = ["pytest mock"] +keywords = ["pytest", "mock"] classifiers = [ "Development Status :: 5 - Production/Stable", "Framework :: Pytest", @@ -52,6 +52,12 @@ dev = [ [project.entry-points.pytest11] pytest_mock = "pytest_mock" +[tool.setuptools.package-data] +"pytest_mock" = ["py.typed"] + +[tool.setuptools_scm] +write_to = "src/pytest_mock/_version.py" + [tool.ruff.lint] extend-select = ["I001"] diff --git a/setup.py b/setup.py deleted file mode 100644 index a70028a..0000000 --- a/setup.py +++ /dev/null @@ -1,12 +0,0 @@ -from setuptools import find_packages -from setuptools import setup - -setup( - packages=find_packages(where="src"), - package_dir={"": "src"}, - platforms="any", - package_data={ - "pytest_mock": ["py.typed"], - }, - use_scm_version={"write_to": "src/pytest_mock/_version.py"}, -) From b9b189b8569a5b2f95c0c883e62b548a4111e3c9 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 12 Feb 2024 11:00:37 -0300 Subject: [PATCH 3/3] Fixes --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7faef6d..9865b37 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,6 @@ build-backend = "setuptools.build_meta" [project] name = "pytest-mock" -version = "0.1.0" description = "Thin-wrapper around the mock package for easier use with pytest" authors = [ {name = "Bruno Oliveira", email = "nicoddemus@gmail.com"}, @@ -15,8 +14,9 @@ authors = [ dependencies = [ "pytest>=6.2.5", ] +dynamic = ["version"] requires-python = ">=3.8" -readme = "README.md" +readme = "README.rst" license = {text = "MIT"} keywords = ["pytest", "mock"] classifiers = [ @@ -53,7 +53,7 @@ dev = [ pytest_mock = "pytest_mock" [tool.setuptools.package-data] -"pytest_mock" = ["py.typed"] +pytest_mock = ["py.typed"] [tool.setuptools_scm] write_to = "src/pytest_mock/_version.py"