Repository: napari/napari-tiff (language: python)

Issue:
Convert setup.py to pyproject.toml
When this repository was first created, `setup.py` files were the standard way to package your python projects. Now the current best practice is to use `pypoject.toml` setup files instead. So, we want to convert the `setup.py` file here into a `pyproject.toml` file.

Extra resources: the python packaging user guide https://packaging.python.org/en/latest/tutorials/packaging-projects/



Discussion / hints:
There's a tool to automate the bulk of this, gimme a sec to find it...
https://github.com/diazona/setuptools-pyproject-migration

Fix patch:
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..cb1f093
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,68 @@
+[project]
+name = 'napari-tiff'
+description = 'official napari tiff reader and writer.'
+readme = 'README.md'
+dynamic = ['version']
+authors = [
+   {name = 'Genevieve Buckley'},
+   {name = 'napari core developers', email = 'napari-core-devs@googlegroups.com'},
+   {name = 'napari-tiff contributors'},
+]
+classifiers = [
+   'Development Status :: 3 - Alpha',
+   'Intended Audience :: Developers',
+   'Intended Audience :: Education',
+   'Intended Audience :: Science/Research',
+   'Framework :: napari',
+   'Programming Language :: Python',
+   'Programming Language :: Python :: 3',
+   'Programming Language :: Python :: 3.10',
+   'Programming Language :: Python :: 3.11',
+   'Programming Language :: Python :: 3.12',
+   'Topic :: Software Development :: Libraries',
+   'Topic :: Scientific/Engineering',
+   'Programming Language :: Python :: Implementation :: CPython',
+   'Operating System :: OS Independent',
+   'License :: OSI Approved :: BSD License',
+]
+requires-python = '>=3.10'
+dependencies = [
+   'imagecodecs',
+   'numpy',
+   'tifffile>=2020.5.7',
+   'vispy',
+]
+
+[project.optional-dependencies]
+testing = [
+   'pytest',
+]
+
+dev = [
+   'tox',
+]
+
+[tools.setuptools]
+include-package-data = true
+
+[tools.setuptools.package-data]
+napari-tiff = ['*napari.yaml']
+
+[project.entry-points.'napari.manifest']
+napari-tiff = 'napari_tiff:napari.yaml'
+
+[project.license]
+file = 'LICENSE'
+
+[project.urls]
+# homepage = ''
+# documentation = ''
+source = 'https://github.com/napari/napari-tiff'
+tracker = 'https://github.com/napari/napari-tiff/issues'
+
+[build-system]
+requires = ['setuptools', 'setuptools_scm', 'wheel']
+build-backend = 'setuptools.build_meta'
+
+[tool.setuptools_scm]
+write_to = 'napari_tiff/_version.py'
\ No newline at end of file
diff --git a/requirements.txt b/requirements.txt
deleted file mode 100644
index 4695091..0000000
--- a/requirements.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-imagecodecs
-numpy
-tifffile>=2020.5.7
-vispy
\ No newline at end of file
diff --git a/setup.py b/setup.py
deleted file mode 100644
index 3558ac5..0000000
--- a/setup.py
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-import os
-import codecs
-from setuptools import setup, find_packages
-
-
-def read(fname):
-    file_path = os.path.join(os.path.dirname(__file__), fname)
-    return codecs.open(file_path, encoding='utf-8').read()
-
-
-# Add your dependencies in requirements.txt
-# Note: you can add test-specific requirements in tox.ini
-requirements = []
-with open('requirements.txt') as f:
-    for line in f:
-        stripped = line.split("#")[0].strip()
-        if len(stripped) > 0:
-            requirements.append(stripped)
-
-
-# https://github.com/pypa/setuptools_scm
-use_scm = {"write_to": "napari_tiff/_version.py"}
-
-setup(
-    name='napari-tiff',
-    author='Genevieve Buckley',
-    license='BSD-3',
-    url='https://github.com/GenevieveBuckley/napari-tiff',
-    description='A napari reader plugin for tiff images.',
-    long_description=read('README.md'),
-    long_description_content_type='text/markdown',
-    packages=find_packages(),
-    python_requires='>=3.6',
-    install_requires=requirements,
-    use_scm_version=use_scm,
-    setup_requires=['setuptools_scm'],
-    classifiers=[
-        'Development Status :: 4 - Beta',
-        'Intended Audience :: Developers',
-        'Topic :: Software Development :: Testing',
-        'Programming Language :: Python',
-        'Programming Language :: Python :: 3',
-        'Programming Language :: Python :: 3.6',
-        'Programming Language :: Python :: 3.7',
-        'Programming Language :: Python :: 3.8',
-        'Programming Language :: Python :: Implementation :: CPython',
-        'Programming Language :: Python :: Implementation :: PyPy',
-        'Operating System :: OS Independent',
-        'License :: OSI Approved :: BSD License',
-    ],
-    entry_points={
-        'napari.plugin': [
-            'tifffile = napari_tiff',
-        ],
-    },
-)
diff --git a/tox.ini b/tox.ini
index 5cbeb41..6f21c3e 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,13 +1,12 @@
 # For more information about tox, see https://tox.readthedocs.io/en/latest/
 [tox]
-envlist = py{36,37,38}-{linux,macos,windows}
+envlist = {linux,macos,windows}-py{310,312}
 
 [gh-actions]
 python =
-    3.6: py36
-    3.7: py37
-    3.8: py38
-    
+    3.10: py310
+    3.12: py312
+
 [gh-actions:env]
 PLATFORM =
     ubuntu-latest: linux
@@ -16,6 +15,6 @@ PLATFORM =
 
 [testenv]
 commands = pytest -v --cov=./ --cov-report=xml
-deps = 
+deps =
     pytest-cov  # https://pytest-cov.readthedocs.io/en/latest/
-    pytest  # https://docs.pytest.org/en/latest/contents.html
\ No newline at end of file
+    pytest  # https://docs.pytest.org/en/latest/contents.html


Test patch:
diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml
index 6875bed..d8ad8e8 100644
--- a/.github/workflows/test_and_deploy.yml
+++ b/.github/workflows/test_and_deploy.yml
@@ -33,10 +33,10 @@ jobs:
     steps:
       - uses: actions/checkout@v3
 
-      - name: Set up Python ${{ matrix.python-version }}
+      - name: Set up Python ${{ matrix.python }}
         uses: actions/setup-python@v4
         with:
-          python-version: ${{ matrix.python-version }}
+          python-version: ${{ matrix.python }}
 
       # these libraries enable testing Qt on Linux
       - uses: tlambert03/setup-qt-libs@v1
@@ -44,9 +44,8 @@ jobs:
       - name: Install dependencies
         run: |
           python -m pip install --upgrade pip
-          python -m pip install setuptools tox tox-gh-actions
-          # python -m pip install .[all,testing]  # use when adding test deps
-          python -m pip install .
+          python -m pip install tox-gh-actions
+          python -m pip install .[dev,testing]
 
       - name: Test with tox
         run: tox
@@ -72,13 +71,12 @@ jobs:
       - name: Install dependencies
         run: |
           python -m pip install --upgrade pip
-          python -m pip install setuptools setuptools_scm build wheel
+          python -m pip install .[dev,testing]
 
       - name: Build
         run: |
           git tag
-          # python -m build  # change to this when updating to pyproject.toml
-          python setup.py sdist bdist_wheel
+          python -m build
 
       - name: Publish to PyPI
         uses: pypa/gh-actions-pypi-publish@release/v1