Skip to content

Commit 66dc0e8

Browse files
Reformatted with black
1 parent 1d966d4 commit 66dc0e8

File tree

3 files changed

+93
-6
lines changed

3 files changed

+93
-6
lines changed

docs/example.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
name: Build distribution 📦
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
persist-credentials: false
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.x'
18+
- name: Install pypa/build
19+
run: >-
20+
python3 -m
21+
pip install
22+
build
23+
--user
24+
- name: Build a binary wheel and a source tarball
25+
run: python3 -m build
26+
- name: Store the distribution packages
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: python-package-distributions
30+
path: dist/
31+
32+
publish-to-pypi:
33+
name: >-
34+
Publish Python 🐍 distribution 📦 to PyPI
35+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
36+
needs:
37+
- build
38+
runs-on: ubuntu-latest
39+
environment:
40+
name: pypi
41+
url: https://pypi.org/p/<package-name> # Replace <package-name> with your PyPI project name
42+
permissions:
43+
id-token: write # IMPORTANT: mandatory for trusted publishing
44+
45+
steps:
46+
- name: Download all the dists
47+
uses: actions/download-artifact@v4
48+
with:
49+
name: python-package-distributions
50+
path: dist/
51+
- name: Publish distribution 📦 to PyPI
52+
uses: pypa/gh-action-pypi-publish@release/v1
53+
54+
publish-to-testpypi:
55+
name: Publish Python 🐍 distribution 📦 to TestPyPI
56+
needs:
57+
- build
58+
runs-on: ubuntu-latest
59+
60+
environment:
61+
name: testpypi
62+
url: https://test.pypi.org/p/<package-name>
63+
64+
permissions:
65+
id-token: write # IMPORTANT: mandatory for trusted publishing
66+
67+
steps:
68+
- name: Download all the dists
69+
uses: actions/download-artifact@v4
70+
with:
71+
name: python-package-distributions
72+
path: dist/
73+
- name: Publish distribution 📦 to TestPyPI
74+
uses: pypa/gh-action-pypi-publish@release/v1
75+
with:
76+
repository-url: https://test.pypi.org/legacy/

src/claude_setup/aws_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def list_claude_models(self) -> List[Dict[str, str]]:
5050
except subprocess.CalledProcessError as e:
5151
if "AccessDeniedException" in e.stderr:
5252
raise Exception(
53-
"Access denied. Please check your AWS " "permissions for Amazon Bedrock."
53+
"Access denied. Please check your AWS "
54+
"permissions for Amazon Bedrock."
5455
)
5556
elif "not authorized" in e.stderr:
5657
raise Exception(

src/claude_setup/cli.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ def setup(region: str, non_interactive: bool) -> None:
4848
console.print("\nPlease authenticate with AWS using one of these " "methods:")
4949
console.print(" • aws configure")
5050
console.print(
51-
" • Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY " "environment variables"
51+
" • Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY "
52+
"environment variables"
5253
)
5354
console.print(" • Use AWS SSO: aws sso login")
5455
console.print("\nThen run this command again.")
@@ -60,7 +61,9 @@ def setup(region: str, non_interactive: bool) -> None:
6061
bedrock_client = BedrockClient(region)
6162

6263
# Get available models
63-
console.print(f"\n[yellow]Fetching available Claude models from " f"{region}...[/yellow]")
64+
console.print(
65+
f"\n[yellow]Fetching available Claude models from " f"{region}...[/yellow]"
66+
)
6467
models = bedrock_client.list_claude_models()
6568

6669
if not models:
@@ -71,7 +74,10 @@ def setup(region: str, non_interactive: bool) -> None:
7174
# Select model
7275
if non_interactive and models:
7376
selected_model = models[0]
74-
console.print(f"[yellow]Using first available model: " f"{selected_model['name']}[/yellow]")
77+
console.print(
78+
f"[yellow]Using first available model: "
79+
f"{selected_model['name']}[/yellow]"
80+
)
7581
else:
7682
console.print("\n[bold]Available Claude models:[/bold]")
7783
for idx, model in enumerate(models, 1):
@@ -119,7 +125,9 @@ def status() -> None:
119125

120126
if not settings:
121127
console.print("[yellow]No configuration found.[/yellow]")
122-
console.print("Run 'claude-bedrock-setup setup' to configure Claude for " "AWS Bedrock.")
128+
console.print(
129+
"Run 'claude-bedrock-setup setup' to configure Claude for " "AWS Bedrock."
130+
)
123131
return
124132

125133
console.print(Panel.fit(Text("Claude Bedrock Configuration", style="bold blue")))
@@ -137,7 +145,9 @@ def status() -> None:
137145

138146

139147
@cli.command()
140-
@click.confirmation_option(prompt="Are you sure you want to reset the " "configuration?")
148+
@click.confirmation_option(
149+
prompt="Are you sure you want to reset the " "configuration?"
150+
)
141151
def reset() -> None:
142152
"""Reset Claude Bedrock configuration"""
143153
config_manager = ConfigManager()

0 commit comments

Comments
 (0)