From f8f2eb0f76d4afb105d671d3edc15d40d70b988b Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 7 Jun 2023 16:59:35 -0700 Subject: [PATCH] aider: Filtered out image links from long_description in setup.py. # Context: USER: pypi descriptions don't support markdown image links. filter out images before passing it ASSISTANT: To filter out image links from the `long_description` in `setup.py`, you can use a regular expression to remove the lines containing image links. Here's the change you need to make in `setup.py`: ```python setup.py <<<<<<< ORIGINAL with open("README.md", "r", encoding="utf-8") as f: long_description = f.read() ======= import re with open("README.md", "r", encoding="utf-8") as f: long_description = f.read() long_description = re.sub(r'\n!\[.*\]\(.*\)', '', long_description) >>>>>>> UPDATED ``` This change imports the `re` module and uses the `re.sub()` function to remove lines containing image links from the `long_description`. --- setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7a9cbc2c1..f5a2ee534 100644 --- a/setup.py +++ b/setup.py @@ -3,12 +3,15 @@ from setuptools import find_packages, setup with open("requirements.txt") as f: requirements = f.read().splitlines() +import re + with open("README.md", "r", encoding="utf-8") as f: long_description = f.read() + long_description = re.sub(r'\n!\[.*\]\(.*\)', '', long_description) setup( name="aider-chat", - version="0.5.0", + version="0.5.1", packages=find_packages(), install_requires=requirements, entry_points={