diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml new file mode 100644 index 0000000..5502c26 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -0,0 +1,45 @@ +name: Bug report +description: Report a reproducible problem in the Python SDK. +title: "[Bug]: " +labels: + - bug +body: + - type: textarea + id: summary + attributes: + label: Summary + description: What happened, and what did you expect instead? + validations: + required: true + - type: input + id: sdk-version + attributes: + label: SDK version + placeholder: 0.3.1 + validations: + required: true + - type: input + id: python-version + attributes: + label: Python version + placeholder: 3.11.9 + validations: + required: true + - type: input + id: os + attributes: + label: Operating system + placeholder: macOS 15.4 / Ubuntu 24.04 + - type: textarea + id: reproduction + attributes: + label: Reproduction + description: Minimal code or steps to reproduce the issue. + render: python + validations: + required: true + - type: textarea + id: logs + attributes: + label: Relevant logs or tracebacks + render: text diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..b054d15 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: Knowhere documentation + url: https://docs.knowhereto.ai + about: Check the public docs before opening a support issue. + - name: Security report + url: mailto:team@knowhereto.ai?subject=Security%20report%20for%20knowhere-python-sdk + about: Report vulnerabilities privately by email. diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml new file mode 100644 index 0000000..05f8078 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -0,0 +1,25 @@ +name: Feature request +description: Propose an improvement for the Python SDK. +title: "[Feature]: " +labels: + - enhancement +body: + - type: textarea + id: problem + attributes: + label: Problem statement + description: What developer problem are you trying to solve? + validations: + required: true + - type: textarea + id: proposal + attributes: + label: Proposed solution + description: Describe the API or behavior you want to add or improve. + validations: + required: true + - type: textarea + id: alternatives + attributes: + label: Alternatives considered + description: Describe any workarounds or alternative designs you considered. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..4281c1a --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,15 @@ +## Summary + +- describe the change +- describe any public API impact + +## Verification + +- list the commands you ran +- list any manual checks you performed + +## Checklist + +- [ ] Tests were added or updated when behavior changed +- [ ] Public docs or examples were updated when needed +- [ ] The pull request description explains any breaking or user-visible change diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..7cef41e --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,29 @@ +# Code of Conduct + +We want the Knowhere Python SDK community to be respectful, constructive, and +welcoming. + +## Expected Behavior + +- Be respectful in discussions and code review. +- Assume good intent and give actionable feedback. +- Focus on technical substance instead of personal attacks. +- Help keep the project useful for a broad developer audience. + +## Unacceptable Behavior + +- Harassment, discrimination, or hateful conduct +- Threats, intimidation, or doxxing +- Spam, trolling, or intentionally disruptive behavior +- Sharing private information without permission + +## Enforcement + +Maintainers may edit or remove content, close discussions, or restrict access +when behavior harms the project or its contributors. + +To report a problem, email `team@knowhereto.ai` with: + +- the repository name +- a link or screenshot if available +- a short description of what happened diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..9cd9810 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,44 @@ +# Contributing + +Thanks for contributing to the Knowhere Python SDK. + +## Development Setup + +Requirements: + +- Python 3.9+ +- `uv` + +Clone the repository and install the full development environment: + +```bash +uv sync --all-extras +``` + +## Local Checks + +Run these commands before opening a pull request: + +```bash +uv run ruff check src/ +uv run mypy src/knowhere +uv run pytest -q +``` + +If you change public behavior, also update the relevant documentation in: + +- `README.md` +- `docs/usage.md` +- `examples/` + +## Pull Requests + +Please keep pull requests focused and easy to review. + +Recommended checklist: + +1. Add or update tests for behavior changes. +2. Keep public types and examples in sync with the implementation. +3. Document any breaking or user-visible changes in the pull request description. + +Maintainers handle versioning and release automation through GitHub Actions. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8042826 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Knowhere 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. diff --git a/README.md b/README.md index a6d3f52..1cacf09 100644 --- a/README.md +++ b/README.md @@ -273,6 +273,12 @@ We publish stable releases to [PyPI](https://pypi.org/project/knowhere-python-sd - [pydantic](https://docs.pydantic.dev/) `>=2.0.0,<3.0` - [typing-extensions](https://pypi.org/project/typing-extensions/) `>=4.7.0` +## Community + +- Contributing guide: [CONTRIBUTING.md](./CONTRIBUTING.md) +- Security policy: [SECURITY.md](./SECURITY.md) +- Code of conduct: [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) + ## License MIT diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..bd6be30 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,24 @@ +# Security Policy + +## Supported Versions + +Only the latest published release line is supported for security fixes. + +| Version | Supported | +| --- | --- | +| Latest release | Yes | +| Older releases | No | + +## Reporting a Vulnerability + +Please do not open public GitHub issues for suspected vulnerabilities. + +Instead, email `team@knowhereto.ai` with: + +- the repository name +- a clear description of the issue +- reproduction steps or a proof of concept +- impact assessment if known + +We will acknowledge the report, validate it, and coordinate remediation before +public disclosure. diff --git a/tests/test_logging.py b/tests/test_logging.py index c5db21a..4b38c04 100644 --- a/tests/test_logging.py +++ b/tests/test_logging.py @@ -18,7 +18,7 @@ class TestRedactSensitiveHeaders: def test_redacts_authorization_bearer(self) -> None: headers: Dict[str, str] = { - "Authorization": "Bearer sk_live_abc123xyz", + "Authorization": "Bearer sk_example_redacted_token", "Content-Type": "application/json", } redacted: Dict[str, str] = redactSensitiveHeaders(headers)