Commit graph

60 commits

Author SHA1 Message Date
Paul Gauthier
8f6098160b cleanup 2024-07-10 07:28:52 +01:00
Paul Gauthier
fc5737fbd0 Find the true URL even if another env has cached it 2024-07-09 17:03:01 +01:00
Paul Gauthier
e307be1a9c refactored into get_requirements 2024-07-09 16:39:54 +01:00
Paul Gauthier (aider)
2af9876b76 Removed hardcoded torch version and used the one from requirements.txt 2024-07-09 16:08:44 +01:00
Paul Gauthier
1d2ade748c Updated the TempNamedDir usage to TemporaryDirectory in the setup.py file. 2024-07-09 16:08:43 +01:00
Paul Gauthier (aider)
f568c45f6b Used TempNamedDir instead of tempfile.mkdtemp() to ensure the temporary directory is cleaned up after the subprocess completes. 2024-07-09 16:03:01 +01:00
Paul Gauthier (aider)
472ad976b8 Used a temporary named directory instead of /dev/null in setup.py. 2024-07-09 16:01:26 +01:00
Paul Gauthier
8256f611b4 Removed commented-out sys.exit() statement from setup.py. 2024-07-09 16:01:24 +01:00
Paul Gauthier (aider)
7db1c51919 Subprocess output was processed line-by-line to find and extract the PyTorch URL, and the subprocess was terminated as soon as the URL was found. 2024-07-09 16:00:29 +01:00
Paul Gauthier
72f0686c66 works 2024-07-09 15:59:45 +01:00
Paul Gauthier (aider)
a376f91de6 Extracted PyTorch URL from command output and printed it. 2024-07-09 15:30:38 +01:00
Paul Gauthier
c71d98f1b2 Installed PyTorch version 2.2.2 from the specified URL and exited the script. 2024-07-09 15:30:36 +01:00
Paul Gauthier (aider)
9a39f00c39 Remove --extra-index-url line from requirements.txt and conditionally install torch from the specified URL in setup.py. 2024-07-09 14:40:59 +01:00
Paul Gauthier
929aa7f9ac refac to help_pats 2024-07-05 10:18:34 -03:00
Paul Gauthier
05caccf3cc cleanup 2024-07-05 10:09:13 -03:00
Paul Gauthier
22a494bb59 moved website/ -> aider/website/ 2024-07-05 10:01:30 -03:00
Paul Gauthier
eb80b32915 Added the exclude=["benchmark"] parameter to the find_packages() function to exclude the 'benchmark' package from the discovered packages. 2024-07-05 09:34:16 -03:00
Paul Gauthier
9f7197974f refactored exclude_website_pats 2024-07-05 09:29:35 -03:00
Paul Gauthier (aider)
644412bd8c Added a note explaining that the 'build' directory is populated when running commands like 'python setup.py sdist bdist_wheel' to build distribution packages. 2024-07-04 16:37:40 -03:00
Paul Gauthier (aider)
e6e581f5cd Added debug print statements to discover and display the packages and package data being included in the distribution. 2024-07-04 16:36:10 -03:00
Paul Gauthier
dcc542f7ef undo setup.py changes 2024-07-04 16:34:29 -03:00
Paul Gauthier (aider)
fceaa0504c Added files and directories to the package_data, excluding the website/_posts subdirectory. 2024-07-04 15:23:05 -03:00
Paul Gauthier (aider)
6db8501891 Added the website directory and all MD files in its subdirectories to the package data and packages in the setup.py file. 2024-07-04 15:01:17 -03:00
Paul Gauthier
f28f3fdcaf Stop eliding - bullet lists in pypi desc 2024-06-25 14:22:50 -07:00
Paul Gauthier
52b883413f Use cogged website/index.md for pypi 2024-06-25 13:39:08 -07:00
Paul Gauthier
da69daa7aa cleanup 2024-06-25 13:37:41 -07:00
Paul Gauthier
5dc55f5291 copy 2024-06-25 13:31:52 -07:00
Paul Gauthier
c6ae99f2a1 Updated the documentation URL in the setup.py file. 2024-06-25 13:29:32 -07:00
Paul Gauthier (aider)
49eb864895 Added project URLs to setup.py 2024-06-25 13:29:05 -07:00
Paul Gauthier
460e12494c added 3.12 to pypi classifiers 2024-01-05 14:50:37 -08:00
Paul Gauthier
fb1e6ad8a0 bump the python version to <3.13 2024-01-05 14:49:09 -08:00
Paul Gauthier
b579c9e4d4 updated numpy & scipy versions #300 2023-10-30 19:01:02 -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
0de722a7b3 lint 2023-09-01 15:52:56 -07:00
Paul Gauthier
6c5208246c aider: Fixed the queries directory not being included in the package by moving it inside the aider package and adjusting the package_data argument in the setup.py file.
# Aider chat conversation:

ASSISTANT: The `queries` directory might not be included in the package because it's not specified correctly in the `setup.py` file.

In the `setup.py` file, you have specified `package_data={'': ['queries/*']}`. This means that setuptools will include all files in the `queries` directory that are inside any package. However, if the `queries` directory is not inside a Python package (i.e., a directory containing an `__init__.py` file), it will not be included.

To fix this, you need to move the `queries` directory inside the `aider` package and adjust the `package_data` argument in the `setup.py` file. Here's how you can do it:

```python
setup.py
<<<<<<< HEAD
    package_data={
        '': ['queries/*'],
    },
=======
    package_data={
        'aider': ['queries/*'],
    },
>>>>>>> updated
```

This code changes the `package_data` argument to include all files in the `queries` directory that is inside the `aider` package.

After making this change, you need to move the `queries` directory inside the `aider` package. If the `queries` directory is currently in the same directory as the `setup.py` file, you can do this by running `mv queries aider/` in the terminal.

Finally, you need to adjust the `scm_fname` assignment in the `repomap.py` file to reflect the new location of the `queries` directory:

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

This code changes the path in the `resource_filename` call to look for the `queries` directory inside the `aider` package.
2023-09-01 14:14:05 -07:00
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
Paul Gauthier
fb82a20d60 aider: Add python_requires='>=3.9' to setup.py.
# Aider chat conversation:

USER: Add python_requires='>=3.8'

ASSISTANT: To add the `python_requires='>=3.8'` to the `setup
^C KeyboardInterrupt

USER: Add python_requires='>=3.9'

ASSISTANT: To add the `python_requires='>=3.9'` to the `setup.py` file, we need to modify the `setup()` function call to include this new argument.

Here is the *edit block* for this change:

```python
setup.py
<<<<<<< HEAD
setup(
    name="aider-chat",
    version=__version__,
    packages=find_packages(),
    include_package_data=True,
    install_requires=requirements,
    entry_points={
        "console_scripts": [
            "aider = aider.main:main",
        ],
    },
    description="aider is GPT powered coding in your terminal",
    long_description=long_description,
    long_description_content_type="text/markdown",
    url="https://github.com/paul-gauthier/aider",
)
=======
setup(
    name="aider-chat",
    version=__version__,
    packages=find_packages(),
    include_package_data=True,
    install_requires=requirements,
    python_requires='>=3.9',
    entry_points={
        "console_scripts": [
            "aider = aider.main:main",
        ],
    },
    description="aider is GPT powered coding in your terminal",
    long_description=long_description,
    long_description_content_type="text/markdown",
    url="https://github.com/paul-gauthier/aider",
)
>>>>>>> updated
```
This change ensures that the package will not be installed on Python versions lower than 3.9.
2023-08-17 08:34:21 -07:00
Paul Gauthier
fde537cd7f aider: Fix regular expression in setup.py to remove all links, not just the internal anchor links.
# Aider chat conversation:

USER: the regex in `setup.py` is supposed to remove the list of links that appears right below the image in README. but it doesn't remove the links to aider.chat urls, just the internal anchor links. fix that.

ASSISTANT: To fix the regular expression in `setup.py` to remove all links, not just the internal anchor links, we need to modify the `setup.py` file.

Here's the change:

```python
setup.py
<<<<<<< ORIGINAL
    long_description = re.sub(r"\n!\[.*\]\(.*\)", "", long_description)
    long_description = re.sub(r"\n- \[.*\]\(#.*\)", "", long_description)
=======
    long_description = re.sub(r"\n!\[.*\]\(.*\)", "", long_description)
    long_description = re.sub(r"\n- \[.*\]\(.*\)", "", long_description)
>>>>>>> UPDATED
```

This change will ensure that all links, including those to `aider.chat` URLs, are removed from the `long_description`.
2023-07-11 13:08:10 -07:00
Paul Gauthier
0ca0db3edf fix; bump to 0.6.4 2023-06-17 07:08:45 -07:00
Paul Gauthier
79f6be2163 aider: Added __version__ variable to aider/__init__.py and imported it in setup.py.
# Context:
USER: is it safe/sensible to put __version__ into `aider/__init__.py` and have setup.py import that to learn the version?
ASSISTANT: Yes, it is safe and sensible to put the `__version__` variable in `aider/__init__.py` and have `setup.py` import it to learn the version. This is a common practice in Python projects to maintain a single source of truth for the package version.

Here's how you can modify the `aider/__init__.py` and `setup.py` files:

```python
aider/__init__.py
<<<<<<< ORIGINAL
=======
__version__ = "0.6.2"
>>>>>>> UPDATED
```

```python
setup.py
<<<<<<< ORIGINAL
import re

with open("README.md", "r", encoding="utf-8") as f:
    long_description = f.read()
    long_description = re.sub(r"\n!\[.*\]\(.*\)", "", long_description)
    long_description = re.sub(r"\n- \[.*\]\(#.*\)", "", long_description)

setup(
    name="aider-chat",
    version="0.6.2",
=======
from aider import __version__

with open("README.md", "r", encoding="utf-8") as f:
    long_description = f.read()
    long_description = re.sub(r"\n!\[.*\]\(.*\)", "", long_description)
    long_description = re.sub(r"\n- \[.*\]\(#.*\)", "", long_description)

setup(
    name="aider-chat",
    version=__version__,
>>>>>>> UPDATED
```

This way, you can maintain the version in `aider/__init__.py` and `setup.py` will always use the correct version.
2023-06-17 06:59:58 -07:00
Paul Gauthier
14d42ee79d bump setup.py to 0.6.2 2023-06-17 06:47:24 -07:00
Paul Gauthier
7708b2b271 bump setup.py to 0.6.1 2023-06-17 06:46:13 -07:00
Paul Gauthier
89d9d17b2a bump setup.py to 0.6.0 2023-06-17 06:41:45 -07:00
Paul Gauthier
2a896daa0c Move back to 0.5.0 2023-06-08 16:24:45 -07:00
Paul Gauthier
419fccfa8a wip 2023-06-08 12:44:41 -07:00
Paul Gauthier
59e8f798d1 aider: Updated aiohttp version constraint in requirements.txt.
# Context:
USER: $ pip install -i https://test.pypi.org/simple/ aider-chat
Looking in indexes: https://test.pypi.org/simple/
Collecting aider-chat
  Downloading a61a5f1941/aider_chat-0.5.3-py3-none-any.whl (42 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.0/42.0 kB 614.5 kB/s eta 0:00:00
INFO: pip is looking at multiple versions of aider-chat to determine which version is compatible with other requirements. This could take a while.
  Downloading e8a3663c60/aider_chat-0.5.2-py3-none-any.whl (42 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.1/42.1 kB 1.2 MB/s eta 0:00:00
  Downloading f69bb4653a/aider_chat-0.5.1-py3-none-any.whl (42 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.1/42.1 kB 1.3 MB/s eta 0:00:00
  Downloading 005ae4324a/aider_chat-0.5.0-py3-none-any.whl (38 kB)
ERROR: Cannot install aider-chat==0.5.0, aider-chat==0.5.1, aider-chat==0.5.2 and aider-chat==0.5.3 because these package versions have conflicting dependencies.

The conflict is caused by:
    aider-chat 0.5.3 depends on aiohttp==3.8.4
    aider-chat 0.5.2 depends on aiohttp==3.8.4
    aider-chat 0.5.1 depends on aiohttp==3.8.4
    aider-chat 0.5.0 depends on aiohttp==3.8.4

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

ASSISTANT: It seems there is a dependency conflict when trying to install `aider-chat` from TestPyPI. The conflict is caused by the `aiohttp` package version. To resolve this issue, you can try the following steps:

1. Update the `requirements.txt` file to loosen the version constraint for `aiohttp`. For example, you can change it to `aiohttp>=3.8.4` to allow any version greater than or equal to 3.8.4.
2. Update the `setup.py` file to read the updated `requirements.txt` file.
3. Re-upload the package to TestPyPI with the updated dependencies.

Here's the change you need to make in the `requirements.txt` file:

```plaintext

^C KeyboardInterrupt
USER: why is it trying to install multiple versions of aider-chat?
ASSISTANT: The reason pip is looking at multiple versions of `aider-chat` is that it's trying to find a version that is compatible with the other packages and their dependencies in your environment. This process is part of pip's dependency resolution mechanism.

In this case, it seems that all the versions of `aider-chat` have a conflicting dependency on `aiohttp==3.8.4`. To resolve this issue, you can try loosening the version constraint for `aiohttp` in the `requirements.txt` file, as I mentioned in my previous response. This should help pip find a compatible version of `aider-chat` that works with the other packages in your environment.
USER: I added these *read-write* files: requirements.txt
ASSISTANT: Great! Now, let's update the `requirements.txt` file to loosen the version constraint for `aiohttp`. Change the line with `aiohttp==3.8.4` to `aiohttp>=3.8.4`. Here's the change you need to make:

```plaintext
requirements.txt
<<<<<<< ORIGINAL
aiohttp==3.8.4
=======
aiohttp>=3.8.4
>>>>>>> UPDATED
```

After making this change, you can re-upload the package to TestPyPI with the updated dependencies and try installing it again.
2023-06-07 17:15:13 -07:00
Paul Gauthier
1eb9ab1b70 aider: Added regex to remove lines containing bullets with anchor links from long_description in setup.py.
# Context:
USER: also filter out the bullets which are just #anchor links to elsewhere in the readme
ASSISTANT: To filter out the bullets with anchor links in the `long_description` in `setup.py`, you can use a regular expression to remove the lines containing those links. Here's the change you need to make in `setup.py`:

```python
setup.py
<<<<<<< ORIGINAL
import re

with open("README.md", "r", encoding="utf-8") as f:
    long_description = f.read()
    long_description = re.sub(r'\n!\[.*\]\(.*\)', '', long_description)
=======
import re

with open("README.md", "r", encoding="utf-8") as f:
    long_description = f.read()
    long_description = re.sub(r'\n!\[.*\]\(.*\)', '', long_description)
    long_description = re.sub(r'\n- \[.*\]\(#.*\)', '', long_description)
>>>>>>> UPDATED
```

This change adds another `re.sub()` function to remove lines containing bullets with anchor links from the `long_description`.
2023-06-07 17:11:16 -07:00