Skip to content

Commit

Permalink
upgrade App Engine app runtime to python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
snarfed committed Sep 10, 2024
1 parent 9ba6bdf commit 60c92e1
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ parameters:
jobs:
build:
docker:
- image: cimg/python:3.11
- image: cimg/python:3.12

steps:
- checkout
Expand Down
2 changes: 1 addition & 1 deletion app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# application: bridgy-federated

runtime: python311
runtime: python312

# default_expiration: 1h

Expand Down
2 changes: 1 addition & 1 deletion atproto_hub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env: flex
runtime: python
runtime_config:
operating_system: ubuntu22
runtime_version: "3.11"
runtime_version: "3.12"

resources:
cpu: 1
Expand Down
2 changes: 1 addition & 1 deletion router.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env: flex
runtime: python
runtime_config:
operating_system: ubuntu22
runtime_version: "3.11"
runtime_version: "3.12"

resources:
cpu: 6
Expand Down
9 changes: 5 additions & 4 deletions tests/test_activitypub.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Unit tests for activitypub.py."""
from base64 import b64encode
import copy
from datetime import datetime, timedelta
from datetime import datetime, timedelta, UTC
from hashlib import sha256
import logging
from unittest import skip
Expand Down Expand Up @@ -1865,7 +1865,8 @@ def test_followers_collection_protocol_bot_user(self, *_):
@patch('models.PAGE_SIZE', 1)
def test_followers_collection_page(self, *_):
self.store_followers()
before = (datetime.utcnow() + timedelta(seconds=1)).isoformat()
before = (datetime.now(UTC) + timedelta(seconds=1)
).replace(tzinfo=None).isoformat()
next = Follower.query(Follower.from_ == ActivityPub(id='http://baz').key,
Follower.to == self.user.key,
).get().updated.isoformat()
Expand All @@ -1886,7 +1887,7 @@ def test_followers_collection_page_protocol_bot_user(self, *_):
self.user = self.make_user('bsky.brid.gy', cls=Web, ap_subdomain='bsky')
self.store_followers()

before = (datetime.utcnow() + timedelta(seconds=1)).isoformat()
before = (datetime.now(UTC) + timedelta(seconds=1)).isoformat()
resp = self.client.get(f'/bsky.brid.gy/followers?before={before}',
base_url='https://bsky.brid.gy')
self.assertEqual(200, resp.status_code)
Expand Down Expand Up @@ -1991,7 +1992,7 @@ def test_following_collection_page_protocol_bot_user(self, *_):
self.user = self.make_user('bsky.brid.gy', cls=Web, ap_subdomain='bsky')
self.store_following()

before = (datetime.utcnow() + timedelta(seconds=1)).isoformat()
before = (datetime.now(UTC) + timedelta(seconds=1)).isoformat()
resp = self.client.get(f'/bsky.brid.gy/following?before={before}',
base_url='https://bsky.brid.gy')
self.assertEqual(200, resp.status_code)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_atproto_firehose.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Unit tests for atproto_firehose.py."""
import copy
from datetime import datetime, timedelta, timezone
from datetime import datetime, timedelta, timezone, UTC
from unittest import skip
from unittest.mock import patch

Expand Down Expand Up @@ -402,7 +402,7 @@ def test_load_dids_updated_atproto_user(self):

self.store_object(id='did:plc:eve', raw=DID_DOC)
eve = self.make_user('did:plc:eve', cls=ATProto)
util.now = datetime.utcnow
util.now = lambda: datetime.now(UTC).replace(tzinfo=None)
self.assertLess(eve.created, util.now())

self.subscribe()
Expand Down
1 change: 1 addition & 0 deletions tests/testutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ class TestCase(unittest.TestCase, testutil.Asserts):

def setUp(self):
super().setUp()
testutil.suppress_warnings()

appengine_info.APP_ID = 'my-app'
appengine_info.LOCAL_SERVER = False
Expand Down

0 comments on commit 60c92e1

Please sign in to comment.