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

Update calitp-data-infra package to be compatible with Python 3.11 #3670

Merged
merged 4 commits into from
Jan 30, 2025

Conversation

mjumbewu
Copy link
Contributor

@mjumbewu mjumbewu commented Jan 30, 2025

Description

Updating Python requirement for the package to 3.8 - 3.11. This package is installed in the Cloud Composer (CC) environment. The CC image we're on right now uses Python 3.8, but all of the images that have support beyond the end of March use Python 3.11.

Necessary for resolution of #3551

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

How has this been tested?

Ran the tests that exercise the package code under Python 3.11 locally. There are things we could take advantage of with the 3.11 upgrade (like updating type hints with PEP 585: type hinting generics in standard collections and PEP 604: allow writing union types as X | Y), but nothing that we were using should have changed substantively between Python 3.8 and 3.11.

$ pytest
# ================================================== test session starts ===================================================
# platform linux -- Python 3.11.11, pytest-7.4.4, pluggy-1.5.0
# rootdir: /home/mjumbewu/Code/jarvus/cal-itp/data-infra/packages/calitp-data-infra
# plugins: hypothesis-6.113.0
# collected 2 items                                                                                                        
# 
# tests/test_storage.py ..                                                                                           [100%]
# 
# ==================================================== warnings summary ====================================================
# calitp_data_infra/storage.py:3
#   /home/mjumbewu/Code/jarvus/cal-itp/data-infra/packages/calitp-data-infra/calitp_data_infra/storage.py:3: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
#     import cgi
# 
# -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
# ============================================== 2 passed, 1 warning in 1.70s ==============================================

Post-merge follow-ups

  • No action required
  • Actions required (specified below)
    • Find all components that mention the 2024.2.12.post1 version of calitp-data-infra in the codebase and replace with 2025.1.30
    • Test and re-deploy any affected components

Copy link
Contributor

@vevetron vevetron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good though we may want to move to Poetry 2.0.1 and stick there, not 1.8.5.

The lint checks were breaking under Python 3.13, and the project as a whole is converging on support for 3.11 for the time being.
@mjumbewu mjumbewu merged commit a2c5974 into main Jan 30, 2025
2 checks passed
@mjumbewu mjumbewu deleted the calitp-data-infra-py311 branch January 30, 2025 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants