diff options
| author | Orahcio FelĂcio de Sousa <orahcio@gmail.com> | 2026-06-13 18:00:31 -0300 |
|---|---|---|
| committer | Sharlatan Hellseher <sharlatanus@gmail.com> | 2026-06-20 19:14:48 +0100 |
| commit | 008e6d5da57ab7a73e6fdf02583c0ebb8f199814 (patch) | |
| tree | a4b72013cea51dc06f084758a0274d863da742a4 /gnu/packages/patches/python-twtxt-replace-pkg-resources.patch | |
| parent | b3506e9f7d76c0ca02135ef5b1849601eac1c930 (diff) | |
gnu: Add twtxt.
* gnu/packages/messaging.scm (twtxt): New variable.
* gnu/packages/patches/python-twtxt-replace-pkg-resources.patch: New file.
* gnu/local.mk (dist_patch_DATA): Reference it here.
Merges: guix/guix!9282
Reviewed-by: Hugo Buddelmeijer <hugo@buddelmeijer.nl>
Modified-by: Sharlatan Hellseher <sharlatanus@gmail.com>
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
Diffstat (limited to 'gnu/packages/patches/python-twtxt-replace-pkg-resources.patch')
| -rw-r--r-- | gnu/packages/patches/python-twtxt-replace-pkg-resources.patch | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gnu/packages/patches/python-twtxt-replace-pkg-resources.patch b/gnu/packages/patches/python-twtxt-replace-pkg-resources.patch new file mode 100644 index 00000000000..7a7450f84ea --- /dev/null +++ b/gnu/packages/patches/python-twtxt-replace-pkg-resources.patch | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | From: Branch Vincent (PR #178, twtxt repository) | ||
| 2 | Date: Apr 21, 2024 | ||
| 3 | Subject: replace pkg_resources for python 3.12 | ||
| 4 | |||
| 5 | * Python 3.12 has removed bundled setuptools (aka pkg_resources): | ||
| 6 | https://docs.python.org/3.12/whatsnew/3.12.html#removed | ||
| 7 | |||
| 8 | --- a/twtxt/helper.py 2026-06-12 23:37:01.869106540 -0300 | ||
| 9 | +++ b/twtxt/helper.py 2026-06-12 23:40:04.335252026 -0300 | ||
| 10 | @@ -14,7 +14,6 @@ | ||
| 11 | import textwrap | ||
| 12 | |||
| 13 | import click | ||
| 14 | -import pkg_resources | ||
| 15 | |||
| 16 | from twtxt.mentions import format_mentions | ||
| 17 | from twtxt.parser import parse_iso8601 | ||
| 18 | @@ -164,11 +163,7 @@ | ||
| 19 | |||
| 20 | |||
| 21 | def generate_user_agent(): | ||
| 22 | - try: | ||
| 23 | - version = pkg_resources.require("twtxt")[0].version | ||
| 24 | - except pkg_resources.DistributionNotFound: | ||
| 25 | - version = "unknown" | ||
| 26 | - | ||
| 27 | + from twtxt import __version__ as version | ||
| 28 | conf = click.get_current_context().obj["conf"] | ||
| 29 | if conf.disclose_identity and conf.nick and conf.twturl: | ||
| 30 | user_agent = "twtxt/{version} (+{url}; @{nick})".format( | ||
