Skip to content

Commit 5b2a97c

Browse files
samcunliffejaideepkathiresandstansby
authored
Merge setup.cfg, tox.ini into pyproject.toml and use dependency groups (#322)
* Tox to pyproject. * Merge setup.cfg into pyproject.toml and use dependency groups (#316) * Rest of the pytest command with MPL extensions. * `tox-gh` instead of `tox-gh-actions`. And add `tox-uv` for speed. * Fix reports dir for upload. * Typos Co-authored-by: David Stansby <dstansby@gmail.com> * Use the `include-group` syntax rather than WET. * Remove optionals in favour of groups. * Use dependency group in docs build too! --------- Co-authored-by: jaideepkathiresan <jvk7557@gmail.com> Co-authored-by: David Stansby <dstansby@gmail.com>
1 parent 6ef1fdb commit 5b2a97c

File tree

5 files changed

+97
-87
lines changed

5 files changed

+97
-87
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Install Dependencies
3232
run: |
3333
python -m pip install --upgrade pip
34-
python -m pip install ".[docs]"
34+
python -m pip install "." --group docs
3535
sudo apt install graphviz --yes
3636
3737
- name: Build Docs

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
- name: Install dependencies
6565
run: |
6666
python -m pip install --upgrade pip
67-
python -m pip install tox tox-gh-actions
67+
python -m pip install tox tox-gh tox-uv
6868
6969
# this runs the platform-specific tests declared in tox.ini
7070
- name: Test with tox

pyproject.toml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,79 @@
22
requires = ["setuptools", "setuptools_scm"]
33
build-backend = "setuptools.build_meta"
44

5+
[project]
6+
name = "napari-matplotlib"
7+
description = "A plugin to use Matplotlib with napari"
8+
readme = "README.md"
9+
requires-python = ">=3.11"
10+
license = { text = "BSD-3-Clause" }
11+
authors = [{ name = "David Stansby", email = "d.stansby@ucl.ac.uk" }]
12+
classifiers = [
13+
"Development Status :: 5 - Production/Stable",
14+
"Framework :: napari",
15+
"Intended Audience :: Developers",
16+
"License :: OSI Approved :: BSD License",
17+
"Operating System :: OS Independent",
18+
"Programming Language :: Python",
19+
"Programming Language :: Python :: 3",
20+
"Programming Language :: Python :: 3 :: Only",
21+
"Topic :: Software Development :: Testing",
22+
]
23+
dependencies = ["matplotlib", "napari>=0.5", "numpy>=2", "tinycss2"]
24+
dynamic = ["version"]
25+
26+
[project.urls]
27+
"Bug Tracker" = "https://github.com/matplotlib/napari-matplotlib/issues"
28+
Documentation = "https://napari-matplotlib.github.io"
29+
"Source Code" = "https://github.com/matplotlib/napari-matplotlib"
30+
"User Support" = "https://github.com/matplotlib/napari-matplotlib/issues"
31+
32+
[project.entry-points."napari.manifest"]
33+
"napari-matplotlib" = "napari_matplotlib:napari.yaml"
34+
35+
[dependency-groups]
36+
docs = [
37+
"napari[all]",
38+
"numpydoc",
39+
"pydantic<2",
40+
"pydata-sphinx-theme",
41+
"sphinx",
42+
"sphinx-automodapi",
43+
"sphinx-gallery",
44+
]
45+
testing = [
46+
"napari[pyqt6_experimental]>=0.5",
47+
"numpy>=2.1",
48+
"pooch",
49+
"pyqt6",
50+
"pytest",
51+
"pytest-cov",
52+
"pytest-mock",
53+
"pytest-mpl",
54+
"pytest-qt",
55+
"tox",
56+
"pytest-xvfb; sys_platform == 'linux'",
57+
]
58+
dev = [
59+
{ include-group = "testing" },
60+
{ include-group = "docs" }
61+
]
62+
563
[tool.setuptools_scm]
664
write_to = "src/napari_matplotlib/_version.py"
765

66+
[tool.setuptools]
67+
include-package-data = true
68+
69+
[tool.setuptools.packages.find]
70+
where = ["src"]
71+
72+
[tool.setuptools.package-dir]
73+
"" = "src"
74+
75+
[tool.setuptools.package-data]
76+
"*" = ["*.yaml"]
77+
878
[tool.pytest.ini_options]
979
filterwarnings = [
1080
"error",
@@ -72,3 +142,28 @@ enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
72142
[[tool.mypy.overrides]]
73143
module = ["napari_matplotlib/tests/*"]
74144
disallow_untyped_defs = false
145+
146+
[tool.tox]
147+
requires = ["tox>=4.19"]
148+
env_list = ["py311", "py312", "py313"]
149+
isolate_build = true
150+
151+
[tool.tox.gh.python]
152+
py311 = ["3.11"]
153+
py312 = ["3.12"]
154+
py313 = ["3.13"]
155+
156+
[tool.tox.env.test]
157+
extras = ["testing"]
158+
commands = [[
159+
"python",
160+
"-m",
161+
"pytest",
162+
"--mpl",
163+
"--mpl-generate-summary=html",
164+
"--mpl-results-path=./reports",
165+
"-v",
166+
"--color=yes",
167+
"--cov=napari_matplotlib",
168+
"--cov-report=xml",
169+
]]

setup.cfg

Lines changed: 0 additions & 71 deletions
This file was deleted.

tox.ini

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)