Skip to content

Commit

Permalink
Merge pull request #5 from mentaljam/py3.12
Browse files Browse the repository at this point in the history
Python 3.12 support
  • Loading branch information
vincentsarago committed Dec 18, 2023
2 parents 1430363 + 84d07b2 commit dfc6c22
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down
2 changes: 1 addition & 1 deletion color_operations/colorspace.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
requires = [
"setuptools",
"wheel",
"cython==0.29.32",
"cython>=0.29.32",
"oldest-supported-numpy",
]

Expand Down
4 changes: 2 additions & 2 deletions tests/test_colorspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit dfc6c22

Please sign in to comment.