Commit graph

3067 commits

Author SHA1 Message Date
Paul Gauthier
a7e89ea965 commit the dirty repo 2023-11-02 16:11:26 -07:00
Paul Gauthier
2e232b1d20 Ignore PermissionError when testing too 2023-11-02 16:07:08 -07:00
Paul Gauthier
d720bfe459 Properly test if /added file is already in the repo #314 2023-11-02 15:50:30 -07:00
Paul Gauthier
2609ec1b06 find_original_update_blocks now accepts fence param, raises on mangled <source>filename.ext #317 2023-11-02 12:05:39 -07:00
Paul Gauthier
f0711d4b96 Disable pretty when the fence is an html tag not triple-backticks 2023-11-02 10:52:55 -07:00
Paul Gauthier
00cd460ed8 Updated HISTORY 2023-11-02 10:50:48 -07:00
Paul Gauthier
b3bc8b0f2b Ask for concise S/R blocks 2023-11-02 10:09:18 -07:00
Paul Gauthier
5c9275191e aider: Refused to add blocked file by .gitignore and printed error message.
# Aider chat conversation:

USER: crash when /add a file which is blocked by .gitignore; we should catch the error, print a tool_error an

d refuse to /add the file
. > /add tmp/wordpress.py

Traceback (most recent call last):
  File "/home/m/.local/bin/aider", line 8, in <module>
    sys.exit(main())
  File "/home/m/.local/lib/python3.10/site-packages/aider/main.py", line 564, in main
    coder.run()
  File "/home/m/.local/lib/python3.10/site-packages/aider/coders/base_coder.py", line 319, in run
    new_user_message = self.run_loop()
  File "/home/m/.local/lib/python3.10/site-packages/aider/coders/base_coder.py", line 398, in run_loop
    return self.commands.run(inp)
  File "/home/m/.local/lib/python3.10/site-packages/aider/commands.py", line 73, in run
    return self.do_run(matching_commands[0][1:], rest_inp)
  File "/home/m/.local/lib/python3.10/site-packages/aider/commands.py", line 51, in do_run
    return cmd_method(args)
  File "/home/m/.local/lib/python3.10/site-packages/aider/commands.py", line 316, in cmd_add
    self.coder.repo.repo.git.add(abs_file_path)
  File "/home/m/.local/lib/python3.10/site-packages/git/cmd.py", line 741, in <lambda>
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
  File "/home/m/.local/lib/python3.10/site-packages/git/cmd.py", line 1315, in _call_process
    return self.execute(call, **exec_kwargs)
  File "/home/m/.local/lib/python3.10/site-packages/git/cmd.py", line 1109, in execute
    raise GitCommandError(redacted_command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(1)
  cmdline: git add /home/m/Private/Projects/Freelance/nbdter69/pars_porntube/tmp/wordpress.py
  stderr: 'The following paths are ignored by one of your .gitignore files:
tmp
hint: Use -f if you really want to add them.
hint: Turn this message off by running
hint: "git config advice.addIgnoredFile false"'

ASSISTANT: To handle this issue, we need to modify the `cmd_add` method in the `Commands` class in the `aider/commands.py` file. We will add a check to see if the file is ignored by git before trying to add it. If it is ignored, we will print an error message and skip adding the file.

Here is the *SEARCH/REPLACE block* for the change:

<source>python
aider/commands.py
<<<<<<< SEARCH
        for matched_file in all_matched_files:
            abs_file_path = self.coder.abs_root_path(matched_file)

            if not abs_file_path.startswith(self.coder.root):
                self.io.tool_error(
                    f"Can not add {abs_file_path}, which is not within {self.coder.root}"
                )
                continue

            if self.coder.repo and matched_file not in git_files:
                self.coder.repo.repo.git.add(abs_file_path)
                git_added.append(matched_file)

            if abs_file_path in self.coder.abs_fnames:
                self.io.tool_error(f"{matched_file} is already in the chat")
            else:
                content = self.io.read_text(abs_file_path)
                if content is None:
                    self.io.tool_error(f"Unable to read {matched_file}")
                else:
                    self.coder.abs_fnames.add(abs_file_path)
                    self.io.tool_output(f"Added {matched_file} to the chat")
                    added_fnames.append(matched_file)
=======
        for matched_file in all_matched_files:
            abs_file_path = self.coder.abs_root_path(matched_file)

            if not abs_file_path.startswith(self.coder.root):
                self.io.tool_error(
                    f"Can not add {abs_file_path}, which is not within {self.coder.root}"
                )
                continue

            if self.coder.repo and matched_file not in git_files:
                try:
                    self.coder.repo.repo.git.add(abs_file_path)
                    git_added.append(matched_file)
                except git.exc.GitCommandError as e:
                    self.io.tool_error(f"Unable to add {matched_file}: {str(e)}")
                    continue

            if abs_file_path in self.coder.abs_fnames:
                self.io.tool_error(f"{matched_file} is already in the chat")
            else:
                content = self.io.read_text(abs_file_path)
                if content is None:
                    self.io.tool_error(f"Unable to read {matched_file}")
                else:
                    self.coder.abs_fnames.add(abs_file_path)
                    self.io.tool_output(f"Added {matched_file} to the chat")
                    added_fnames.append(matched_file)
>>>>>>> REPLACE
</source>
2023-11-02 10:08:25 -07:00
Paul Gauthier
6556265c23 added test for #310 2023-11-02 09:45:16 -07:00
paul-gauthier
b507ea087f
Merge pull request #310 from omri123/autocommit-bugfix
Do not autocommit after add if autocommit is disabled
2023-11-02 09:40:15 -07:00
Paul Gauthier
4e2e03dfef Pick up refs in elisp 2023-11-02 09:32:55 -07:00
Paul Gauthier
f0c575e413 use io.read_text to avoid unicode errors in repomap #305 2023-11-02 09:30:59 -07:00
Paul Gauthier
5df4f2f1a4 removed empty r tags file 2023-11-01 15:01:55 -07:00
Paul Gauthier
0875300cd2 updated discord link in faq 2023-11-01 08:46:31 -07:00
Paul Gauthier
f6288d51b4 set version to 0.16.4-dev 2023-11-01 07:36:19 -07:00
Paul Gauthier
8fedf5f12e version bump to 0.16.3 2023-11-01 07:35:53 -07:00
Paul Gauthier
b0b23bcb64 Updated HISTORY 2023-11-01 07:35:36 -07:00
Omri Bloch
e8c4b3cf81 Do not autocommit after add if autocommit is disabled 2023-11-01 10:28:45 +02:00
Paul Gauthier
05b0597f8b use grep-ast==0.2.4 to fully fix c-sharp bug 2023-10-31 16:48:44 -07:00
Paul Gauthier
23024488b5 use grep-ast==0.2.3 to fix c-sharp bug 2023-10-31 16:27:53 -07:00
Paul Gauthier
007f54de16 set version to 0.16.3-dev 2023-10-31 15:10:39 -07:00
Paul Gauthier
0c9363062c version bump to 0.16.2 2023-10-31 15:10:14 -07:00
Paul Gauthier
3e1d9225e9 Updated HISTORY 2023-10-31 15:10:08 -07:00
Paul Gauthier
c9aa36d7b6 Put build-essential back into dockerfile 2023-10-31 14:52:04 -07:00
Paul Gauthier
702fc0c6ea restore release.yml, do multi arch build in docker-build-test.yml 2023-10-31 14:48:37 -07:00
Paul Gauthier
982c58a94d just arm64 2023-10-31 14:40:07 -07:00
Paul Gauthier
ce1977b75c temp disable push 2023-10-31 14:34:11 -07:00
Paul Gauthier
59d65a0b1b temp disable arm64 2023-10-31 14:33:43 -07:00
Paul Gauthier
dcaa94551e temp disable twine, arm64 2023-10-31 14:29:33 -07:00
Paul Gauthier
ff3731eee0 Updated HISTORY 2023-10-31 14:16:29 -07:00
Paul Gauthier
4c31062b69 set version to 0.16.2-dev 2023-10-31 14:14:31 -07:00
Paul Gauthier
d710124d1d version bump to 0.16.1 2023-10-31 14:14:02 -07:00
Paul Gauthier
e4e14df503 Updated HISTORY 2023-10-31 11:37:48 -07:00
Paul Gauthier
dcf7c98b9f Merge remote-tracking branch 'origin/main' 2023-10-31 11:30:09 -07:00
Paul Gauthier
5280549c33 Upgrade to grep-ast 0.2.2 to streamline tree-sitter install 2023-10-31 11:28:34 -07:00
paul-gauthier
7ad7dd5b0a
Update README.md 2023-10-30 20:01:14 -07:00
Paul Gauthier
b579c9e4d4 updated numpy & scipy versions #300 2023-10-30 19:01:02 -07:00
Paul Gauthier
2bfc212f31 added aider-square.jpg 2023-10-30 16:04:36 -07:00
Paul Gauthier
e93a154e88 install using python 3.9-3.11 2023-10-30 11:20:55 -07:00
Paul Gauthier
3eaa9671be Just test building the docker image 2023-10-30 09:15:16 -07:00
Paul Gauthier
0beba57a98 aider: Added a new workflow that builds the Docker image and runs tests inside it.
# Aider chat conversation:

USER: add a new workflow that will build the docker image and make sure the tests succeed inside it

ASSISTANT: To add a new workflow that builds the Docker image and runs tests inside it, we need to create a new GitHub Actions workflow file. Let's call it `docker-build-and-test.yml` and place it in the `.github/workflows/` directory.

Here is the *SEARCH/REPLACE block* for the new file:

```yaml
.github/workflows/docker-build-and-test.yml
<<<<<<< SEARCH

=======
name: Docker Build and Test

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - name: Check out repository
      uses: actions/checkout@v3

    - name: Build Docker image
      run: |
        docker build -t myapp:latest .

    - name: Run tests in Docker container
      run: |
        docker run myapp:latest python -m unittest discover -s tests
>>>>>>> REPLACE
```

This workflow will trigger on every push and pull request to the `main` branch. It will build a Docker image from the Dockerfile in the root directory of the repository and then run the tests inside a container from that image.
2023-10-30 09:08:40 -07:00
Paul Gauthier
7aa59c1331 added build-essential to dockerfile 2023-10-30 09:05:22 -07:00
Paul Gauthier
4f5818c9a7 added pypi classifiers 2023-10-30 09:01:00 -07:00
paul-gauthier
423ba83a85
Merge pull request #298 from jackhallam/licence
Add license classifier to setup.py
2023-10-30 08:57:48 -07:00
Paul Gauthier
64e8b3d3a7 aider: Updated python_requires field to limit the package to Python versions 3.9-3.11.
# Aider chat conversation:

USER: how can i limit this package to python python versions 3.9-3.11 ?

ASSISTANT: To limit the package to Python versions 3.9 to 3.11, you need to modify the `python_requires` field in the `setup` function in the `setup.py` file.

Here is the *SEARCH/REPLACE block* for the change:

```python
setup.py
<<<<<<< SEARCH
    python_requires=">=3.9",
=======
    python_requires=">=3.9,<=3.11",
>>>>>>> REPLACE
```

This change will ensure that the package can only be installed on Python versions from 3.9 up to and including 3.11.
2023-10-30 08:52:25 -07:00
Jack Hallam
3e310ffc99 Add license classifier to setup.py 2023-10-30 11:12:21 +00:00
Paul Gauthier
3c1023b798 updated install instructions 2023-10-29 13:29:28 -07:00
Paul Gauthier
f4b59c923d set version to 0.16.1-dev 2023-10-29 13:24:51 -07:00
Paul Gauthier
92ea4c09a3 version bump to 0.16.0 2023-10-29 13:24:22 -07:00
Paul Gauthier
77e4f0dd3c Merge remote-tracking branch 'origin/main' 2023-10-29 13:10:57 -07:00