Upgrade Python runtime to 3.12 - #554
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
The purpose of this pull request is to upgrade the Python runtime environment from Python 3.10 to Python 3.12 across the project's Docker image, Passenger configuration, CI workflow, and dependencies. Additionally, this PR updates test suites to address deprecations in modern Python versions.
Approach
phusion/passenger-python312:3.2.0and adjusted Passenger and build configurations to use Python 3.12.pandas(to 2.2.3) andnumpy(to 1.26.4) inrequirements.txtto support Python 3.12.assertEqualscalls withassertEqualacross integration and unit test files (sinceassertEqualswas removed in Python 3.12).r'...') to eliminate Python 3.12 syntax/deprecation warnings.Key Modifications
Dockerfile: Upgraded base image fromphusion/passenger-python310:3.2.0tophusion/passenger-python312:3.2.0and updated documentation/comments.vendor/docker/webapp.conf: Setpassenger_pythonto/usr/bin/python3.12..github/workflows/run_tests.yml: Setpython-versionto"3.12".requirements.txt: Updatedpandas(1.4.1->2.2.3) andnumpy(1.22.4->1.26.4).rorapi/tests/tests_integration/tests.py: ReplacedassertEqualswithassertEqual.rorapi/tests/tests_integration/tests_search_v2.py: ReplacedassertEqualswithassertEqual.rorapi/tests/tests_integration/tests_v2.py: ReplacedassertEqualswithassertEqual.rorapi/tests/tests_unit/tests_matching_v2.py: ReplacedassertEqualswithassertEqual.rorapi/tests/tests_unit/tests_queries_v2.py: ReplacedassertEqualswithassertEqualand prefixed escaped strings withr.rorapi/tests/tests_unit/tests_views_v2.py: ReplacedassertEqualswithassertEqual.Important Technical Details
TestCase.assertEqualsalias inunittest, requiring all assertions to useTestCase.assertEqual.SyntaxWarning(and in future versionsSyntaxError) in Python 3.12, necessitating raw string literals (r'...') in regular expressions withintests_queries_v2.py.Types of changes
Reviewer, please remember our guidelines: