Skip to content

Commit 8f2ea79

Browse files
author
Shahar Carmi
committed
adding publish.yml
1 parent b23c9b4 commit 8f2ea79

File tree

6 files changed

+43
-28
lines changed

6 files changed

+43
-28
lines changed

publish.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Set up Python
13+
uses: actions/setup-python@v5
14+
with:
15+
python-version: "3.9"
16+
17+
- name: Install build dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install build twine
21+
22+
- name: Build package
23+
run: python -m build
24+
25+
- name: Publish to PyPI
26+
env:
27+
TWINE_USERNAME: __token__
28+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
29+
run: twine upload dist/*

tests/enes/chatgpt_02.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,7 @@ async def test_chatgpt():
218218
print("\n" + "=" * 60)
219219
print("SUMMARY:")
220220
print("-" * 40)
221-
print(
222-
"""
221+
print("""
223222
ChatGPT Scraper Configuration:
224223
- Dataset ID: gd_m7aof0k82r803d5bjm
225224
- Platform: chatgpt
@@ -237,8 +236,7 @@ async def test_chatgpt():
237236
1. Check API token is valid
238237
2. Verify account has ChatGPT access enabled
239238
3. Check account balance for ChatGPT operations
240-
"""
241-
)
239+
""")
242240

243241

244242
if __name__ == "__main__":

tests/enes/serp.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,15 @@ def capture_raw(data):
107107
print("\n" + "=" * 60)
108108
print("SUMMARY:")
109109
print("-" * 40)
110-
print(
111-
"""
110+
print("""
112111
The SERP API returns raw HTML but the SDK expects parsed JSON.
113112
This is why all SERP searches return 0 results.
114113
115114
To fix this, either:
116115
1. The SERP zone needs to return parsed data (not raw HTML)
117116
2. The SDK needs an HTML parser (BeautifulSoup, etc.)
118117
3. A different Bright Data service/endpoint should be used
119-
"""
120-
)
118+
""")
121119

122120

123121
if __name__ == "__main__":

tests/enes/zones/cache_fix.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ async def demo_caching():
6666
print("\n\n" + "=" * 70)
6767
print("📝 RECOMMENDATIONS:")
6868
print("=" * 70)
69-
print(
70-
"""
69+
print("""
7170
✅ For listing zones after creation/deletion:
7271
Use: await client.list_zones()
7372
@@ -79,8 +78,7 @@ async def demo_caching():
7978
8079
⚠️ AVOID: Using get_account_info()['zones'] without refresh
8180
This returns cached data that may be stale!
82-
"""
83-
)
81+
""")
8482
print("=" * 70)
8583

8684
# Show some zones

tests/enes/zones/dash_sync.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ async def verify_dashboard_sync():
6161
print("\n" + "=" * 70)
6262
print("✅ VERIFICATION COMPLETE")
6363
print("=" * 70)
64-
print(
65-
"""
64+
print("""
6665
These zones should match exactly what you see in your dashboard at:
6766
https://brightdata.com/cp/zones
6867
@@ -74,8 +73,7 @@ async def verify_dashboard_sync():
7473
7574
✅ If they match: SDK and dashboard are in sync!
7675
❌ If they don't: There may be a caching or API delay issue
77-
"""
78-
)
76+
""")
7977

8078
return True
8179

tests/enes/zones/permission.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ async def test_permission_error_handling():
2424
print("🧪 TESTING PERMISSION ERROR HANDLING")
2525
print("=" * 70)
2626

27-
print(
28-
"""
27+
print("""
2928
This test demonstrates the improved error handling when your API token
3029
lacks zone creation permissions.
3130
@@ -34,8 +33,7 @@ async def test_permission_error_handling():
3433
✅ Direct link to fix the problem
3534
✅ No silent failures
3635
✅ Helpful instructions for users
37-
"""
38-
)
36+
""")
3937

4038
if not os.environ.get("BRIGHTDATA_API_TOKEN"):
4139
print("\n❌ ERROR: No API token found")
@@ -76,17 +74,15 @@ async def test_permission_error_handling():
7674
print("\n" + "=" * 70)
7775
print("📝 This is the IMPROVED error handling!")
7876
print("=" * 70)
79-
print(
80-
"""
77+
print("""
8178
Before: Error was unclear and could fail silently
8279
After: Clear message with actionable steps to fix the issue
8380
8481
The error message should have told you:
8582
1. ❌ What went wrong (permission denied)
8683
2. 🔗 Where to fix it (https://brightdata.com/cp/setting/users)
8784
3. 📋 What to do (enable zone creation permission)
88-
"""
89-
)
85+
""")
9086
return True # This is expected behavior
9187

9288
except Exception as e:
@@ -105,15 +101,13 @@ async def test_permission_error_handling():
105101
if success:
106102
print("✅ TEST PASSED")
107103
print("=" * 70)
108-
print(
109-
"""
104+
print("""
110105
Summary:
111106
• Permission errors are now caught and displayed clearly
112107
• Users get actionable instructions to fix the problem
113108
• No more silent failures
114109
• SDK provides helpful guidance
115-
"""
116-
)
110+
""")
117111
else:
118112
print("❌ TEST FAILED")
119113
print("=" * 70)

0 commit comments

Comments
 (0)