From deae4d4edc5ee832bb373857c425422299e2e4e4 Mon Sep 17 00:00:00 2001 From: Marcelo Zoccoler Date: Wed, 16 Jul 2025 16:03:14 +0200 Subject: [PATCH 01/10] Integrate setuptools_scm for version management Added setuptools_scm to pyproject.toml for automatic versioning and updated __init__.py to read version from _version.py, falling back to 'unknown' if unavailable. This improves version consistency and automates version updates. --- pyproject.toml | 6 ++++-- src/biaplotter/__init__.py | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 97e3730..e8d0a49 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,10 @@ [build-system] -requires = ["setuptools>=42.0.0", "wheel"] +requires = ["setuptools>=42.0.0", "wheel", "setuptools_scm"] build-backend = "setuptools.build_meta" - +[tool.setuptools_scm] +write_to = "src/napari_clusters_plotter/_version.py" +fallback_version = "0.0.1+nogit" [tool.black] line-length = 79 diff --git a/src/biaplotter/__init__.py b/src/biaplotter/__init__.py index a16c0bd..9faeb9f 100644 --- a/src/biaplotter/__init__.py +++ b/src/biaplotter/__init__.py @@ -1,4 +1,8 @@ -__version__ = "0.4.1" +try: + from ._version import version as __version__ +except ImportError: + __version__ = "unknown" + from .artists import Histogram2D, Scatter from .colormap import BiaColormap from .plotter import CanvasWidget From d7f8a93bf4e76910a01c007c339b60f894862792 Mon Sep 17 00:00:00 2001 From: Marcelo Zoccoler Date: Thu, 17 Jul 2025 10:14:11 +0200 Subject: [PATCH 02/10] Migrate project metadata to pyproject.toml Moved all project configuration from setup.cfg to pyproject.toml, consolidating metadata, dependencies, entry points, and package data. This modernizes the build configuration and aligns with current Python packaging standards. --- pyproject.toml | 64 ++++++++++++++++++++++++++++++++++++++++++++++- setup.cfg | 67 -------------------------------------------------- 2 files changed, 63 insertions(+), 68 deletions(-) delete mode 100644 setup.cfg diff --git a/pyproject.toml b/pyproject.toml index e8d0a49..82f767e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,71 @@ +[project] +name = "biaplotter" +dynamic = ["version"] +description = "A base napari plotter widget for interactive plotting" +readme = "README.md" +requires-python = ">=3.10" +license = { file = "LICENSE" } +authors = [ + { name = "Marcelo Leomil Zoccoler", email = "marzoccoler@gmail.com" } +] +classifiers = [ + "Development Status :: 2 - Pre-Alpha", + "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", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Topic :: Scientific/Engineering :: Image Processing", + "Topic :: Scientific/Engineering :: Visualization", +] +urls = { + "Homepage" = "https://github.com/BiAPoL/biaplotter", + "Bug Tracker" = "https://github.com/BiAPoL/biaplotter/issues", + "Documentation" = "https://github.com/BiAPoL/biaplotter#README.md", + "Source Code" = "https://github.com/BiAPoL/biaplotter", + "User Support" = "https://github.com/BiAPoL/biaplotter/issues" +} +dependencies = [ + "numpy>=1.22.0&<2.0.0", + "magicgui", + "qtpy", + "napari-matplotlib", + "nap-plot-tools>=0.1.0" +] + +[project.optional-dependencies] +testing = [ + "tox", + "pytest", + "pytest-cov", + "pytest-qt", + "napari", + "pyqt5" +] + +[project.entry-points."napari.manifest"] +biaplotter = "biaplotter:napari.yaml" + [build-system] requires = ["setuptools>=42.0.0", "wheel", "setuptools_scm"] build-backend = "setuptools.build_meta" +[tool.setuptools] +package-dir = { "" = "src" } +packages = ["biaplotter"] +include-package-data = true + +[tool.setuptools.package-data] +"*" = ["*.yaml"] + [tool.setuptools_scm] -write_to = "src/napari_clusters_plotter/_version.py" +write_to = "src/biaplotter/_version.py" fallback_version = "0.0.1+nogit" [tool.black] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 2c0dac5..0000000 --- a/setup.cfg +++ /dev/null @@ -1,67 +0,0 @@ -[metadata] -name = biaplotter -version = attr: biaplotter.__version__ -description = A base napari plotter widget for interactive plotting -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/BiAPoL/biaplotter -author = Marcelo Leomil Zoccoler -author_email = marzoccoler@gmail.com -license = BSD-3-Clause -license_files = LICENSE -classifiers = - Development Status :: 2 - Pre-Alpha - 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 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: 3.12 - Programming Language :: Python :: 3.13 - Topic :: Scientific/Engineering :: Image Processing -project_urls = - Bug Tracker = https://github.com/BiAPoL/biaplotter/issues - Documentation = https://github.com/BiAPoL/biaplotter#README.md - Source Code = https://github.com/BiAPoL/biaplotter - User Support = https://github.com/BiAPoL/biaplotter/issues - -[options] -packages = find: -install_requires = - numpy - magicgui - qtpy - napari-matplotlib - nap-plot-tools>=0.1.0 - numpy>=1.22.0 - -python_requires = >=3.10 -include_package_data = True -package_dir = - =src - -# add your package requirements here - -[options.packages.find] -where = src - -[options.entry_points] -napari.manifest = - biaplotter = biaplotter:napari.yaml - -[options.extras_require] -testing = - tox - pytest # https://docs.pytest.org/en/latest/contents.html - pytest-cov # https://pytest-cov.readthedocs.io/en/latest/ - pytest-qt # https://pytest-qt.readthedocs.io/en/latest/ - napari - pyqt5 - - -[options.package_data] -* = *.yaml From d366e0c2b108b7e150bb80e38e9a46b73e1feb7d Mon Sep 17 00:00:00 2001 From: Marcelo Zoccoler Date: Thu, 17 Jul 2025 10:19:52 +0200 Subject: [PATCH 03/10] fix dependency syntax --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 82f767e..3db5db8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ urls = { "User Support" = "https://github.com/BiAPoL/biaplotter/issues" } dependencies = [ - "numpy>=1.22.0&<2.0.0", + "numpy>=1.22.0,<2.0.0", "magicgui", "qtpy", "napari-matplotlib", From 0c77b0d713e0a4eca19ac682a633a1e45e6b96f9 Mon Sep 17 00:00:00 2001 From: Marcelo Zoccoler Date: Thu, 17 Jul 2025 10:24:38 +0200 Subject: [PATCH 04/10] Refactor pyproject.toml URLs and package config Moved project URLs to the [project.urls] section and updated the documentation link. Replaced static package list with setuptools package finder for improved package discovery. --- pyproject.toml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3db5db8..0c01850 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,13 +24,6 @@ classifiers = [ "Topic :: Scientific/Engineering :: Image Processing", "Topic :: Scientific/Engineering :: Visualization", ] -urls = { - "Homepage" = "https://github.com/BiAPoL/biaplotter", - "Bug Tracker" = "https://github.com/BiAPoL/biaplotter/issues", - "Documentation" = "https://github.com/BiAPoL/biaplotter#README.md", - "Source Code" = "https://github.com/BiAPoL/biaplotter", - "User Support" = "https://github.com/BiAPoL/biaplotter/issues" -} dependencies = [ "numpy>=1.22.0,<2.0.0", "magicgui", @@ -52,15 +45,23 @@ testing = [ [project.entry-points."napari.manifest"] biaplotter = "biaplotter:napari.yaml" +[project.urls] +"Homepage" = "https://github.com/BiAPoL/biaplotter", +"Bug Tracker" = "https://github.com/BiAPoL/biaplotter/issues", +"Documentation" = "https://biapol-biaplotter.readthedocs.io/en/stable/", +"Source Code" = "https://github.com/BiAPoL/biaplotter", +"User Support" = "https://github.com/BiAPoL/biaplotter/issues" + [build-system] requires = ["setuptools>=42.0.0", "wheel", "setuptools_scm"] build-backend = "setuptools.build_meta" [tool.setuptools] -package-dir = { "" = "src" } -packages = ["biaplotter"] include-package-data = true +[tool.setuptools.packages.find] +where = ["src"] + [tool.setuptools.package-data] "*" = ["*.yaml"] From 1913840ada8d94e686bc3c010d545744e3ac8128 Mon Sep 17 00:00:00 2001 From: Marcelo Zoccoler Date: Thu, 17 Jul 2025 10:26:11 +0200 Subject: [PATCH 05/10] Add pytest to allowlist_externals in tox.ini Explicitly allows pytest as an external command in tox to prevent potential execution issues during test runs. --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 3362978..e11aba0 100644 --- a/tox.ini +++ b/tox.ini @@ -31,3 +31,4 @@ passenv = extras = testing commands = pytest -v --color=yes --cov=biaplotter --cov-report=xml +allowlist_externals = pytest From 210bf88e2e47f8e9a203e2f103f89c1448df2ad0 Mon Sep 17 00:00:00 2001 From: Marcelo Zoccoler Date: Thu, 17 Jul 2025 10:32:42 +0200 Subject: [PATCH 06/10] Removed a comma what a game changer! --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0c01850..02f8486 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Topic :: Scientific/Engineering :: Image Processing", - "Topic :: Scientific/Engineering :: Visualization", + "Topic :: Scientific/Engineering :: Visualization" ] dependencies = [ "numpy>=1.22.0,<2.0.0", From 92a69a00d00f92909b21093ca4827df50300d645 Mon Sep 17 00:00:00 2001 From: Marcelo Zoccoler Date: Thu, 17 Jul 2025 10:36:18 +0200 Subject: [PATCH 07/10] Remove more commas Wow now I am being bold --- pyproject.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 02f8486..4336153 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,10 +46,10 @@ testing = [ biaplotter = "biaplotter:napari.yaml" [project.urls] -"Homepage" = "https://github.com/BiAPoL/biaplotter", -"Bug Tracker" = "https://github.com/BiAPoL/biaplotter/issues", -"Documentation" = "https://biapol-biaplotter.readthedocs.io/en/stable/", -"Source Code" = "https://github.com/BiAPoL/biaplotter", +"Homepage" = "https://github.com/BiAPoL/biaplotter" +"Bug Tracker" = "https://github.com/BiAPoL/biaplotter/issues" +"Documentation" = "https://biapol-biaplotter.readthedocs.io/en/stable/" +"Source Code" = "https://github.com/BiAPoL/biaplotter" "User Support" = "https://github.com/BiAPoL/biaplotter/issues" [build-system] From f980096fa55f8176af8c0aab4ab58090bdd2eac3 Mon Sep 17 00:00:00 2001 From: Marcelo Zoccoler Date: Thu, 17 Jul 2025 10:55:35 +0200 Subject: [PATCH 08/10] Exclude Python 3.13 on Windows in tox config Added a [gh-actions:exclude] section to tox.ini to prevent running tests with Python 3.13 on windows-latest due to known failures (code 3221225477). --- tox.ini | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index e11aba0..c37f4ce 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,7 @@ python = 3.10: py310 3.11: py311 3.12: py312 - 3.13: py313 + 3.13: py313 # Exclude on windows-latest below [gh-actions:env] PLATFORM = @@ -16,6 +16,12 @@ PLATFORM = macos-latest: macos windows-latest: windows +[gh-actions:exclude] +python = + 3.13 +PLATFORM = + windows # py313-windows: FAIL code 3221225477 + [testenv] platform = macos: darwin From c295bab3f553a7268f6ee971bfe5a0d7885636e7 Mon Sep 17 00:00:00 2001 From: Marcelo Zoccoler Date: Thu, 17 Jul 2025 11:01:27 +0200 Subject: [PATCH 09/10] Revert "Exclude Python 3.13 on Windows in tox config" This reverts commit f980096fa55f8176af8c0aab4ab58090bdd2eac3. --- tox.ini | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tox.ini b/tox.ini index c37f4ce..e11aba0 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,7 @@ python = 3.10: py310 3.11: py311 3.12: py312 - 3.13: py313 # Exclude on windows-latest below + 3.13: py313 [gh-actions:env] PLATFORM = @@ -16,12 +16,6 @@ PLATFORM = macos-latest: macos windows-latest: windows -[gh-actions:exclude] -python = - 3.13 -PLATFORM = - windows # py313-windows: FAIL code 3221225477 - [testenv] platform = macos: darwin From 5e65477d98c1ca45c1d505c059a0eae6640f1ae9 Mon Sep 17 00:00:00 2001 From: Marcelo Zoccoler Date: Thu, 17 Jul 2025 11:02:28 +0200 Subject: [PATCH 10/10] Exclude Python 3.13 on Windows from test matrix Added an exclusion for Python 3.13 on windows-latest in the GitHub Actions test matrix due to known failures (exit code 3221225477). --- .github/workflows/test_and_deploy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml index 6b4628e..c2a6348 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -24,6 +24,9 @@ jobs: matrix: platform: [ubuntu-latest, windows-latest, macos-latest] python-version: ['3.10', '3.11', '3.12', '3.13'] + exclude: + - platform: windows-latest + python-version: '3.13' # py313-windows: FAIL code 3221225477 steps: - uses: actions/checkout@v3