diff --git a/.gitignore b/.gitignore index df9efed898d..f09237cb52b 100644 --- a/.gitignore +++ b/.gitignore @@ -11,5 +11,6 @@ _site .jekyll-cache/ .jekyll-metadata aider/__version__.py +aider/_version.py .venv/ .gitattributes diff --git a/aider/__init__.py b/aider/__init__.py index 9b25fae7c58..c25992a6ccd 100644 --- a/aider/__init__.py +++ b/aider/__init__.py @@ -4,14 +4,17 @@ safe_version = __version__ try: - from aider.__version__ import __version__ + from aider._version import __version__ except Exception: - __version__ = safe_version + ".import" + __version__ = safe_version + "+import" -try: - if version.parse(__version__) < version.parse(safe_version): - __version__ = safe_version + ".less" -except Exception: - __version__ = safe_version + ".parse" +if type(__version__) is not str: + __version__ = safe_version + "+type" +else: + try: + if version.parse(__version__) < version.parse(safe_version): + __version__ = safe_version + "+less" + except Exception: + __version__ = safe_version + "+parse" __all__ = [__version__] diff --git a/aider/commands.py b/aider/commands.py index a06a9ba2cf0..08c5f3ea2c5 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -914,7 +914,7 @@ def cmd_exit(self, args): def cmd_quit(self, args): "Exit the application" - sys.exit() + self.cmd_exit(args) def cmd_ls(self, args): "List all known files and indicate which are included in the chat session" diff --git a/aider/main.py b/aider/main.py index 47cb51cc6c5..2a48b4301bf 100644 --- a/aider/main.py +++ b/aider/main.py @@ -949,6 +949,10 @@ def is_first_run_of_new_version(io, verbose=False): installs_file = Path.home() / ".aider" / "installs.json" key = (__version__, sys.executable) + # Never show notes for .dev versions + if ".dev" in __version__: + return False + if verbose: io.tool_output( f"Checking imports for version {__version__} and executable {sys.executable}" diff --git a/pyproject.toml b/pyproject.toml index 0d0ef3eae21..1788085ae9b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,7 +67,7 @@ requires = ["setuptools>=68", "setuptools_scm[toml]>=8"] build-backend = "setuptools.build_meta" [tool.setuptools_scm] -write_to = "aider/__version__.py" +write_to = "aider/_version.py" [tool.codespell] skip = "*.svg,Gemfile.lock"