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

drop Python 3.9 and add support for 3.12 #502

Merged
merged 6 commits into from
Aug 29, 2024
Merged

drop Python 3.9 and add support for 3.12 #502

merged 6 commits into from
Aug 29, 2024

Conversation

pmeier
Copy link
Member

@pmeier pmeier commented Aug 29, 2024

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.

@pmeier pmeier added the type: maintenance 🛠️ Day-to-day maintenance tasks label Aug 29, 2024
@pmeier pmeier marked this pull request as ready for review August 29, 2024 18:42
dependencies = [
"aiofiles",
"emoji",
"fastapi",
"httpx",
"importlib_metadata>=4.6; python_version<'3.10'",
Copy link
Member Author

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.

Copy link
Member Author

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.

Comment on lines +34 to +39
class UtcDateTime(types.TypeDecorator):
"""UTC timezone aware datetime type.

This is needed because sqlalchemy.types.DateTime(timezone=True) does not
consistently store the timezone.
"""
Copy link
Member Author

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)
Copy link
Member Author

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.

Copy link
Contributor

@blakerosenthal blakerosenthal left a 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

@pmeier pmeier merged commit dff37bd into main Aug 29, 2024
24 of 26 checks passed
@pmeier pmeier deleted the up-python branch August 29, 2024 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: maintenance 🛠️ Day-to-day maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants