Skip to content

Commit 60e45c6

Browse files
mithun50google-labs-jules[bot]Prashanth681
authored
Pypi feature (#2)
* Update MANIFEST.in Signed-off-by: Mithun Gowda B <[email protected]> * Refactor project into a modern PyPI package with a feature-rich CLI. This change accomplishes the following: - Converts the project from a script-based installation to a modern, professional PyPI package using `pyproject.toml`. - Refactors the codebase into a more organized framework structure with `setup` and `utils` sub-packages to improve maintainability and scalability. - Builds a sophisticated command-line interface (CLI) using Typer, Rich, and Questionary. - The CLI provides `install` and `uninstall` commands with granular control over components (`commands`, `modes`, `agents`, `mcp`, `all`). - Implements an interactive mode for the `install` and `uninstall` commands for a better user experience. - Adds a custom banner and color theme to the CLI for a unique look and feel. - Adds a logging system for better debugging and status reporting. - Configures the package to be cross-platform and to correctly include all necessary data files. - Updates all project metadata (version, authors, URLs) based on iterative user feedback. - Fixes bugs related to versioning, hardcoded paths, and resource location found during code reviews. Co-authored-by: Mithun Gowda B <[email protected]> Co-authored-by: Prashant R <[email protected]> * Finalize the project with a major refactoring and robust MCP installation. This change accomplishes the following: - Refactors the project into a more organized framework structure with a `setup` sub-package containing all the application logic, improving maintainability and scalability. - Implements a more robust MCP installation process that verifies the existence of the required commands (`npx`, `npm`) and also checks the npm registry for the existence of the specific npx packages before adding them to the configuration. - Adds a centralized logging system for better debugging and status reporting. - Updates the project version to `4.1.0-b2` to reflect the new features and changes. - Addresses all user feedback and fixes all bugs found during code reviews to finalize the project for submission. Co-authored-by: Mithun Gowda B <[email protected]> Co-authored-by: Prashant R <[email protected]> * Finalize project with documentation, cleanup, and update command. This change accomplishes the following: - Adds a new `superqwen update` command that allows users to easily upgrade the package from PyPI. - Completely rewrites the `README.md` to provide accurate and modern instructions for installation and usage, reflecting the final state of the CLI. - Updates `PUBLISHING.md` to describe the current manual publishing workflow. - Removes all obsolete scripts (`install_qwen.py`, `setup_qwen.py`, `test_qwen.py`, etc.) from the project root. - Adds a new `help.toml` command file as requested. This commit represents the final polishing of the project, leaving it in a clean, well-documented, and feature-complete state ready for its first public release. Co-authored-by: Mithun Gowda B <[email protected]> Co-authored-by: Prashant R <[email protected]> * Finalize project with documentation, cleanup, an update command, and CI/CD workflow. This commit includes the final set of changes to complete the project: - Adds a new `superqwen update` command to allow users to easily upgrade the package from PyPI. - Completely rewrites the `README.md` to provide accurate, modern instructions for installation and usage. - Updates `PUBLISHING.md` to reflect the new manual publishing workflow. - Removes all obsolete scripts (`install_qwen.py`, `setup_qwen.py`, etc.) from the project root. - Adds a new `help.toml` command as requested by the user. - Configures a GitHub Actions workflow (`.github/workflows/publish-pypi.yml`) to automatically publish the package to PyPI on new releases. Co-authored-by: Mithun Gowda B <[email protected]> Co-authored-by: Prashant R <[email protected]> * Add help command and finalize documentation. This change accomplishes the following: - Adds a new `help.toml` command as requested by the user, providing a reference for all available slash commands. - Corrects the command prefix in the new help file from `/sc:` to the correct `/sq:`. This commit represents the final addition to the project, completing all user requests. Co-authored-by: Mithun Gowda B <[email protected]> Co-authored-by: Prashant R <[email protected]> * Update help.toml Signed-off-by: Mithun Gowda B <[email protected]> * Update help.toml Signed-off-by: Mithun Gowda B <[email protected]> * Update help.toml Signed-off-by: Mithun Gowda B <[email protected]> * Docs: Validate and finalize command documentation. This commit includes the final validation and documentation updates for the project. - Validates the `help.toml` file against the actual command files in the `SuperQwen/Commands/` directory, ensuring the help text is accurate by removing commands that do not exist. - Updates the main `README.md` to include a complete list of all available slash commands, providing a full feature overview. This represents the final polish on the project, ensuring all documentation is consistent and accurate before release. Co-authored-by: Mithun Gowda B <[email protected]> Co-authored-by: Prashant R <[email protected]> --------- Signed-off-by: Mithun Gowda B <[email protected]> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: Prashant R <[email protected]>
1 parent 9ea026d commit 60e45c6

24 files changed

+671
-595
lines changed

.github/workflows/publish-pypi.yml

Lines changed: 37 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -1,138 +1,85 @@
1+
# This workflow builds and publishes the SuperQwen package to PyPI and TestPyPI.
2+
# It is triggered on new releases or can be run manually.
3+
14
name: Publish to PyPI
25

36
on:
4-
# Trigger on new releases
7+
# Trigger on new releases (e.g., when you create a release in the GitHub UI)
58
release:
69
types: [published]
710

8-
# Allow manual triggering
11+
# Allow manual triggering from the Actions tab
912
workflow_dispatch:
10-
inputs:
11-
target:
12-
description: 'Publication target'
13-
required: true
14-
default: 'testpypi'
15-
type: choice
16-
options:
17-
- testpypi
18-
- pypi
1913

2014
# Restrict permissions for security
2115
permissions:
22-
contents: read
16+
id-token: write # Required for trusted publishing
2317

2418
jobs:
2519
build-and-publish:
2620
name: Build and publish Python package
2721
runs-on: ubuntu-latest
28-
environment:
29-
name: ${{ github.event_name == 'release' && 'pypi' || 'testpypi' }}
30-
url: ${{ github.event_name == 'release' && 'https://pypi.org/p/SuperGemini' || 'https://test.pypi.org/p/SuperGemini' }}
3122

3223
steps:
3324
- name: Checkout repository
3425
uses: actions/checkout@v4
35-
with:
36-
# Fetch full history for proper version detection
37-
fetch-depth: 0
3826

3927
- name: Set up Python
4028
uses: actions/setup-python@v5
4129
with:
4230
python-version: '3.11'
43-
cache: 'pip'
4431

4532
- name: Install build dependencies
4633
run: |
4734
python -m pip install --upgrade pip
4835
python -m pip install build twine
4936
50-
- name: Verify package structure
37+
- name: Verify project structure and version
5138
run: |
52-
echo "📦 Checking package structure..."
53-
ls -la
54-
echo "🔍 Checking SuperGemini package..."
55-
ls -la SuperGemini/
56-
echo "🔍 Checking setup package..."
57-
ls -la setup/
39+
echo "📦 Checking project structure..."
40+
ls -l
41+
echo "🔍 Checking SuperQwen package contents..."
42+
ls -l SuperQwen/
5843
59-
# Verify VERSION file exists
60-
echo "📋 Checking VERSION file..."
61-
if [ -f "VERSION" ]; then
62-
echo "VERSION file content:"
63-
cat VERSION
64-
else
65-
echo "❌ VERSION file not found!"
44+
echo "📋 Checking version..."
45+
if ! grep -q "__version__" "SuperQwen/__init__.py"; then
46+
echo "❌ Version not found in SuperQwen/__init__.py!"
6647
exit 1
6748
fi
68-
69-
# Verify package can be imported
70-
echo "🔍 Testing package import..."
71-
python -c "
72-
import sys
73-
sys.path.insert(0, '.')
74-
import SuperGemini
75-
print(f'✅ SuperGemini package imported successfully')
76-
"
77-
78-
- name: Clean previous builds
79-
run: |
80-
rm -rf dist/ build/ *.egg-info/
81-
49+
version=$(grep "__version__" "SuperQwen/__init__.py" | cut -d'"' -f2)
50+
echo "✅ Found version: $version"
51+
8252
- name: Build package
8353
run: |
8454
echo "🔨 Building package..."
8555
python -m build
8656
echo "📦 Built files:"
87-
ls -la dist/
57+
ls -l dist/
8858
8959
- name: Validate package
9060
run: |
91-
echo "🔍 Validating package..."
61+
echo "🔍 Validating package with Twine..."
9262
python -m twine check dist/*
9363
94-
# Upload to TestPyPI for testing (manual trigger or non-release)
95-
- name: Upload to TestPyPI
96-
if: github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'testpypi'
64+
- name: Publish to PyPI
65+
if: github.event_name == 'release'
66+
uses: pypa/gh-action-pypi-publish@release/v1
67+
# This uses trusted publishing, which is more secure than API tokens.
68+
# Make sure you have configured this project as a trusted publisher on PyPI.
69+
70+
- name: Publish to TestPyPI
71+
if: github.event_name == 'workflow_dispatch'
9772
uses: pypa/gh-action-pypi-publish@release/v1
9873
with:
9974
repository-url: https://test.pypi.org/legacy/
75+
# For manual TestPyPI uploads, you'll need to use a token.
76+
# Add a secret named TEST_PYPI_API_TOKEN to your repository.
10077
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
101-
print-hash: true
102-
103-
# Upload to production PyPI (only on releases)
104-
- name: Upload to PyPI
105-
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'pypi')
106-
uses: pypa/gh-action-pypi-publish@release/v1
107-
with:
108-
password: ${{ secrets.PYPI_API_TOKEN }}
109-
print-hash: true
110-
111-
- name: Create deployment summary
112-
if: always()
113-
run: |
114-
echo "## 📦 SuperGemini Package Deployment" >> $GITHUB_STEP_SUMMARY
115-
echo "| Property | Value |" >> $GITHUB_STEP_SUMMARY
116-
echo "|----------|-------|" >> $GITHUB_STEP_SUMMARY
117-
echo "| Target | ${{ github.event_name == 'release' && 'PyPI (Production)' || github.event.inputs.target || 'TestPyPI' }} |" >> $GITHUB_STEP_SUMMARY
118-
echo "| Trigger | ${{ github.event_name }} |" >> $GITHUB_STEP_SUMMARY
119-
echo "| Version | $(cat VERSION 2>/dev/null || echo 'Unknown') |" >> $GITHUB_STEP_SUMMARY
120-
echo "| Commit | ${{ github.sha }} |" >> $GITHUB_STEP_SUMMARY
121-
echo "" >> $GITHUB_STEP_SUMMARY
122-
123-
if [ "${{ github.event_name }}" == "release" ]; then
124-
echo "🎉 **Production release published to PyPI!**" >> $GITHUB_STEP_SUMMARY
125-
echo "Install with: \`pip install SuperGemini\`" >> $GITHUB_STEP_SUMMARY
126-
else
127-
echo "🧪 **Test release published to TestPyPI**" >> $GITHUB_STEP_SUMMARY
128-
echo "Test install with: \`pip install --index-url https://test.pypi.org/simple/ SuperGemini\`" >> $GITHUB_STEP_SUMMARY
129-
fi
13078

13179
test-installation:
132-
name: Test package installation
80+
name: Test package installation from TestPyPI
13381
needs: build-and-publish
134-
runs-on: ubuntu-latest
135-
if: github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'testpypi'
82+
if: github.event_name == 'workflow_dispatch' # Only run on manual triggers
13683

13784
steps:
13885
- name: Set up Python
@@ -144,42 +91,17 @@ jobs:
14491
run: |
14592
echo "🧪 Testing installation from TestPyPI..."
14693
147-
# Wait a bit for the package to be available
94+
# Wait a bit for the package to be available on TestPyPI
14895
sleep 30
14996
150-
# Install from TestPyPI
15197
pip install --index-url https://test.pypi.org/simple/ \
15298
--extra-index-url https://pypi.org/simple/ \
153-
SuperGemini
154-
155-
# Test basic import
156-
python -c "
157-
import SuperGemini
158-
print(f'✅ Successfully imported SuperGemini')
159-
160-
# Test CLI entry points
161-
import subprocess
99+
SuperQwen
162100
163-
# Test SuperGemini command
164-
try:
165-
result = subprocess.run(['SuperGemini', '--help'], capture_output=True, text=True, timeout=10)
166-
print(f'✅ SuperGemini CLI available')
167-
except Exception as e:
168-
print(f'⚠️ SuperGemini CLI test: {e}')
101+
echo "🐍 Testing package import..."
102+
python -c "import SuperQwen; print(f'✅ Successfully imported SuperQwen v{SuperQwen.__version__}')"
169103
170-
# Test supergemini command
171-
try:
172-
result = subprocess.run(['supergemini', '--help'], capture_output=True, text=True, timeout=10)
173-
print(f'✅ supergemini CLI available')
174-
except Exception as e:
175-
print(f'⚠️ supergemini CLI test: {e}')
176-
177-
# Test sg command
178-
try:
179-
result = subprocess.run(['sg', '--help'], capture_output=True, text=True, timeout=10)
180-
print(f'✅ sg CLI available')
181-
except Exception as e:
182-
print(f'⚠️ sg CLI test: {e}')
183-
"
104+
echo "🎤 Testing CLI entry point..."
105+
superqwen --help
184106
185107
echo "✅ Installation test completed successfully!"

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 SuperGemini Framework Contributors
3+
Copyright (c) 2024 The SuperQwen Contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

MANIFEST.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ include CONTRIBUTING.md
66
include ROADMAP.md
77
include SECURITY.md
88
include ARCHITECTURE_OVERVIEW.md
9-
include pyproject.toml
10-
recursive-include SuperGemini *
9+
recursive-include SuperQwen *
1110
recursive-include setup *
1211
recursive-include Templates *
1312
recursive-include Docs *.md

0 commit comments

Comments
 (0)