aider/aider
Paul Gauthier 7b77dbb88d aider: Updated package data to include the queries directory and modified repomap.py to use pkg_resources to access the scm files at runtime.
# Aider chat conversation:

USER: the `scm_fname` is using a path in my local filesystem. how do i package up the queries directory for pip install in a way that the script can find those scm files at runtime

ASSISTANT: To package the queries directory for pip install, you need to include it in your package data in the `setup.py` file. This will ensure that the directory is included when your package is installed.

Then, you can use the `pkg_resources` module to access the files at runtime. This module is part of `setuptools`, so it's already installed if you're using pip.

Here are the steps:

1. Modify `setup.py` to include the queries directory in the package data.

```python
setup.py
<<<<<<< HEAD
    packages=find_packages(),
    include_package_data=True,
=======
    packages=find_packages(),
    include_package_data=True,
    package_data={
        '': ['queries/*'],
    },
>>>>>>> updated
```

2. Modify `aider/repomap.py` to use `pkg_resources` to access the scm files at runtime.

```python
aider/repomap.py
<<<<<<< HEAD
        scm_fname = (
            f"/Users/gauthier/tmp/py-tree-sitter-languages/queries/tree-sitter-{lang}-tags.scm"
        )
=======
        scm_fname = pkg_resources.resource_filename(
            __name__, f"queries/tree-sitter-{lang}-tags.scm"
        )
>>>>>>> updated
```

Please note that the `queries` directory should be in the same directory as the `repomap.py` file for this to work. If it's in a different location, you'll need to adjust the path in the `resource_filename` call accordingly.
2023-09-01 14:06:51 -07:00
..
coders Merge branch 'main' into sitter-map 2023-09-01 12:00:48 -07:00
models cleaning up openrouter code 2023-08-23 22:03:09 +12:00
__init__.py set version to 0.13.1-dev 2023-08-22 08:04:24 -07:00
commands.py initial code for working with openrouter 2023-08-23 14:39:12 +12:00
diffs.py use utf-8 2023-07-05 20:51:35 -07:00
dump.py isort 2023-05-28 22:47:38 -07:00
history.py finishing openrouter integration 2023-08-23 21:26:27 +12:00
io.py pass the input history as a prompt to whisper 2023-08-11 11:03:37 -03:00
main.py finishing openrouter integration 2023-08-23 21:26:27 +12:00
parsers.py initial 2023-08-26 17:20:12 -07:00
prompts.py Add summary prefix 2023-07-22 12:11:01 -03:00
repo.py initial code for working with openrouter 2023-08-23 14:39:12 +12:00
repomap.py aider: Updated package data to include the queries directory and modified repomap.py to use pkg_resources to access the scm files at runtime. 2023-09-01 14:06:51 -07:00
sendchat.py finishing openrouter integration 2023-08-23 21:26:27 +12:00
utils.py Adopt safe_abs_path 2023-07-07 17:17:33 -07:00
versioncheck.py cleanup 2023-07-20 09:49:40 -03:00
voice.py Late-bind importing sounddevice, as it was slowing down aider startup 2023-08-19 15:18:46 -07:00