Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
Drop Python 3.9 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Stoops committed Nov 27, 2024
1 parent deb29dc commit 1b4ead7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
python-version: ['3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand Down
7 changes: 2 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ select = [
[tool.tox]
legacy_tox_ini = """
[tox]
envlist = quality, test, pypy, pypy3, py{39,310,311,312,313}
envlist = quality, test, pypy, pypy3, py{310,311,312,313}
[gh-actions]
python =
3.9: py39
3.10: py310
3.11: py311, quality, test, pypy, pypy3
3.12: py312
Expand All @@ -27,7 +26,6 @@ legacy_tox_ini = """
basepython =
pypy: {env:PYTHON:pypy}
pypy3: {env:PYTHON:pypy3}
py39: {env:PYTHON:python3.9}
py310: {env:PYTHON:python3.10}
py311: {env:PYTHON:python3.11}
py312: {env:PYTHON:python3.12}
Expand Down Expand Up @@ -77,7 +75,7 @@ authors = [
]
description = "Python 3 library to write CZML"
readme = "README.rst"
requires-python = ">=3.9"
requires-python = ">=3.10"
keywords = ["czml", "cesium", "orbits"]
license = {text = "MIT"}
classifiers = [
Expand All @@ -87,7 +85,6 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
Expand Down
2 changes: 0 additions & 2 deletions src/czml3/common.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import annotations

import datetime as dt

from pydantic import BaseModel, field_validator
Expand Down
2 changes: 0 additions & 2 deletions src/czml3/core.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import annotations

from typing import Any
from uuid import uuid4

Expand Down
10 changes: 5 additions & 5 deletions src/czml3/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,29 @@ def get_color(color):
"""Determines if the input is a valid color"""
if color is None or (
isinstance(color, list)
and all(issubclass(type(v), (int, float)) for v in color)
and all(issubclass(type(v), int | float) for v in color)
and len(color) == 4
and (all(0 <= v <= 255 for v in color) or all(0 <= v <= 1 for v in color))
):
return color
elif (
isinstance(color, list)
and all(issubclass(type(v), (int, float)) for v in color)
and all(issubclass(type(v), int | float) for v in color)
and len(color) == 3
and all(0 <= v <= 255 for v in color)
):
return color + [255]
# rgbf or rgbaf
# if (
# isinstance(color, list)
# and all(issubclass(type(v), (int, float)) for v in color)
# and all(issubclass(type(v), int | float) for v in color)
# and (3 <= len(color) <= 4)
# and not all(0 <= v <= 1 for v in color)
# ):
# raise TypeError("RGBF or RGBAF values must be between 0 and 1")
elif (
isinstance(color, list)
and all(issubclass(type(v), (int, float)) for v in color)
and all(issubclass(type(v), int | float) for v in color)
and len(color) == 3
and all(0 <= v <= 1 for v in color)
):
Expand Down Expand Up @@ -571,6 +571,6 @@ class NumberValue(BaseCZMLObject):

@model_serializer
def custom_serializer(self):
if isinstance(self.values, (int, float)):
if isinstance(self.values, int | float):
return {"number": self.values}
return {"number": list(self.values)}

0 comments on commit 1b4ead7

Please sign in to comment.