# 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`.
# Context:
USER: update the `setup.py` to use README.md as the long description source
ASSISTANT: To update the `setup.py` to use the `README.md` as the long description source, follow these steps:
1. Read the contents of the `README.md` file and store it in a variable.
2. Add the `long_description` and `long_description_content_type` arguments to the `setup()` function.
Here's the updated `setup.py`:
```python
setup.py
<<<<<<< ORIGINAL
from setuptools import find_packages, setup
with open("requirements.txt") as f:
requirements = f.read().splitlines()
setup(
name="aider-chat",
version="0.5.0",
packages=find_packages(),
install_requires=requirements,
entry_points={
"console_scripts": [
"aider = aider.main:main",
],
},
)
=======
from setuptools import find_packages, setup
with open("requirements.txt") as f:
requirements = f.read().splitlines()
with open("README.md", "r", encoding="utf-8") as f:
long_description = f.read()
setup(
name="aider-chat",
version="0.5.0",
packages=find_packages(),
install_requires=requirements,
entry_points={
"console_scripts": [
"aider = aider.main:main",
],
},
long_description=long_description,
long_description_content_type="text/markdown",
)
>>>>>>> UPDATED
```
# Context:
USER: expand the context diff to 5 lines of context
ASSISTANT: To expand the context diff to 5 lines of context, you need to modify the `diff_partial_update` function in the `aider/diffs.py` file. Update the `unified_diff` function call to include the `n` parameter with a value of 5.
Here's the change:
```python
aider/diffs.py
<<<<<<< ORIGINAL
diff = difflib.unified_diff(lines_orig, lines_updated)
=======
diff = difflib.unified_diff(lines_orig, lines_updated, n=5)
>>>>>>> UPDATED
```