Skip to content

Commit d89ad83

Browse files
committed
Upgrade to 0.1.5
1 parent 012f71b commit d89ad83

File tree

6 files changed

+13
-29
lines changed

6 files changed

+13
-29
lines changed

README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,18 @@ That's it! GHPush will:
4949

5050
## ⚙️ Configuration
5151

52-
### OpenAI Integration (Optional)
52+
### OpenAI Integration (Required)
53+
54+
Set your OpenAI API key as an environment variable:
5355

54-
1. Create your configuration:
5556
```bash
56-
cp .env.example .env
57-
```
57+
# Linux/macOS
58+
export OPENAI_API_KEY=your-api-key-here
5859

59-
2. Add your OpenAI API key:
60-
```env
61-
OPENAI_API_KEY=your_openai_api_key_here
60+
# Windows (PowerShell)
61+
$env:OPENAI_API_KEY="your-api-key-here"
6262
```
6363

64-
> 💡 **Note:** GHPush works perfectly fine without AI integration, falling back to basic summarization.
65-
6664
## 🛠 Technical Requirements
6765

6866
- Python ≥ 3.8.1

ghpush/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""GHPush - Automated GitHub PR creation tool."""
22

3-
__version__ = "0.1.2"
3+
__version__ = "0.1.5"

ghpush/config.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,13 @@
22
import json
33
import os
44
from pathlib import Path
5-
from dotenv import load_dotenv
65

76
class Config:
87
def __init__(self):
98
self.config_dir = Path.home() / ".ghpush"
109
self.config_file = self.config_dir / "config.json"
1110
self._ensure_config_dir()
1211
self.config = self._load_config()
13-
14-
# Load environment variables
15-
load_dotenv()
1612

1713
def _ensure_config_dir(self):
1814
"""Ensure configuration directory exists."""
@@ -40,12 +36,5 @@ def get_github_token(self) -> str:
4036
return os.getenv('GITHUB_TOKEN') or self.config.get('github_token')
4137

4238
def get_openai_api_key():
43-
# First check environment variable
44-
api_key = os.getenv('OPENAI_API_KEY')
45-
46-
# If not found in environment, try loading from .env
47-
if not api_key:
48-
load_dotenv(silent=True) # silent=True prevents errors if .env doesn't exist
49-
api_key = os.getenv('OPENAI_API_KEY')
50-
51-
return api_key
39+
"""Get OpenAI API key from environment."""
40+
return os.getenv('OPENAI_API_KEY')

ghpush/validators.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33
import subprocess
44
from rich.console import Console
5+
from .config import get_openai_api_key
56

67
console = Console()
78

@@ -11,9 +12,7 @@ def validate_openai_key():
1112
if not api_key:
1213
raise ValueError(
1314
"OpenAI API key not found.\n\n"
14-
"To fix this, either:\n"
15-
"1. Set the OPENAI_API_KEY environment variable, or\n"
16-
"2. Create a .env file with your API key"
15+
"To fix this, set the OPENAI_API_KEY environment variable"
1716
)
1817
return api_key
1918

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "ghpush"
3-
version = "0.1.2"
3+
version = "0.1.5"
44

55
description = "AI-powered GitHub PR creation tool that automatically generates PR titles and descriptions"
66
authors = ["Your Name <[email protected]>"]
@@ -29,7 +29,6 @@ click = "^8.1.3"
2929
gitpython = "^3.1.31"
3030
rich = "^13.3.5"
3131
openai = "^1.3.0"
32-
python-dotenv = "^1.0.0"
3332

3433
[tool.poetry.group.dev.dependencies]
3534
pytest = "^7.3.1"

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ def get_version():
1515
"gitpython",
1616
"rich",
1717
"openai",
18-
"python-dotenv",
1918
],
2019
entry_points={
2120
"console_scripts": [

0 commit comments

Comments
 (0)