mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-22 13:25:00 +00:00
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`.
This commit is contained in:
parent
ece1cdd557
commit
f8f2eb0f76
1 changed files with 4 additions and 1 deletions
5
setup.py
5
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={
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue