Skip to content

Instantly share code, notes, and snippets.

@ryanjdillon
Last active January 2, 2023 10:49
Show Gist options
  • Save ryanjdillon/0bbe5227f9a05461b20ed646aac259ce to your computer and use it in GitHub Desktop.
Save ryanjdillon/0bbe5227f9a05461b20ed646aac259ce to your computer and use it in GitHub Desktop.
Pytest Plugin with pyproject.toml and setuptools
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
[project]
name = "pytest-myplugin"
description = "My pytest plugin"
readme = "README.rst"
requires-python = ">=3.5"
license = {text = "MIT"}
classifiers = [
"Development Status :: 4 - Beta",
"Framework :: Pytest",
"Intended Audience :: Developers",
"Topic :: Software Development :: Testing",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Operating System :: OS Independent",
"License :: OSI Approved :: MIT License",
]
dependencies = []
dynamic = ["version"]
# https://setuptools.pypa.io/en/latest/userguide/entry_point.html#entry-points-for-plugins
[project.entry-points.pytest11]
myplugin = "pytest_myplugin.pluginmodule"
[tools.setuptools]
include-package-data = true
[tool.setuptoools.package-data]
"pytest_myplugin.mock_data" = ["*.tiff", "*.TIFF"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment