๐Ÿ Tiny CLI to post simultaneously to Mastodon and Bluesky
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request 'Fixes loop issue on 3.14' (#4) from loop-issue-on-3.14 into main

Reviewed-on: https://codeberg.org/cuducos/not-my-ex/pulls/4

+27 -4
+1 -1
.woodpecker/test.yaml
··· 4 4 branch: main 5 5 6 6 matrix: 7 - VERSION: ["3.10", "3.11", "3.12", "3.13", "3.14-rc"] 7 + VERSION: ["3.10", "3.11", "3.12", "3.13", "3.14"] 8 8 9 9 steps: 10 10 - image: ghcr.io/astral-sh/uv:python${VERSION}-trixie-slim
+2 -3
not_my_ex/cli/post.py
··· 1 - from asyncio import gather, get_event_loop 1 + from asyncio import gather, run 2 2 from collections import namedtuple 3 3 from itertools import zip_longest 4 4 from os import getenv ··· 157 157 auth.assure_configured() 158 158 159 159 text = text or editor() 160 - loop = get_event_loop() 161 160 try: 162 - loop.run_until_complete(main(auth, text, images, alt_texts, lang, yes_to_all)) 161 + run(main(auth, text, images, alt_texts, lang, yes_to_all)) 163 162 except PostTooLongError as err: 164 163 error(err)
+24
tests/test_cli_post.py
··· 1 + from unittest.mock import patch 2 + 3 + from not_my_ex.cli.post import post 4 + 5 + 6 + def test_post_command_event_loop(): 7 + """There was a relevant change in Async I/O API in Python 3.14, when getting the 8 + event loop. This test assures the CLI works on the supported Python versions.""" 9 + with ( 10 + patch("not_my_ex.cli.post.cache") as cache, 11 + patch("not_my_ex.cli.post.authenticate") as auth, 12 + ): 13 + cache.return_value.exists.return_value = False 14 + auth.return_value.assure_configured.return_value = None 15 + with patch("not_my_ex.cli.post.main", return_value=None): 16 + post( 17 + text="test", 18 + images=[], 19 + alt_texts=[], 20 + lang="en", 21 + yes_to_all=True, 22 + skip_bluesky=False, 23 + skip_mastodon=False, 24 + )