-
Notifications
You must be signed in to change notification settings - Fork 43
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
Get backend working with Python 3.12 #876
Conversation
WalkthroughThe changes reflect an update to support Python 3.12.1, including modifying the Python version in configuration files and adjusting code to use the Changes
Related issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Review Status
Actionable comments generated: 1
Configuration used: .coderabbit.yaml
Files ignored due to filter (2)
- spiffworkflow-backend/poetry.lock
- spiffworkflow-backend/pyproject.toml
Files selected for processing (3)
- .github/workflows/tests.yml (3 hunks)
- spiffworkflow-backend/.tool-versions (1 hunks)
- spiffworkflow-backend/src/spiffworkflow_backend/services/file_system_service.py (2 hunks)
Files skipped from review due to trivial changes (1)
- spiffworkflow-backend/.tool-versions
Additional comments: 6
spiffworkflow-backend/src/spiffworkflow_backend/services/file_system_service.py (1)
- 6-6: The addition of the
timezone
import from thedatetime
module is consistent with the PR's objective to handle timezone-aware datetimes in Python 3.12..github/workflows/tests.yml (5)
19-20: New test sessions for Python 3.12 with
safety
andmypy
checks have been added. This is in line with the PR's objective to ensure compatibility with Python 3.12.31-37: New test sessions for Python 3.12 with MySQL database have been added. The configuration appears correct and includes the
upload_coverage
flag.44-49: New test sessions for Python 3.12 with PostgreSQL database have been added. The configuration is consistent with the existing test setup for other Python versions.
56-61: New test sessions for Python 3.12 with SQLite database have been added. The configuration is consistent with the existing test setup for other Python versions.
92-100: New test sessions for Python 3.12 with
typeguard
have been added. The comment abouttypeguard 2.13.3
being broken withTypeDict
in Python 3.11 is informative, but it might be beneficial to check if this issue persists in Python 3.12 or if it has been resolved.
spiffworkflow-backend/src/spiffworkflow_backend/services/file_system_service.py
Outdated
Show resolved
Hide resolved
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.
Review Status
Actionable comments generated: 0
Configuration used: .coderabbit.yaml
Files selected for processing (1)
- spiffworkflow-backend/src/spiffworkflow_backend/services/file_system_service.py (2 hunks)
Additional comments: 2
spiffworkflow-backend/src/spiffworkflow_backend/services/file_system_service.py (2)
6-6: The import of
timezone
from thedatetime
module is correct and necessary for the subsequent changes in the file to handle timezone-aware datetime objects in Python 3.12.226-226: The change from
datetime.utcfromtimestamp
todatetime.fromtimestamp
withtimezone.utc
is correct and aligns with the Python 3.12 update for timezone-aware datetime objects. This change ensures that the timestamps are correctly handled as UTC.
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.
Review Status
Actionable comments generated: 2
Configuration used: .coderabbit.yaml
Files ignored due to filter (2)
- spiffworkflow-backend/poetry.lock
- spiffworkflow-backend/pyproject.toml
Files selected for processing (1)
- .github/workflows/tests.yml (3 hunks)
Additional comments: 1
.github/workflows/tests.yml (1)
- 28-64: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [19-61]
The addition of Python 3.12 test configurations for different databases and sessions is consistent with the PR objectives to ensure compatibility with Python 3.12. It's important to verify that these new configurations work as expected and that the tests pass for Python 3.12.
Verification successful
The grep command confirmed the presence of Python 3.12 configurations in the
.github/workflows/tests.yml
file, which aligns with the PR objectives and the AI-generated summary. However, the attempt to execute./run_tests.sh
was not successful because the file does not exist in the repository's root directory. This part of the script was a placeholder and not an actual command to run tests. The verification of the workflow file changes is complete, and the review comment is consistent with the changes made in the PR.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify that the new test configurations for Python 3.12 are working correctly. # This script assumes that the test suite can be run locally or in a CI environment. # Replace `./run_tests.sh` with the actual command to run the tests. # Check for Python 3.12 test configurations grep -E 'python: "3.12"' .github/workflows/tests.yml # Run the tests for Python 3.12 configurations # This is a placeholder command and should be replaced with the actual test command. ./run_tests.sh --python-version="3.12"Length of output: 444
- { | ||
# typeguard 2.13.3 is broken with TypeDict in 3.11. | ||
# probably the next release fixes it. | ||
# https://github.com/agronholm/typeguard/issues/242 | ||
python: "3.12", | ||
os: "ubuntu-latest", | ||
session: "typeguard", | ||
database: "sqlite", | ||
} |
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.
The comments regarding the typeguard
issue with Python 3.11 are still present in the Python 3.12 configuration. If the issue with typeguard
has been resolved in Python 3.12, these comments should be updated or removed to avoid confusion.
The comments about typeguard
being broken with TypeDict
in Python 3.11 are copied to the Python 3.12 section. If this issue persists in Python 3.12, the comment is valid; otherwise, it should be updated or removed to reflect the current state.
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, thank you
Work on #871
Fair amount of dependency updates needed to get the backend to launch and pass tests with Python 3.12:
Update greenlet to 3.0.3
Update pyyaml to 6.0.1
Update libxml to 4.9.4
Update APScheduler to 3.10.4
Update sentry_sdk to 1.39.2
Update dateparser to 1.2.0
Update pytz to 2023.3.post1
Update types-dateparser to 1.1.4.20240106
dateutil
has an open issue for the DepreactionWarning that is filtered out - dateutil/dateutil#1314Also fixed one instance of the deprecation warning in
FileSystemService
.Summary by CodeRabbit
New Features
Tests