Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.12 support #5

Merged
merged 3 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading