Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
c1bed01
docs: Move internal documentation to docs/ directory
christensen143 Aug 4, 2025
c7b3387
fix: Update GitHub Actions to use latest versions
christensen143 Aug 4, 2025
523c3d6
fix: Apply comprehensive code formatting and linting fixes
christensen143 Aug 4, 2025
e5a7ce8
fix: Apply black formatting with correct line length
christensen143 Aug 4, 2025
d3f320d
fix: Add type annotations and Python 3.7 compatibility
christensen143 Aug 4, 2025
6635c6f
fix: Correct CLI command name in status message
christensen143 Aug 4, 2025
244896e
chore: Drop Python 3.7 support
christensen143 Aug 4, 2025
6d68a1e
fix: Separate version info to avoid import issues during setup
christensen143 Aug 4, 2025
f014c06
fix: Apply black formatting to new files
christensen143 Aug 4, 2025
65506e9
fix: Disable Rich color output in tests
christensen143 Aug 4, 2025
8e73287
fix: Apply black formatting to cli.py
christensen143 Aug 4, 2025
ec01fd0
fix: Fix Rich color output in tests
christensen143 Aug 4, 2025
c9d6276
fix: Properly disable Rich colors in tests
christensen143 Aug 4, 2025
a1f7e23
fix: Use NO_COLOR env var to disable Rich colors in tests
christensen143 Aug 4, 2025
023a5cc
fix: Force non-terminal mode for Rich when NO_COLOR is set
christensen143 Aug 4, 2025
1b7d078
fix: Set NO_COLOR=1 in CI environment to prevent ANSI codes in tests
christensen143 Aug 4, 2025
d86d5c0
fix: Restore original directory after integration tests to fix Window…
christensen143 Aug 4, 2025
6d12221
test: Skip problematic integration tests on Windows platform
christensen143 Aug 4, 2025
96571c4
Potential fix for code scanning alert no. 24: File is not always closed
christensen143 Aug 4, 2025
75a8b9b
Potential fix for code scanning alert no. 26: Overly permissive file …
christensen143 Aug 4, 2025
1e3ba06
Potential fix for code scanning alert no. 23: Explicit export is not …
christensen143 Aug 4, 2025
defcfa4
Potential fix for code scanning alert no. 28: Overly permissive file …
christensen143 Aug 4, 2025
bb953c5
fix: Remove duplicate imports in __init__.py to fix flake8 E402 errors
christensen143 Aug 4, 2025
b4d65e8
fix: Properly define module exports in __init__.py
christensen143 Aug 4, 2025
ce6931f
debug: Add CI debugging and fix coverage path
christensen143 Aug 4, 2025
ada2d1e
fix: Fix test patching issues for CI compatibility
christensen143 Aug 4, 2025
05ad3d3
style: Apply black formatting to test_cli.py
christensen143 Aug 4, 2025
160a435
fix: Revert to direct patching in tests
christensen143 Aug 4, 2025
45e47b4
fix: Use importlib to ensure proper module import in tests
christensen143 Aug 4, 2025
3de972f
fix: Use direct imports instead of importlib for Python 3.10 compatib…
christensen143 Aug 4, 2025
f489206
fix: Apply black formatting to test_cli.py
christensen143 Aug 4, 2025
3c1a60a
fix: Use sys.modules for patching to ensure Python 3.8-3.10 compatibi…
christensen143 Aug 4, 2025
b8237e5
fix: Apply black formatting
christensen143 Aug 4, 2025
ee28ceb
fix: Update integration tests to use sys.modules patching for Python …
christensen143 Aug 4, 2025
8988d75
fix: Fix integration test for Bedrock API error workflow
christensen143 Aug 4, 2025
3dfed6f
style: Fix black formatting in test_integration.py
christensen143 Aug 4, 2025
0b29231
refactor: Drop support for Python 3.8 and 3.9
christensen143 Aug 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:

- name: Upload security reports
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: security-reports
path: |
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
Expand All @@ -105,7 +105,7 @@ jobs:

- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
Expand All @@ -123,7 +123,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
Expand All @@ -147,7 +147,7 @@ jobs:
claude-bedrock-setup --version

- name: Upload build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
Expand All @@ -165,13 +165,13 @@ jobs:
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'

- name: Download build artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ jobs:
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: security-extended,security-and-quality

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
Expand All @@ -45,6 +45,6 @@ jobs:
pip install -e .[dev,test]

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
6 changes: 3 additions & 3 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:

- name: Upload security reports
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: security-reports
path: |
Expand All @@ -120,7 +120,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
Expand All @@ -94,7 +94,7 @@ jobs:
pytest -v --cov=claude_setup --cov-report=xml --cov-fail-under=90

- name: Upload coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: release
Expand All @@ -113,7 +113,7 @@ jobs:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
claude-bedrock-setup --version

- name: Upload build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: release-distributions
path: dist/
Expand All @@ -174,7 +174,7 @@ jobs:
fetch-depth: 0

- name: Download build artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: release-distributions
path: dist/
Expand Down Expand Up @@ -257,7 +257,7 @@ jobs:

steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: release-distributions
path: dist/
Expand Down Expand Up @@ -286,7 +286,7 @@ jobs:

steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: release-distributions
path: dist/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/version-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'

Expand Down Expand Up @@ -198,7 +198,7 @@ jobs:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'

Expand Down
File renamed without changes.
File renamed without changes.
20 changes: 11 additions & 9 deletions run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,26 @@ def run_tests():
"""Run the test suite with coverage reporting."""
print("Running claude-setup test suite...")
print("=" * 60)

# Change to project directory
project_dir = Path(__file__).parent

try:
# Run tests with coverage
cmd = [
"pipenv", "run", "pytest",
"pipenv",
"run",
"pytest",
"tests/",
"-v",
"-v",
"--cov=src/claude_setup",
"--cov-report=term-missing",
"--cov-report=html:htmlcov",
"--cov-fail-under=95"
"--cov-fail-under=95",
]

result = subprocess.run(cmd, cwd=project_dir, check=False)

if result.returncode == 0:
print("\n" + "=" * 60)
print("✅ All tests passed! Coverage target met.")
Expand All @@ -36,7 +38,7 @@ def run_tests():
print("\n" + "=" * 60)
print("❌ Some tests failed or coverage target not met.")
sys.exit(1)

except FileNotFoundError:
print("❌ Error: pipenv not found. Please install pipenv first.")
sys.exit(1)
Expand All @@ -46,4 +48,4 @@ def run_tests():


if __name__ == "__main__":
run_tests()
run_tests()
33 changes: 24 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
import os
from setuptools import setup, find_packages


# Read version from __init__.py
def get_version():
version = {}
with open(os.path.join('src', 'claude_setup', '__init__.py')) as f:
with open(os.path.join("src", "claude_setup", "__init__.py")) as f:
exec(f.read(), version)
return version['__version__']
return version["__version__"]


# Read long description from README.md
def get_long_description():
try:
with open('README.md', 'r', encoding='utf-8') as f:
with open("README.md", "r", encoding="utf-8") as f:
return f.read()
except FileNotFoundError:
return "A command-line tool to configure Claude Desktop to use AWS Bedrock as its AI provider."
return (
"A command-line tool to configure Claude Desktop to use "
"AWS Bedrock as its AI provider."
)


setup(
name="claude-bedrock-setup",
Expand All @@ -26,10 +32,19 @@
long_description_content_type="text/markdown",
url="https://github.com/christensen143/claude-bedrock-setup",
project_urls={
"Bug Tracker": "https://github.com/christensen143/claude-bedrock-setup/issues",
"Documentation": "https://github.com/christensen143/claude-bedrock-setup#readme",
"Source Code": "https://github.com/christensen143/claude-bedrock-setup",
"Changelog": "https://github.com/christensen143/claude-bedrock-setup/blob/main/CHANGELOG.md",
"Bug Tracker": (
"https://github.com/christensen143/" "claude-bedrock-setup/issues"
),
"Documentation": (
"https://github.com/christensen143/" "claude-bedrock-setup#readme"
),
"Source Code": (
"https://github.com/christensen143/" "claude-bedrock-setup"
),
"Changelog": (
"https://github.com/christensen143/"
"claude-bedrock-setup/blob/main/CHANGELOG.md"
),
},
packages=find_packages(where="src"),
package_dir={"": "src"},
Expand Down Expand Up @@ -95,4 +110,4 @@
},
include_package_data=True,
zip_safe=False,
)
)
10 changes: 8 additions & 2 deletions src/claude_setup/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,28 @@
__description__ = "CLI tool to configure Claude Desktop for AWS Bedrock"
__url__ = "https://github.com/christensen143/claude-bedrock-setup"


# Lazy imports to avoid import issues during setup
def __getattr__(name):
if name == "cli":
from .cli import cli

return cli
elif name == "ConfigManager":
from .config_manager import ConfigManager

return ConfigManager
elif name == "AuthChecker":
from .auth_checker import AuthChecker

return AuthChecker
elif name == "AWSClient":
from .aws_client import AWSClient

return AWSClient
raise AttributeError(f"module '{__name__}' has no attribute '{name}'")


__all__ = [
"__version__",
"__author__",
Expand All @@ -38,6 +44,6 @@
"__url__",
"cli",
"ConfigManager",
"AuthChecker",
"AuthChecker",
"AWSClient",
]
]
10 changes: 7 additions & 3 deletions src/claude_setup/auth_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ def check_aws_auth():
"""Check if AWS credentials are properly configured"""
try:
# Use AWS CLI to verify credentials
result = subprocess.run(['aws', 'sts', 'get-caller-identity'],
capture_output=True, text=True, check=True)
subprocess.run(
["aws", "sts", "get-caller-identity"],
capture_output=True,
text=True,
check=True,
)
return True
except subprocess.CalledProcessError:
return False
except FileNotFoundError:
# AWS CLI not installed
return False
except Exception:
return False
return False
Loading
Loading