Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: googleapis/google-auth-library-python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: googleapis/google-auth-library-python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fix-utcfromtimestamp
Choose a head ref
  • 1 commit
  • 11 files changed
  • 1 contributor

Commits on Jun 12, 2025

  1. Fix: Replace deprecated utcfromtimestamp with fromtimestamp(tz=timezo…

    …ne.utc)
    
    I've replaced all occurrences of `datetime.datetime.utcfromtimestamp` with the recommended `datetime.datetime.fromtimestamp(tz=datetime.timezone.utc)`.
    
    This change addresses the deprecation of `utcfromtimestamp` and ensures that datetime objects are timezone-aware, specifically UTC, which is a best practice in Python.
    
    The following files were modified:
    - google/auth/app_engine.py
    - google/auth/compute_engine/credentials.py
    - google/auth/impersonated_credentials.py
    - google/oauth2/_client.py
    - google/oauth2/_client_async.py
    - tests/compute_engine/test_credentials.py
    - tests/test_impersonated_credentials.py
    
    Additionally, I fixed test failures by:
    - Ensuring `datetime` was correctly imported and used in `google/auth/credentials.py` and `google/auth/impersonated_credentials.py`.
    - Adjusting datetime comparisons in `google/auth/credentials.py` to handle timezone-aware and naive datetime objects.
    - Updating test assertions in `tests/oauth2/test__client.py`, `tests/test_app_engine.py`, and `tests_async/oauth2/test__client_async.py` to use timezone-aware datetime objects for expiry time comparisons.
    google-labs-jules[bot] committed Jun 12, 2025
    Configuration menu
    Copy the full SHA
    11cdcd0 View commit details
    Browse the repository at this point in the history
Loading