aider/setup.py
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

28 lines
847 B
Python

from setuptools import find_packages, setup
with open("requirements.txt") as f:
requirements = f.read().splitlines()
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__,
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",
)