diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c2c07fa..41d0076 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,8 @@ jobs: - {name: Windows, python: '3.10', os: windows-latest} - {name: Mac, python: '3.10', os: macos-latest} - {name: 'Ubuntu', python: '3.10', os: ubuntu-latest} - - {name: '3.11', python: '3.11.0-rc.2 - 3.11', os: ubuntu-latest} + - {name: '3.12', python: '3.12', os: ubuntu-latest} + - {name: '3.11', python: '3.11', os: ubuntu-latest} - {name: '3.9', python: '3.9', os: ubuntu-latest} - {name: '3.8', python: '3.8', os: ubuntu-latest} diff --git a/color_operations/colorspace.pyx b/color_operations/colorspace.pyx index 3130c26..b101238 100644 --- a/color_operations/colorspace.pyx +++ b/color_operations/colorspace.pyx @@ -65,7 +65,7 @@ cdef enum: cpdef convert(double one, double two, double three, src, dst): cdef color color - if src not in ColorSpace or dst not in ColorSpace: + if ColorSpace(src) not in ColorSpace or ColorSpace(dst) not in ColorSpace: raise ValueError("Invalid colorspace") color = _convert(one, two, three, int(src), int(dst)) diff --git a/pyproject.toml b/pyproject.toml index 23a1d56..5008a7f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ requires = [ "setuptools", "wheel", - "cython==0.29.32", + "cython>=0.29.32", "oldest-supported-numpy", ] diff --git a/tests/test_colorspace.py b/tests/test_colorspace.py index bf9b65f..b5f8c29 100644 --- a/tests/test_colorspace.py +++ b/tests/test_colorspace.py @@ -203,13 +203,13 @@ def test_array_bad_colorspace(): def test_bad_colorspace_string(): """String colorspaces raise ValueError""" - with pytest.raises(TypeError): + with pytest.raises(ValueError): convert(0.1, 0.1, 0.1, src="FOO", dst="RGB") def test_bad_colorspace_invalid_int(): """Invalid colorspace integers raise ValueError""" - with pytest.raises(TypeError): + with pytest.raises(ValueError): convert(0.1, 0.1, 0.1, src=999, dst=999)