-
Notifications
You must be signed in to change notification settings - Fork 22
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
drop Python 3.9 and add support for 3.12 #502
Conversation
dependencies = [ | ||
"aiofiles", | ||
"emoji", | ||
"fastapi", | ||
"httpx", | ||
"importlib_metadata>=4.6; python_version<'3.10'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer needed, since we at least have 3.10 and thus don't need a backport of importlib.metadata
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole file is no longer needed, since all compatibility functions we had in there are natively supported by Python 3.10 and upwards.
class UtcDateTime(types.TypeDecorator): | ||
"""UTC timezone aware datetime type. | ||
|
||
This is needed because sqlalchemy.types.DateTime(timezone=True) does not | ||
consistently store the timezone. | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per class docstring.
@@ -75,7 +85,7 @@ class Message(BaseModel): | |||
content: str | |||
role: ragna.core.MessageRole | |||
sources: list[Source] = Field(default_factory=list) | |||
timestamp: datetime.datetime = Field(default_factory=datetime.datetime.utcnow) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
datetime.datetime.utcnow
is deprecated starting with Python 3.12 and thus I refactored this whole thing to be timezone aware.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, works great for me on 3.12
panel==1.5.*
, i.e. the next minor version, drops support for Python 3.9. As we'll need to upgrade at some point, we also do the switch now. In addition, this also adds support for Python 3.12 so we still have three compatible versions.