diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml index bd43879..eac6db3 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -64,7 +64,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install tox tox-gh-actions + python -m pip install tox tox-gh tox-uv # this runs the platform-specific tests declared in tox.ini - name: Test with tox diff --git a/pyproject.toml b/pyproject.toml index f76831a..6b54e14 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,9 +2,81 @@ requires = ["setuptools", "setuptools_scm"] build-backend = "setuptools.build_meta" +[project] +name = "napari-matplotlib" +description = "A plugin to use Matplotlib with napari" +readme = "README.md" +requires-python = ">=3.11" +license = { text = "BSD-3-Clause" } +authors = [ + { name = "David Stansby", email = "d.stansby@ucl.ac.uk" }, +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Framework :: napari", + "Intended Audience :: Developers", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Topic :: Software Development :: Testing", +] +dependencies = [ + "matplotlib", + "napari>=0.5", + "numpy>=1.23", + "tinycss2", +] +dynamic = ["version"] + +[project.urls] +"Bug Tracker" = "https://github.com/matplotlib/napari-matplotlib/issues" +Documentation = "https://napari-matplotlib.github.io" +"Source Code" = "https://github.com/matplotlib/napari-matplotlib" +"User Support" = "https://github.com/matplotlib/napari-matplotlib/issues" + +[project.entry-points."napari.manifest"] +"napari-matplotlib" = "napari_matplotlib:napari.yaml" + +[project.optional-dependencies] +docs = [ + "napari[all]", + "numpydoc", + "pydantic<2", + "pydata-sphinx-theme", + "sphinx", + "sphinx-automodapi", + "sphinx-gallery", +] +testing = [ + "napari[pyqt6_experimental]>=0.4.18", + "pooch", + "pyqt6", + "pytest", + "pytest-cov", + "pytest-mock", + "pytest-mpl", + "pytest-qt", + "tox", + "pytest-xvfb; sys_platform == 'linux'", +] + [tool.setuptools_scm] write_to = "src/napari_matplotlib/_version.py" +[tool.setuptools] +include-package-data = true + +[tool.setuptools.packages.find] +where = ["src"] + +[tool.setuptools.package-dir] +"" = "src" + +[tool.setuptools.package-data] +"*" = ["*.yaml"] + [tool.pytest.ini_options] filterwarnings = [ "error", @@ -74,3 +146,70 @@ enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"] [[tool.mypy.overrides]] module = ["napari_matplotlib/tests/*"] disallow_untyped_defs = false + +[dependency-groups] +docs = [ + "napari[all]", + "numpydoc", + "pydantic<2", + "pydata-sphinx-theme", + "sphinx", + "sphinx-automodapi", + "sphinx-gallery", +] +test = [ + "napari[pyqt6_experimental]>=0.4.18", + "pooch", + "pyqt6", + "pytest", + "pytest-cov", + "pytest-mock", + "pytest-mpl", + "pytest-qt", + "tox", + "pytest-xvfb; sys_platform == 'linux'", +] +dev = [ + "napari[all]", + "numpydoc", + "pydantic<2", + "pydata-sphinx-theme", + "sphinx", + "sphinx-automodapi", + "sphinx-gallery", + "napari[pyqt6_experimental]>=0.4.18", + "pooch", + "pyqt6", + "pytest", + "pytest-cov", + "pytest-mock", + "pytest-mpl", + "pytest-qt", + "tox", + "pytest-xvfb; sys_platform == 'linux'", +] + +[tool.tox] +requires = ["tox>=4.19"] +env_list = ["py311", "py312", "py313"] +isolate_build = true + +[tool.tox.gh.python] +py311 = ["3.11"] +pt312 = ["3.12"] +py313 = ["3.13"] + +[tool.tox.env.test] +extras = ["testing"] +commands = [[ + "python", + "-m", + "pytest", + "--mpl", + "--mpl-generate-summary=html", + "--mpl-results-path=./reports", + "-v", + "--color=yes", + "--cov=napari_matplotlib", + "--cov-report=xml" +]] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 5ccef5c..0000000 --- a/setup.cfg +++ /dev/null @@ -1,70 +0,0 @@ -[metadata] -name = napari-matplotlib -description = A plugin to use Matplotlib with napari -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/matplotlib/napari-matplotlib -author = David Stansby -author_email = d.stansby@ucl.ac.uk -license = BSD-3-Clause -license_files = LICENSE -classifiers = - Development Status :: 5 - Production/Stable - Framework :: napari - Intended Audience :: Developers - License :: OSI Approved :: BSD License - Operating System :: OS Independent - Programming Language :: Python - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - Topic :: Software Development :: Testing -project_urls = - Bug Tracker = https://github.com/matplotlib/napari-matplotlib/issues - Documentation = https://napari-matplotlib.github.io - Source Code = https://github.com/matplotlib/napari-matplotlib - User Support = https://github.com/matplotlib/napari-matplotlib/issues - -[options] -packages = find: -install_requires = - matplotlib - napari>=0.5 - numpy>=1.23 - tinycss2 -python_requires = >=3.11 -include_package_data = True -package_dir = - =src -setup_requires = - setuptools-scm - -[options.packages.find] -where = src - -[options.entry_points] -napari.manifest = - napari-matplotlib = napari_matplotlib:napari.yaml - -[options.extras_require] -docs = - napari[all] - numpydoc - pydantic<2 - pydata-sphinx-theme - sphinx - sphinx-automodapi - sphinx-gallery -testing = - napari[pyqt6_experimental]>=0.4.18 - pooch - pyqt6 - pytest - pytest-cov - pytest-mock - pytest-mpl - pytest-qt - tox - pytest-xvfb;sys_platform == 'linux' - -[options.package_data] -* = *.yaml diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 1ad69a4..0000000 --- a/tox.ini +++ /dev/null @@ -1,14 +0,0 @@ -[tox] -envlist = py{310,311,312} -isolated_build = true - -[gh-actions] -python = - 3.11: py311 - 3.12: py312 - 3.13: py313 - -[testenv] -extras = testing -commands = - python -m pytest --mpl --mpl-generate-summary=html --mpl-results-path={toxinidir}/reports -v --color=yes --cov=napari_matplotlib --cov-report=xml