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
18 changes: 18 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Contributing

This repository holds the source of `mixedbread on PyPI`. The code is generated from Mixedbread's OpenAPI
specification inside our monorepo and mirrored here on every change, one commit per monorepo
commit; a GitHub release is created whenever the version changes, and the workflow in this
repository publishes it.

Because of that, pull requests against this repository cannot be merged: the next mirror would
overwrite them. Instead:

- **Bugs and feature requests**: open an issue here. We port the change into the monorepo, and it
shows up here with the next mirror.
- **Hand-written helpers** (under `src/mixedbread/lib/`): also welcome as an issue or a PR that we use as a
reference while porting.

Every mirrored commit has passed the monorepo's checks: generator tests, freshness of the
generated code against the specification, lint, type checks and the test suite against a mock
server. The `CI` workflow here repeats lint, type checks and the build.
115 changes: 22 additions & 93 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,104 +1,33 @@
name: CI

# Lints, type-checks and builds the package. The code in this repository is generated from
# Mixedbread's monorepo, whose CI also runs the test suite against a mock server before a
# change reaches main here.

on:
push:
branches:
- '**'
- '!integrated/**'
- '!stl-preview-head/**'
- '!stl-preview-base/**'
- '!generated'
- '!codegen/**'
- 'codegen/stl/**'
branches: [main]
pull_request:
branches-ignore:
- 'stl-preview-head/**'
- 'stl-preview-base/**'

jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/mixedbread-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
name: lint and build
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'

- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v7
with:
version: "0.8.16"
- name: Install dependencies
run: rye sync --all-features

- name: Run lints
run: ./scripts/lint

build:
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
timeout-minutes: 10
name: build
permissions:
contents: read
id-token: write
runs-on: ${{ github.repository == 'stainless-sdks/mixedbread-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install Rye
run: uv sync --locked --group dev --all-extras
- name: Lint
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'

- name: Install dependencies
run: rye sync --all-features

- name: Run build
run: rye build

- name: Get GitHub OIDC Token
if: |-
github.repository == 'stainless-sdks/mixedbread-python' &&
!startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Upload tarball
if: |-
github.repository == 'stainless-sdks/mixedbread-python' &&
!startsWith(github.ref, 'refs/heads/stl/')
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
SHA: ${{ github.sha }}
run: ./scripts/utils/upload-artifact.sh

test:
timeout-minutes: 10
name: test
runs-on: ${{ github.repository == 'stainless-sdks/mixedbread-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install Rye
uv run ruff check .
uv run ruff format --check .
- name: Type-check
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'

- name: Bootstrap
run: ./scripts/bootstrap

- name: Run tests
run: ./scripts/test
uv run pyright
uv run mypy .
- name: Build
run: uv build
37 changes: 18 additions & 19 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
# This workflow is triggered when a GitHub release is created.
# It can also be run manually to re-publish to PyPI in case it failed for some reason.
# You can run this workflow by navigating to https://www.github.com/mixedbread-ai/mixedbread-python/actions/workflows/publish-pypi.yml
name: Publish PyPI

# Runs when a GitHub release is published (the monorepo creates one per new version) and can be
# re-run manually if a publish failed. Publishes through PyPI trusted publishing; set the
# PYPI_TOKEN secret to publish with an API token instead.

on:
workflow_dispatch:

release:
types: [published]

jobs:
publish:
name: publish
runs-on: ubuntu-latest

environment: pypi
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'

- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v7
with:
version: "0.8.16"
- name: Build
run: uv build
- name: Publish to PyPI
run: |
bash ./bin/publish-pypi
env:
PYPI_TOKEN: ${{ secrets.MIXEDBREAD_PYPI_TOKEN || secrets.PYPI_TOKEN }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
21 changes: 0 additions & 21 deletions .github/workflows/release-doctor.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .release-please-manifest.json

This file was deleted.

66 changes: 0 additions & 66 deletions release-please-config.json

This file was deleted.

Loading