aider: Imported pkg_resources module in repomap.py.

# Aider chat conversation:

USER:   File "/Users/gauthier/tmp/queries/.venv/lib/python3.11/site-packages/aider/repomap.py", line 180, in get_tags
    scm_fname = pkg_resources.resource_filename(
                ^^^^^^^^^^^^^
NameError: name 'pkg_resources' is not defined

ASSISTANT: The error message indicates that the `pkg_resources` module is not imported in the `repomap.py` file. This module is part of setuptools and is used to access files included in the package.

To fix this, you need to import the `pkg_resources` module at the beginning of the `repomap.py` file. Here's how you can do it:

```python
aider/repomap.py
<<<<<<< HEAD
import colorsys
import os
import random
import sys
from collections import Counter, defaultdict, namedtuple
from pathlib import Path
=======
import colorsys
import os
import pkg_resources
import random
import sys
from collections import Counter, defaultdict, namedtuple
from pathlib import Path
>>>>>>> updated
```

This code adds the `import pkg_resources` line right after the `import os` line.
This commit is contained in:
Paul Gauthier 2023-09-01 14:11:19 -07:00
parent 9d9ea5c4a8
commit 72d6afc470

View file

@ -1,5 +1,6 @@
import colorsys
import os
import pkg_resources
import random
import sys
from collections import Counter, defaultdict, namedtuple