Skip to content
This repository was archived by the owner on Mar 9, 2026. It is now read-only.

Commit 5432b5f

Browse files
committed
Move version to it's own spot so that the app works from python package
1 parent ee626c2 commit 5432b5f

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

aicodebot/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
version = "0.2.2"

aicodebot/cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from aicodebot import version as aicodebot_version
12
from aicodebot.helpers import exec_and_get_output
23
from dotenv import find_dotenv, load_dotenv
34
from langchain.chains import LLMChain
@@ -7,7 +8,6 @@
78
from pathlib import Path
89
from rich.console import Console
910
from rich.style import Style
10-
from setup import __version__
1111
import click, datetime, openai, os, random, subprocess, sys, tempfile, webbrowser
1212

1313
# Create a Console object
@@ -51,7 +51,7 @@ def setup_environment():
5151

5252

5353
@click.group()
54-
@click.version_option(__version__, "--version", "-V")
54+
@click.version_option(aicodebot_version, "--version", "-V")
5555
@click.help_option("--help", "-h")
5656
def cli():
5757
pass
@@ -140,7 +140,7 @@ def fun_fact(verbose):
140140
@cli.command()
141141
def version():
142142
"""Print the version number."""
143-
console.print(f"AICodeBot version {__version__}")
143+
console.print(f"AICodeBot version {aicodebot_version}")
144144

145145

146146
if __name__ == "__main__":

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
from aicodebot import version
12
from pathlib import Path
23
from setuptools import find_packages, setup
34

4-
__version__ = "0.1.0"
5-
65
# Pull in the long description from the README
76
with Path("README.md").open("r", encoding="utf-8") as f:
87
long_description = f.read()
@@ -15,7 +14,7 @@
1514
setup(
1615
name="aicodebot",
1716
packages=find_packages(),
18-
version="0.2.0",
17+
version=version,
1918
url="https://github.com/novara_ai/aicodebot",
2019
author="Nick Sullivan",
2120
description="Your AI-powered coding companion: AI Code Bot 🤖",

tests/test_cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1+
from aicodebot import version as aicodebot_version
12
from aicodebot.cli import fun_fact, version
23
from click.testing import CliRunner
3-
from setup import __version__
44
import os, pytest
55

66

77
def test_version():
88
runner = CliRunner()
99
result = runner.invoke(version)
1010
assert result.exit_code == 0
11-
assert __version__ in result.output
11+
assert aicodebot_version in result.output
1212

1313

1414
@pytest.mark.skipif(os.getenv("OPENAI_API_KEY") is None, reason="Skipping live tests without an API key.")

0 commit comments

Comments
 (0)