From c594fc0b7fb5068d6c71f58442e9915a7d8bc0b4 Mon Sep 17 00:00:00 2001 From: ibrahim Date: Mon, 21 Apr 2025 08:21:01 +0000 Subject: [PATCH 1/2] Bump version to 1.0.18 --- bump_version.py | 20 +++++++++++--------- pyproject.toml | 4 ++-- qcmd_cli/__init__.py | 2 +- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/bump_version.py b/bump_version.py index 7993053..5e2bb79 100755 --- a/bump_version.py +++ b/bump_version.py @@ -131,14 +131,16 @@ def update_pyproject_toml(new_version: str) -> None: def main(): """Main entry point for the script.""" parser = argparse.ArgumentParser(description="Bump the QCMD version number") - parser.add_argument('bump_type', choices=['major', 'minor', 'patch'], - help="Type of version bump to perform") + group = parser.add_mutually_exclusive_group(required=True) + group.add_argument('--bump', choices=['major', 'minor', 'patch'], + help="Type of version bump to perform") + group.add_argument('--version', action='store_true', + help="Show the current version and exit") + group.add_argument('--set', metavar='VERSION', + help="Set the version to a specific value") + parser.add_argument('--legacy', action='store_true', - help="Also update version in legacy files for backward compatibility") - parser.add_argument('--version', action='store_true', - help="Show the current version and exit") - parser.add_argument('--set', metavar='VERSION', - help="Set the version to a specific value") + help="Also update version in legacy files for backward compatibility") args = parser.parse_args() @@ -156,7 +158,7 @@ def main(): return new_version = args.set else: - new_version = bump_version(current_version, args.bump_type) + new_version = bump_version(current_version, args.bump) print(f"Bumping version: {current_version} -> {new_version}") @@ -175,4 +177,4 @@ def main(): print(f"Error: {e}") if __name__ == "__main__": - main() \ No newline at end of file + main() \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index c453355..d0fce6d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta" [project] # This uses the PyPI-optimized README for better display on PyPI -name = "ibrahimiq-qcmd" -version = "1.1.0" +name = "iqcmd" +version = "1.0.18" authors = [ {name = "Ibrahim IQ", email = "example@example.com"} ] diff --git a/qcmd_cli/__init__.py b/qcmd_cli/__init__.py index 82a0074..bc55d80 100644 --- a/qcmd_cli/__init__.py +++ b/qcmd_cli/__init__.py @@ -8,7 +8,7 @@ __version__ = get_version() except ImportError: # Fallback for backward compatibility - __version__ = "1.0.16" + __version__ = "1.0.18" # Don't import modules here to avoid circular dependencies From ff229972214786673a7cc7ea236e8643ceda4250 Mon Sep 17 00:00:00 2001 From: ibrahim Date: Sat, 26 Apr 2025 18:54:38 +0000 Subject: [PATCH 2/2] Add documentation auto-update workflow --- .github/scripts/update_docs.py | 126 ++++++++++++++++++++++++++++++ .github/workflows/update-docs.yml | 39 +++++++++ requirements.txt | 3 +- 3 files changed, 167 insertions(+), 1 deletion(-) create mode 100644 .github/scripts/update_docs.py create mode 100644 .github/workflows/update-docs.yml diff --git a/.github/scripts/update_docs.py b/.github/scripts/update_docs.py new file mode 100644 index 0000000..e828965 --- /dev/null +++ b/.github/scripts/update_docs.py @@ -0,0 +1,126 @@ +import markdown +import os +from jinja2 import Template + +def update_documentation(): + # Read the README content + with open('README.md', 'r', encoding='utf-8') as f: + readme_content = f.read() + + # Convert markdown to HTML + html_content = markdown.markdown(readme_content, extensions=['fenced_code', 'tables']) + + # HTML template + template_str = """ + + + + + + qcmd - AI-powered Command Generator + + + +
+
+

qcmd Documentation

+

AI-powered Command Generator using Local LLMs

+
+
+ +
+ {{ content }} +
+ + + + +""" + + # Create template and render + template = Template(template_str) + rendered_html = template.render( + content=html_content, + last_updated=datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + ) + + # Write the output file + with open('qcmd-docs.html', 'w', encoding='utf-8') as f: + f.write(rendered_html) + +if __name__ == '__main__': + import datetime + update_documentation() + print("Documentation updated successfully!") \ No newline at end of file diff --git a/.github/workflows/update-docs.yml b/.github/workflows/update-docs.yml new file mode 100644 index 0000000..9f42e68 --- /dev/null +++ b/.github/workflows/update-docs.yml @@ -0,0 +1,39 @@ +name: Update Documentation + +on: + push: + paths: + - 'README.md' + branches: + - main + pull_request: + paths: + - 'README.md' + +jobs: + update-docs: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install markdown jinja2 + + - name: Update HTML documentation + run: python .github/scripts/update_docs.py + + - name: Commit and push changes + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add qcmd-docs.html + git commit -m "Update documentation from README.md" || exit 0 + git push \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index d569872..36802fe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,5 @@ configparser>=5.0.0 pytest>=7.0.0 coverage>=6.0.0 twine>=4.0.0 -wheel>=0.40.0 \ No newline at end of file +wheel>=0.40.0 +markdown \ No newline at end of file