Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 11 additions & 5 deletions .github/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The workflow follows semantic versioning:
### What Happens During Release

1. **Version Update**: Updates `__version__` in `src/apihub_client/__init__.py`
2. **Git Operations**:
2. **Git Operations**:
- Commits version change to main branch
- Creates and pushes git tag (e.g., `v1.2.3`)
3. **Quality Checks**:
Expand All @@ -67,8 +67,9 @@ And these repository variables:
- `PUSH_TO_MAIN_APP_ID`: GitHub App ID (can be same as secret)

**PyPI Setup**: This workflow uses PyPI Trusted Publishers with `uv publish` for secure publishing. You need to:

1. Configure the GitHub repository as a trusted publisher on PyPI
2. Set up the trusted publisher for the `apihub-python-client` package
2. Set up the trusted publisher for the `apihub-python-client` package
3. No API tokens required - `uv publish` automatically handles OIDC authentication

## Manual Release Workflow
Expand Down Expand Up @@ -114,21 +115,25 @@ The `publish-on-release.yml` workflow runs when you manually create a release th
### Common Issues

**Workflow fails at version bump:**

- Check that the current version in `__init__.py` follows semantic versioning
- Ensure the main branch is up to date

**Tests fail during release:**

- Check the latest test results on main branch
- Fix failing tests before attempting release

**PyPI publish fails:**
- Verify PyPI Trusted Publisher is configured correctly

- Verify PyPI Trusted Publisher is configured correctly
- Check if version already exists on PyPI
- Ensure package builds successfully locally with `uv build`
- Verify the repository and workflow file match the trusted publisher configuration
- Check that `uv publish` has proper OIDC token access (requires `id-token: write` permission)

**Permission errors:**

- Verify GitHub App has necessary permissions
- Check that secrets and variables are properly configured

Expand Down Expand Up @@ -180,6 +185,7 @@ To configure PyPI Trusted Publishers:
- **Environment name**: Leave empty (unless using GitHub environments)
3. **Save the configuration**

For more details, see:
For more details, see:

- https://docs.pypi.org/trusted-publishers/
- https://docs.astral.sh/uv/guides/publish/#trusted-publishing
- https://docs.astral.sh/uv/guides/publish/#trusted-publishing
65 changes: 65 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-toml
- id: debug-statements
- id: mixed-line-ending

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.15
hooks:
- id: ruff
args: [--fix]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
additional_dependencies:
- types-requests
- pydantic
- typing-extensions
- pytest
- requests-mock
args:
[
--ignore-missing-imports,
--no-strict-optional,
--allow-untyped-defs,
--disable-error-code=no-any-return,
]
exclude: ^test/

- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
hooks:
- id: bandit
args: [-c, pyproject.toml]
additional_dependencies: ["bandit[toml]"]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
types_or: [yaml, markdown, json]
exclude: ^(uv\.lock|\.coverage)$

ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit hooks

for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_branch: ""
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
autoupdate_schedule: weekly
skip: []
submodules: false
4 changes: 3 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ This document contains critical information about working with this codebase. Fo
## Core Development Rules

1. Package Management

- ONLY use uv, NEVER pip
- Installation: `uv add package`
- Running tools: `uv run tool`
- Upgrading: `uv add --dev package --upgrade-package package`
- FORBIDDEN: `uv pip install`, `@latest` syntax

2. Code Quality

- Type hints required for all code
- Functions must be focused and small
- Follow existing patterns exactly
Expand All @@ -23,7 +25,6 @@ This document contains critical information about working with this codebase. Fo
- New features require tests
- Bug fixes require regression tests


## Python Tools

## Code Formatting
Expand All @@ -44,6 +45,7 @@ This document contains critical information about working with this codebase. Fo
## Error Resolution

2. Common Issues

- Line length:
- Break strings with parentheses
- Multi-line function calls
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 Unstract Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading