diff -Nru cmyt-1.1.2/cmyt/__init__.py cmyt-1.1.3/cmyt/__init__.py --- cmyt-1.1.2/cmyt/__init__.py 2022-07-22 13:12:18.000000000 +0000 +++ cmyt-1.1.3/cmyt/__init__.py 2022-12-24 13:22:40.000000000 +0000 @@ -1,3 +1,3 @@ from .cm import * -__version__ = "1.1.2" +__version__ = "1.1.3" diff -Nru cmyt-1.1.2/cmyt/utils.py cmyt-1.1.3/cmyt/utils.py --- cmyt-1.1.2/cmyt/utils.py 2022-07-22 13:12:18.000000000 +0000 +++ cmyt-1.1.3/cmyt/utils.py 2022-12-24 13:22:40.000000000 +0000 @@ -11,7 +11,6 @@ import matplotlib import numpy as np -from colorspacious import cspace_converter from matplotlib.colors import Colormap from matplotlib.colors import LinearSegmentedColormap from more_itertools import always_iterable @@ -122,12 +121,15 @@ graySCALE_CONVERSION_SPACE = "JCh" -_sRGB1_to_JCh = cspace_converter("sRGB1", graySCALE_CONVERSION_SPACE) -_JCh_to_sRGB1 = cspace_converter(graySCALE_CONVERSION_SPACE, "sRGB1") def to_grayscale(sRGB1: np.ndarray) -> np.ndarray: # this is adapted from viscm 0.8 + from colorspacious import cspace_converter + + _sRGB1_to_JCh = cspace_converter("sRGB1", graySCALE_CONVERSION_SPACE) + _JCh_to_sRGB1 = cspace_converter(graySCALE_CONVERSION_SPACE, "sRGB1") + JCh = _sRGB1_to_JCh(sRGB1) JCh[..., 1] = 0 return np.clip(_JCh_to_sRGB1(JCh), 0, 1) diff -Nru cmyt-1.1.2/debian/changelog cmyt-1.1.3/debian/changelog --- cmyt-1.1.2/debian/changelog 2022-07-29 10:49:35.000000000 +0000 +++ cmyt-1.1.3/debian/changelog 2022-12-29 09:43:38.000000000 +0000 @@ -1,3 +1,14 @@ +cmyt (1.1.3-1) unstable; urgency=medium + + * New upstream version 1.1.3 + * Rediff patches + * Push Standards-Version to 4.6.2. No changes + * Build-Depend on pybuild-plugin-pyproject + * Fix Vcs URL + * Use Debian Astro Team as maintainer; add Python team as uploader + + -- Ole Streicher Thu, 29 Dec 2022 10:43:38 +0100 + cmyt (1.1.2-1) unstable; urgency=medium * New upstream version 1.1.2 diff -Nru cmyt-1.1.2/debian/control cmyt-1.1.3/debian/control --- cmyt-1.1.2/debian/control 2022-07-20 14:14:05.000000000 +0000 +++ cmyt-1.1.3/debian/control 2022-12-29 09:43:11.000000000 +0000 @@ -1,9 +1,11 @@ Source: cmyt -Maintainer: Debian Python Team -Uploaders: Ole Streicher +Maintainer: Debian Astro Team +Uploaders: Ole Streicher , + Debian Python Team Section: python Priority: optional Build-Depends: debhelper-compat (= 13), + pybuild-plugin-pyproject, python3-setuptools, python3-all (>= 3.8), dh-python, @@ -12,8 +14,8 @@ python3-more-itertools (>= 8.4), python3-numpy, python3-pytest (>=6.2.4) -Standards-Version: 4.6.1 -Vcs-Browser: https://salsa.debian.org/debian-astrop-team/cmyt +Standards-Version: 4.6.2 +Vcs-Browser: https://salsa.debian.org/debian-astro-team/cmyt Vcs-Git: https://salsa.debian.org/debian-astro-team/cmyt.git Homepage: https://github.com/yt-project/cmyt Rules-Requires-Root: no diff -Nru cmyt-1.1.2/debian/patches/Skip-mpl_compare-tests.patch cmyt-1.1.3/debian/patches/Skip-mpl_compare-tests.patch --- cmyt-1.1.2/debian/patches/Skip-mpl_compare-tests.patch 2022-07-29 10:49:19.000000000 +0000 +++ cmyt-1.1.3/debian/patches/Skip-mpl_compare-tests.patch 2022-12-29 09:32:37.000000000 +0000 @@ -5,12 +5,12 @@ These tests are unreliable, as noted in the pytest_mpl README. See https://github.com/yt-project/cmyt/issues/65 --- - tests/test_integration.py | 7 ++----- + tests/test_integration.py | 6 +----- tests/test_utils.py | 5 +---- - 2 files changed, 3 insertions(+), 9 deletions(-) + 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/tests/test_integration.py b/tests/test_integration.py -index 2e18941..0945e63 100644 +index 2e18941..e366f51 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -6,11 +6,7 @@ import cmyt @@ -26,14 +26,6 @@ @pytest.fixture() -@@ -27,6 +23,7 @@ def example_data(): - @pytest.mark.parametrize("name", cmyt_cmaps) - def test_from_str(name, example_data): - fig, axes = plt.subplots(ncols=2, figsize=(12, 4)) -+ print(fig.dpi, fig.get_size_inches()) - pname = prefix_name(name) - for cmap, ax in zip([pname, f"{pname}_r"], axes): - ax.set_title(cmap) diff --git a/tests/test_utils.py b/tests/test_utils.py index 989021d..4ed473f 100644 --- a/tests/test_utils.py diff -Nru cmyt-1.1.2/.github/workflows/bleeding-edge.yaml cmyt-1.1.3/.github/workflows/bleeding-edge.yaml --- cmyt-1.1.2/.github/workflows/bleeding-edge.yaml 2022-07-22 13:12:18.000000000 +0000 +++ cmyt-1.1.3/.github/workflows/bleeding-edge.yaml 2022-12-24 13:22:40.000000000 +0000 @@ -9,13 +9,13 @@ on: push: branches: - - main + - main pull_request: paths: - - .github/workflows/bleeding-edge.yaml + - .github/workflows/bleeding-edge.yaml schedule: # run this every day at 3 am UTC - - cron: '0 3 * * *' + - cron: 0 3 * * * workflow_dispatch: jobs: @@ -32,7 +32,7 @@ - name: Set up Python Dev Version uses: actions/setup-python@v4 with: - python-version: '3.11-dev' + python-version: 3.11-dev - name: Install dependencies run: | diff -Nru cmyt-1.1.2/.github/workflows/cd.yml cmyt-1.1.3/.github/workflows/cd.yml --- cmyt-1.1.2/.github/workflows/cd.yml 2022-07-22 13:12:18.000000000 +0000 +++ cmyt-1.1.3/.github/workflows/cd.yml 2022-12-24 13:22:40.000000000 +0000 @@ -1,24 +1,28 @@ name: CD on: push: - tags: 'v*' + tags: v* + pull_request: + paths: + - .github/workflows/cd.yml jobs: publish: - runs-on: 'ubuntu-latest' + runs-on: ubuntu-latest steps: - - name: Checkout Source - uses: actions/checkout@v3 - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: Install build dependencies - run: python3 -m pip install build wheel - - name: Build distributions - shell: bash -l {0} - run: python setup.py sdist bdist_wheel - - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@v1.4.2 - with: - user: __token__ - password: ${{ secrets.pypi_token }} + - name: Checkout Source + uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Install build dependencies + run: python -m pip install build wheel + - name: Build distributions + shell: bash -l {0} + run: python -m build + - name: Publish package to PyPI + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') + uses: pypa/gh-action-pypi-publish@v1.6.4 + with: + user: __token__ + password: ${{ secrets.pypi_token }} diff -Nru cmyt-1.1.2/.github/workflows/ci.yml cmyt-1.1.3/.github/workflows/ci.yml --- cmyt-1.1.2/.github/workflows/ci.yml 2022-07-22 13:12:18.000000000 +0000 +++ cmyt-1.1.3/.github/workflows/ci.yml 2022-12-24 13:22:40.000000000 +0000 @@ -2,33 +2,34 @@ on: pull_request: paths-ignore: - - "**/*.md" + - '**/*.md' push: branches: - - main + - main schedule: - - cron: '0 3 * * *' + - cron: 0 3 * * * jobs: tests: strategy: matrix: - os: [ubuntu-latest] - python-version: [ - "3.8", - "3.9", - '3.10', - ] + os: + - ubuntu-latest + python-version: + - '3.8' + - '3.9' + - '3.10' + - '3.11' include: # only test oldest and most recent Python on other platforms - - os: macos-latest - python-version: '3.8' - - os: macos-latest - python-version: '3.10' - - os: windows-latest - python-version: '3.8' - - os: windows-latest - python-version: '3.10' + - os: macos-latest + python-version: '3.8' + - os: macos-latest + python-version: '3.11' + - os: windows-latest + python-version: '3.8' + - os: windows-latest + python-version: '3.11' runs-on: ${{ matrix.os }} steps: - name: Checkout Source @@ -60,9 +61,10 @@ python-version: '3.8' - name: Setup package run: | - python3 -m pip install --upgrade pip - python tests/scripts/hardpin_minimal_dependencies.py - python3 -m pip install -e .[dev] + python -m pip install --upgrade pip + python -m pip install tomli tomli_w + python scripts/hardpin_minimal_dependencies.py + python -m pip install -e .[dev] - name: Run test suite run: pytest diff -Nru cmyt-1.1.2/.pre-commit-config.yaml cmyt-1.1.3/.pre-commit-config.yaml --- cmyt-1.1.2/.pre-commit-config.yaml 2022-07-22 13:12:18.000000000 +0000 +++ cmyt-1.1.3/.pre-commit-config.yaml 2022-12-24 13:22:40.000000000 +0000 @@ -1,57 +1,57 @@ ci: - autofix_prs: true - autoupdate_schedule: "quarterly" + autofix_prs: true + autoupdate_schedule: quarterly repos: -- repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.20.1 - hooks: - - id: setup-cfg-fmt -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 - hooks: - - id: trailing-whitespace - - id: end-of-file-fixer - - id: no-commit-to-branch - - id: check-merge-conflict - - id: check-yaml - - id: check-executables-have-shebangs - - id: check-shebang-scripts-are-executable -- repo: https://github.com/asottile/pyupgrade - rev: v2.34.0 - hooks: - - id: pyupgrade - args: [--py38-plus] -- repo: https://github.com/asottile/reorder_python_imports - rev: v3.3.0 - hooks: - - id: reorder-python-imports -- repo: https://github.com/psf/black - rev: 22.6.0 - hooks: - - id: black - language_version: python3 -- repo: https://github.com/PyCQA/flake8 - rev: '4.0.1' - hooks: - - id: flake8 - additional_dependencies: [ - flake8-bugbear>=20.3.2, - ] -- repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.961 - hooks: - - id: mypy - additional_dependencies: [ - 'numpy>=1.20', - 'matplotlib>=3.4', - ] -- repo: https://github.com/asottile/blacken-docs - rev: v1.12.1 - hooks: - - id: blacken-docs - additional_dependencies: [black==21.6b0] -- repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.9.0 - hooks: - - id: rst-backticks +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: no-commit-to-branch + - id: check-merge-conflict + - id: check-executables-have-shebangs + - id: check-shebang-scripts-are-executable + - id: check-merge-conflict + - id: debug-statements +- repo: https://github.com/asottile/pyupgrade + rev: v2.38.2 + hooks: + - id: pyupgrade + args: [--py38-plus] +- repo: https://github.com/asottile/reorder_python_imports + rev: v3.8.3 + hooks: + - id: reorder-python-imports +- repo: https://github.com/psf/black + rev: 22.8.0 + hooks: + - id: black + language_version: python3 +- repo: https://github.com/PyCQA/flake8 + rev: 5.0.4 + hooks: + - id: flake8 + additional_dependencies: [flake8-bugbear==22.7.1] +- repo: https://github.com/pre-commit/mirrors-mypy + rev: v0.981 + hooks: + - id: mypy + additional_dependencies: [numpy>=1.20, matplotlib>=3.4] +- repo: https://github.com/asottile/blacken-docs + rev: v1.12.1 + hooks: + - id: blacken-docs + additional_dependencies: [black==22.6.0] +- repo: https://github.com/pre-commit/pygrep-hooks + rev: v1.9.0 + hooks: + - id: rst-backticks + +- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks + rev: v2.4.0 + hooks: + - id: pretty-format-yaml + args: [--autofix, --indent, '2'] + - id: pretty-format-toml + args: [--autofix] diff -Nru cmyt-1.1.2/pyproject.toml cmyt-1.1.3/pyproject.toml --- cmyt-1.1.2/pyproject.toml 2022-07-22 13:12:18.000000000 +0000 +++ cmyt-1.1.3/pyproject.toml 2022-12-24 13:22:40.000000000 +0000 @@ -1,25 +1,67 @@ [build-system] requires = [ - "setuptools >= 40.9.0", - "wheel", + "setuptools>=61.2", ] build-backend = "setuptools.build_meta" +[project] +name = "cmyt" +version = "1.1.3" +description = "A collection of Matplotlib colormaps from the yt project" +authors = [ + { name = "The yt project", email = "yt-dev@python.org" }, +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Framework :: Matplotlib", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Operating System :: MacOS :: MacOS X", + "Operating System :: POSIX :: AIX", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Topic :: Scientific/Engineering :: Visualization", + "Typing :: Typed", +] +keywords = [ + "visualization", +] +requires-python = ">=3.8" +dependencies = [ + "colorspacious>=1.1.2", + "matplotlib>=3.2.0", + "more-itertools>=8.4", + "numpy>=1.17.4", +] + +[project.license] +text = "BSD 3-Clause" + +[project.optional-dependencies] +dev = [ + "pytest>=6.2.4", + "pytest-cov>=2.12.1", + "pytest-mpl>=0.13", +] + +[project.readme] +file = "README.md" +content-type = "text/markdown" + +[project.urls] +Homepage = "https://yt-project.org/" +Source = "https://github.com/yt-project/cmyt/" +Tracker = "https://github.com/yt-project/cmyt/issues" + [tool.black] line-length = 88 target-version = [ - 'py37', 'py38', 'py39', + 'py310', ] -[tool.pytest.ini_options] -filterwarnings = [ - "error", -] -addopts = "--doctest-modules" - - [tool.mypy] python_version = "3.8" warn_unused_configs = true @@ -29,8 +71,23 @@ show_error_codes = true disallow_untyped_defs = true - [[tool.mypy.overrides]] module = "tests.*" disallow_untyped_defs = true ignore_errors = true + +[tool.pytest.ini_options] +filterwarnings = [ + "error", +] +addopts = "--doctest-modules" +testpaths = ["tests"] + +[tool.setuptools] +license-files = [ + "LICENSE", +] +include-package-data = false + +[tool.setuptools.packages.find] +namespaces = false diff -Nru cmyt-1.1.2/README.md cmyt-1.1.3/README.md --- cmyt-1.1.2/README.md 2022-07-22 13:12:18.000000000 +0000 +++ cmyt-1.1.3/README.md 2022-12-24 13:22:40.000000000 +0000 @@ -2,7 +2,7 @@ [![PyPI](https://img.shields.io/pypi/v/cmyt.svg?logo=pypi&logoColor=white&label=PyPI)](https://pypi.org/project/cmyt) [![Conda Version](https://img.shields.io/conda/vn/conda-forge/cmyt.svg?logo=condaforge&logoColor=white)](https://anaconda.org/conda-forge/cmyt) -[![Supported Python Versions](https://img.shields.io/pypi/pyversions/cmyt?v1.1.2&logo=python&logoColor=white&label=Python)](https://pypi.org/project/cmyt/) +[![Supported Python Versions](https://img.shields.io/badge/requires-Python%20≥%203.8-blue?logo=python&logoColor=white)](https://pypi.org/project/cmyt/) [![CI](https://github.com/yt-project/cmyt/actions/workflows/ci.yml/badge.svg)](https://github.com/yt-project/cmyt/actions/workflows/ci.yml) [![CI (bleeding edge)](https://github.com/yt-project/cmyt/actions/workflows/bleeding-edge.yaml/badge.svg)](https://github.com/yt-project/cmyt/actions/workflows/bleeding-edge.yaml) @@ -59,7 +59,7 @@ prng = np.random.RandomState(0x4D3D3D3) noise = prng.random_sample((100, 100)) x, y = np.mgrid[-50:50, -50:50] -z = 5 * np.exp(-(x ** 2 + y ** 2) / 1000) +z = 5 * np.exp(-(x**2 + y**2) / 1000) # setup the figure fig, ax = plt.subplots() diff -Nru cmyt-1.1.2/scripts/hardpin_minimal_dependencies.py cmyt-1.1.3/scripts/hardpin_minimal_dependencies.py --- cmyt-1.1.2/scripts/hardpin_minimal_dependencies.py 1970-01-01 00:00:00.000000000 +0000 +++ cmyt-1.1.3/scripts/hardpin_minimal_dependencies.py 2022-12-24 13:22:40.000000000 +0000 @@ -0,0 +1,43 @@ +#!/usr/bin/env python3 +import sys + +if sys.version_info >= (3, 11): + import tomllib +else: + import tomli as tomllib + +import tomli_w + +import re +from collections.abc import MutableMapping + + +def hardpin(s: str) -> str: + sep = re.search("(>|=|<|~)", s) + if sep is None: + return s + sep_idx = sep.span()[0] + name, specs = s[:sep_idx], s[sep_idx:] + + for spec in specs.split(","): + if ">=" in specs: + min_ver = spec.strip().lstrip(">=") + break + else: + raise RuntimeError(f"Couldn't determine mininal specification from '{s}'") + return f"{name}=={min_ver}" + + +def hardpin_mapping(m: MutableMapping, key: str) -> None: + m[key] = [hardpin(_) for _ in m[key]] + + +if __name__ == "__main__": + with open("pyproject.toml", "rb") as fh: + conf = tomllib.load(fh) + hardpin_mapping(conf["project"], "dependencies") + for target in conf["project"]["optional-dependencies"]: + hardpin_mapping(conf["project"]["optional-dependencies"], target) + + with open("pyproject.toml", "wb") as fhw: + tomli_w.dump(conf, fhw) diff -Nru cmyt-1.1.2/setup.cfg cmyt-1.1.3/setup.cfg --- cmyt-1.1.2/setup.cfg 2022-07-22 13:12:18.000000000 +0000 +++ cmyt-1.1.3/setup.cfg 2022-12-24 13:22:40.000000000 +0000 @@ -1,50 +1,3 @@ -[metadata] -name = cmyt -version = 1.1.2 -description = A collection of Matplotlib colormaps from the yt project -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/yt-project/yt -author = The yt project -author_email = yt-dev@python.org -license = BSD 3-Clause -license_file = LICENSE -classifiers = - Development Status :: 5 - Production/Stable - Framework :: Matplotlib - Intended Audience :: Science/Research - License :: OSI Approved :: BSD License - Operating System :: MacOS :: MacOS X - Operating System :: POSIX :: AIX - Operating System :: POSIX :: Linux - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Topic :: Scientific/Engineering :: Visualization - Typing :: Typed -keywords = visualization -project_urls = - Homepage=https://yt-project.org/ - Source=https://github.com/yt-project/cmyt/ - Tracker=https://github.com/yt-project/cmyt/issues - -[options] -packages = find: -install_requires = - colorspacious>=1.1.2 - matplotlib>=3.2.0 - more-itertools>=8.4 - numpy>=1.17.4 -python_requires = >=3.8 - -[options.extras_require] -dev = - pytest>=6.2.4 - pytest-cov>=2.12.1 - pytest-mpl>=0.13 - [flake8] ignore = E203, # Whitespace before ':' E501, # Line too long diff -Nru cmyt-1.1.2/setup.py cmyt-1.1.3/setup.py --- cmyt-1.1.2/setup.py 2022-07-22 13:12:18.000000000 +0000 +++ cmyt-1.1.3/setup.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -from setuptools import setup - -setup() diff -Nru cmyt-1.1.2/tests/scripts/hardpin_minimal_dependencies.py cmyt-1.1.3/tests/scripts/hardpin_minimal_dependencies.py --- cmyt-1.1.2/tests/scripts/hardpin_minimal_dependencies.py 2022-07-22 13:12:18.000000000 +0000 +++ cmyt-1.1.3/tests/scripts/hardpin_minimal_dependencies.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -#!/usr/bin/env python3 -import configparser -import io -import re -from collections.abc import MutableMapping - - -def hardpin(s: str) -> str: - sep = re.search("(>|=|<|~)", s) - if sep is None: - return s - sep_idx = sep.span()[0] - name, specs = s[:sep_idx], s[sep_idx:] - - for spec in specs.split(","): - if ">=" in specs: - min_ver = spec.strip().lstrip(">=") - break - else: - raise RuntimeError(f"Couldn't determine mininal specification from '{s}'") - return f"{name}=={min_ver}" - - -def hardpin_mapping(m: MutableMapping, key: str) -> None: - reqs = m[key].split("\n") - m[key] = "\n".join(hardpin(_) for _ in reqs) - - -if __name__ == "__main__": - cp = configparser.ConfigParser() - cp.read("setup.cfg") - hardpin_mapping(cp["options"], "install_requires") - for target in cp["options.extras_require"].keys(): - hardpin_mapping(cp["options.extras_require"], target) - - output = io.StringIO() - cp.write(output) - s = output.getvalue().replace("\t", " " * 4) - s = "\n".join(_.rstrip() for _ in s.split("\n")) - with open("setup.cfg", "w") as fh: - fh.write(s)