From 5bc4e3fdc599e7ce30ee8e67323f1590f54a71eb Mon Sep 17 00:00:00 2001 From: Josh Moore Date: Wed, 17 Jan 2024 10:42:42 +0100 Subject: [PATCH 1/5] Move from setup.py to pyproject.toml --- .bumpversion.cfg | 20 ---------------- pyproject.toml | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 55 ------------------------------------------ 3 files changed, 62 insertions(+), 75 deletions(-) delete mode 100644 .bumpversion.cfg create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/.bumpversion.cfg b/.bumpversion.cfg deleted file mode 100644 index a1c533f6..00000000 --- a/.bumpversion.cfg +++ /dev/null @@ -1,20 +0,0 @@ -[bumpversion] -current_version = 0.8.4.dev0 -commit = True -tag = True -sign_tags = True -parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\.(?P[a-z]+)(?P\d+))? -serialize = - {major}.{minor}.{patch}.{release}{build} - {major}.{minor}.{patch} - -[bumpversion:part:release] -optional_value = prod -first_value = dev -values = - dev - prod - -[bumpversion:part:build] - -[bumpversion:file:setup.py] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..702065c9 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,62 @@ +[build-system] +requires = [ + "setuptools>=60", + "setuptools-scm>=8.0", +] + +[tools.setuptools.dynamic] +version = {attr = "ome_zarr.__version__"} + +[project] +name = "ome-zarr" +readme = "README.rst" +dynamic = ["version"] +description="Implementation of images in Zarr files." + +requires-python = ">3.8" + +dependencies = [ + "dataclasses;python_version<'3.7'", + "tifffile<2020.09.22;python_version<'3.7'", + "numpy", + "dask", + "distributed", + "zarr>=2.8.1", + "fsspec[s3]>=0.8,!=2021.07.0,<2023.09.0", + # See https://github.com/fsspec/filesystem_spec/issues/819 + "aiohttp<4", + "requests", + "scikit-image", + "toolz", +] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "Topic :: Software Development :: Libraries :: Python Modules", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Operating System :: OS Independent", + "License :: OSI Approved :: BSD License", +] + +authors = [ + {name = "The Open Microscopy Team"}, +] + +[project.entry-points."console_scripts"] +ome_zarr = "ome_zarr.cli:main" + +[project.optional-dependencies] +tests = [ + "pytest", +] + +[project.urls] +Documentation = "https://ome-zarr.readthedocs.io" +Repository = "https://github.com/ome/ome-zarr-py" +Changelog = "https://github.com/ome/ome-zarr-py/blob/master/CHANGELOG.md" + +[tool.setuptools] +packages = ["ome_zarr"] +py-modules = ["ome_zarr"] diff --git a/setup.py b/setup.py deleted file mode 100644 index 87285aac..00000000 --- a/setup.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python - -import codecs -import os -from typing import List - -from setuptools import setup - - -def read(fname): - file_path = os.path.join(os.path.dirname(__file__), fname) - return codecs.open(file_path, encoding="utf-8").read() - - -install_requires: List[List[str]] = [] -install_requires += (["dataclasses;python_version<'3.7'"],) -install_requires += (["tifffile<2020.09.22;python_version<'3.7'"],) -install_requires += (["numpy"],) -install_requires += (["dask"],) -install_requires += (["distributed"],) -install_requires += (["zarr>=2.8.1"],) -install_requires += (["fsspec[s3]>=0.8,!=2021.07.0,!=2023.09.0"],) -# See https://github.com/fsspec/filesystem_spec/issues/819 -install_requires += (["aiohttp<4"],) -install_requires += (["requests"],) -install_requires += (["scikit-image"],) -install_requires += (["toolz"],) - - -setup( - name="ome-zarr", - version="0.8.4.dev0", - author="The Open Microscopy Team", - url="https://github.com/ome/ome-zarr-py", - description="Implementation of images in Zarr files.", - long_description=read("README.rst"), - packages=["ome_zarr"], - py_modules=["ome_zarr"], - python_requires=">=3.6", - install_requires=install_requires, - classifiers=[ - "Development Status :: 4 - Beta", - "Intended Audience :: Developers", - "Intended Audience :: Science/Research", - "Topic :: Software Development :: Libraries :: Python Modules", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Operating System :: OS Independent", - "License :: OSI Approved :: BSD License", - ], - entry_points={ - "console_scripts": ["ome_zarr = ome_zarr.cli:main"], - }, - tests_require=["pytest"], -) From e930101a6f309bc33e6ede2f816fb6cbad5a7aab Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 10:52:08 +0000 Subject: [PATCH 2/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .isort.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.isort.cfg b/.isort.cfg index fec62009..0f1f7e33 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -1,5 +1,5 @@ [settings] -known_third_party = dask,numcodecs,numpy,pytest,scipy,setuptools,skimage,zarr +known_third_party = dask,numcodecs,numpy,pytest,scipy,skimage,zarr multi_line_output = 3 include_trailing_comma = True force_grid_wrap = 0 From 2fd3552982425897f9ef33552a0e46eba167b62a Mon Sep 17 00:00:00 2001 From: Josh Moore Date: Wed, 17 Jan 2024 11:56:12 +0100 Subject: [PATCH 3/5] Remove reference to setup.py --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ad0889af..c27a84a1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -78,7 +78,7 @@ repos: --disallow-untyped-defs, --ignore-missing-imports, ] - exclude: tests/|setup.py + exclude: tests/ - repo: https://github.com/adrienverge/yamllint.git rev: v1.32.0 From 41f0d037e10e7effef1c268bf7c5e163c6a70f01 Mon Sep 17 00:00:00 2001 From: Josh Moore Date: Wed, 17 Jan 2024 17:51:27 +0100 Subject: [PATCH 4/5] Use 'build' command rather than setup.py --- .github/workflows/publish_pypi.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index 436eafbf..b58f5720 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -11,8 +11,8 @@ jobs: - uses: actions/setup-python@v4 - name: Build a binary wheel and a source tarball run: | - python -mpip install wheel - python setup.py sdist bdist_wheel + python -mpip install wheel build + python -m build - name: Publish distribution to PyPI if: startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@v1.3.0 From edede65c8a745bc357220148f14706e88f49d782 Mon Sep 17 00:00:00 2001 From: Josh Moore Date: Wed, 21 Feb 2024 18:44:15 +0100 Subject: [PATCH 5/5] Drop py27 deps --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9970da5e..c43cd5a5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,8 +16,7 @@ description="Implementation of images in Zarr files." requires-python = ">3.8" dependencies = [ - "dataclasses;python_version<'3.7'", - "tifffile<2020.09.22;python_version<'3.7'", + "tifffile", "numpy", "dask", "distributed",