Skip to content

Commit dd8c61b

Browse files
committed
Merge origin/main into refactor/replace-mypy-with-ty
Resolved conflict in pyproject.toml: - Keep coverage configuration from main - Remove mypy configuration (replaced by ty in this branch)
2 parents 416a843 + 0ef05cf commit dd8c61b

22 files changed

+149
-96
lines changed

.claude/rules/no-relative-imports.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Standards for using absolute imports instead of relative imports in Python files
1212

1313
- Always use absolute imports starting with the full package name (`stackone_ai`)
1414
- Never use relative imports (`.` or `..`)
15-
- Keep imports organised and grouped
15+
- Keep imports organized and grouped
1616

1717
## Examples
1818

.env_example

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/workflows/ci.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ concurrency:
1212

1313
permissions:
1414
contents: read
15+
pages: write
16+
id-token: write
1517

1618
jobs:
1719
typos:
@@ -59,3 +61,46 @@ jobs:
5961

6062
- name: Run Tests
6163
run: nix develop --command just test
64+
65+
coverage:
66+
runs-on: ubuntu-latest
67+
if: github.ref == 'refs/heads/main'
68+
env:
69+
STACKONE_API_KEY: ${{ secrets.STACKONE_API_KEY }}
70+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
71+
steps:
72+
- name: Checkout repository
73+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
74+
75+
- name: Setup Nix
76+
uses: ./.github/actions/setup-nix
77+
78+
- name: Install dependencies
79+
run: nix develop --command just install --all-extras
80+
81+
- name: Run Tests with Coverage
82+
run: nix develop --command just coverage
83+
84+
- name: Create Coverage Badge
85+
uses: jaywcjlove/coverage-badges-cli@bd6ccbf422c0ed54c01f283019fd2bc648f58541 # v2.2.0
86+
with:
87+
source: coverage/coverage.json
88+
output: coverage/badges.svg
89+
jsonPath: totals.percent_covered
90+
91+
- name: Upload coverage artifact
92+
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v3.0.2
93+
with:
94+
path: coverage/
95+
96+
deploy-coverage:
97+
needs: coverage
98+
runs-on: ubuntu-latest
99+
if: github.ref == 'refs/heads/main'
100+
environment:
101+
name: github-pages
102+
url: ${{ steps.deployment.outputs.page_url }}
103+
steps:
104+
- name: Deploy to GitHub Pages
105+
id: deployment
106+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
.pytest_cache
66
.python-version
77
__pycache__
8+
.coverage
9+
coverage/
810

911
.DS_Store
1012

.vscode/settings.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![PyPI version](https://badge.fury.io/py/stackone-ai.svg)](https://badge.fury.io/py/stackone-ai)
44
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/StackOneHQ/stackone-ai-python)](https://github.com/StackOneHQ/stackone-ai-python/releases)
5+
[![Coverage](https://stackonehq.github.io/stackone-ai-python/badges.svg)](https://stackonehq.github.io/stackone-ai-python/html/)
56

67
StackOne AI provides a unified interface for accessing various SaaS tools through AI-friendly APIs.
78

@@ -358,25 +359,6 @@ For more examples, check out the [examples/](examples/) directory:
358359
- [CrewAI Integration](examples/crewai_integration.py)
359360
- [Meta Tools](examples/meta_tools_example.py)
360361

361-
## Migration from `get_tools()` to `fetch_tools()`
362-
363-
If you're upgrading from a previous version that used `get_tools()`, here's how to migrate:
364-
365-
```python
366-
# Before (deprecated)
367-
tools = toolset.get_tools("hris_*", account_id="acc-123")
368-
369-
# After
370-
tools = toolset.fetch_tools(actions=["hris_*"], account_ids=["acc-123"])
371-
```
372-
373-
Key differences:
374-
375-
- `fetch_tools()` uses keyword arguments for all filtering
376-
- `account_id` becomes `account_ids` (list)
377-
- Filter patterns go in the `actions` parameter (list)
378-
- `fetch_tools()` requires the MCP extra (`pip install 'stackone-ai[mcp]'`)
379-
380362
## License
381363

382364
Apache 2.0 License

examples/crewai_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
def crewai_integration():
2020
toolset = StackOneToolSet()
21-
tools = toolset.fetch_tools(actions=["hris_*"], account_ids=[account_id])
21+
tools = toolset.fetch_tools(actions=["bamboohr_*"], account_ids=[account_id])
2222

2323
# CrewAI uses LangChain tools natively
2424
langchain_tools = tools.to_langchain()

examples/file_uploads.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
Example demonstrating file upload functionality using StackOne.
3-
Shows how to upload an employee document using an HRIS integration.
3+
Shows how to upload an employee document using a BambooHR integration.
44
55
This example is runnable with the following command:
66
```bash
@@ -24,7 +24,7 @@
2424
"""
2525
# Resume content
2626
27-
This is a sample resume content that will be uploaded using the `hris_upload_employee_document` tool.
27+
This is a sample resume content that will be uploaded using the `bamboohr_upload_employee_document` tool.
2828
"""
2929

3030
resume_content = """
@@ -46,7 +46,7 @@
4646
"""
4747
# Upload employee document
4848
49-
This function uploads a resume using the `hris_upload_employee_document` tool.
49+
This function uploads a resume using the `bamboohr_upload_employee_document` tool.
5050
5151
"""
5252

@@ -57,9 +57,9 @@ def upload_employee_document() -> None:
5757
resume_file.write_text(resume_content)
5858

5959
toolset = StackOneToolSet()
60-
tools = toolset.fetch_tools(actions=["hris_*"], account_ids=[account_id])
60+
tools = toolset.fetch_tools(actions=["bamboohr_*"], account_ids=[account_id])
6161

62-
upload_tool = tools.get_tool("hris_upload_employee_document")
62+
upload_tool = tools.get_tool("bamboohr_upload_employee_document")
6363
assert upload_tool is not None
6464

6565
with open(resume_file, "rb") as f:

examples/index.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
StackOne AI SDK provides an AI-friendly interface for accessing various SaaS tools through the StackOne Unified API.
2+
StackOne AI SDK provides an AI-friendly interface for accessing various SaaS tools through the StackOne API.
33
44
This SDK is available on [PyPI](https://pypi.org/project/stackone-ai/) for python projects. There is a node version in the works.
55
@@ -72,11 +72,11 @@
7272
def quickstart():
7373
toolset = StackOneToolSet()
7474

75-
# Get all HRIS-related tools using MCP-backed fetch_tools()
76-
tools = toolset.fetch_tools(actions=["hris_*"], account_ids=[account_id])
75+
# Get all BambooHR-related tools using MCP-backed fetch_tools()
76+
tools = toolset.fetch_tools(actions=["bamboohr_*"], account_ids=[account_id])
7777

7878
# Use a specific tool
79-
employee_tool = tools.get_tool("hris_list_employees")
79+
employee_tool = tools.get_tool("bamboohr_list_employees")
8080
assert employee_tool is not None
8181

8282
employees = employee_tool.execute()

examples/langchain_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
def langchain_integration() -> None:
2121
toolset = StackOneToolSet()
22-
tools = toolset.fetch_tools(actions=["hris_*"], account_ids=[account_id])
22+
tools = toolset.fetch_tools(actions=["bamboohr_*"], account_ids=[account_id])
2323

2424
# Convert to LangChain format and verify
2525
langchain_tools = tools.to_langchain()

0 commit comments

Comments
 (0)