|  | 
| 1 |  | -name: ci | 
|  | 1 | +name: CI | 
|  | 2 | +on: | 
|  | 3 | +  push: | 
|  | 4 | +    branches-ignore: | 
|  | 5 | +      - 'generated' | 
|  | 6 | +      - 'codegen/**' | 
|  | 7 | +      - 'integrated/**' | 
|  | 8 | +      - 'stl-preview-head/**' | 
|  | 9 | +      - 'stl-preview-base/**' | 
|  | 10 | +  pull_request: | 
|  | 11 | +    branches-ignore: | 
|  | 12 | +      - 'stl-preview-head/**' | 
|  | 13 | +      - 'stl-preview-base/**' | 
| 2 | 14 | 
 | 
| 3 |  | -on: [push] | 
| 4 | 15 | jobs: | 
| 5 |  | -  compile: | 
| 6 |  | -    runs-on: ubuntu-latest | 
|  | 16 | +  lint: | 
|  | 17 | +    timeout-minutes: 10 | 
|  | 18 | +    name: lint | 
|  | 19 | +    runs-on: ${{ github.repository == 'stainless-sdks/letta-sdk-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} | 
|  | 20 | +    if: github.event_name == 'push' || github.event.pull_request.head.repo.fork | 
| 7 | 21 |     steps: | 
| 8 |  | -      - name: Checkout repo | 
| 9 |  | -        uses: actions/checkout@v3 | 
| 10 |  | -      - name: Set up python | 
| 11 |  | -        uses: actions/setup-python@v4 | 
| 12 |  | -        with: | 
| 13 |  | -          python-version: 3.8 | 
| 14 |  | -      - name: Bootstrap poetry | 
|  | 22 | +      - uses: actions/checkout@v4 | 
|  | 23 | + | 
|  | 24 | +      - name: Install Rye | 
| 15 | 25 |         run: | | 
| 16 |  | -          curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 | 
|  | 26 | +          curl -sSf https://rye.astral.sh/get | bash | 
|  | 27 | +          echo "$HOME/.rye/shims" >> $GITHUB_PATH | 
|  | 28 | +        env: | 
|  | 29 | +          RYE_VERSION: '0.44.0' | 
|  | 30 | +          RYE_INSTALL_OPTION: '--yes' | 
|  | 31 | + | 
| 17 | 32 |       - name: Install dependencies | 
| 18 |  | -        run: poetry install | 
| 19 |  | -      - name: Compile | 
| 20 |  | -        run: poetry run mypy . | 
| 21 |  | -  test: | 
| 22 |  | -    runs-on: ubuntu-latest | 
|  | 33 | +        run: rye sync --all-features | 
|  | 34 | + | 
|  | 35 | +      - name: Run lints | 
|  | 36 | +        run: ./scripts/lint | 
|  | 37 | + | 
|  | 38 | +  build: | 
|  | 39 | +    if: github.event_name == 'push' || github.event.pull_request.head.repo.fork | 
|  | 40 | +    timeout-minutes: 10 | 
|  | 41 | +    name: build | 
|  | 42 | +    permissions: | 
|  | 43 | +      contents: read | 
|  | 44 | +      id-token: write | 
|  | 45 | +    runs-on: ${{ github.repository == 'stainless-sdks/letta-sdk-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} | 
| 23 | 46 |     steps: | 
| 24 |  | -      - name: Checkout repo | 
| 25 |  | -        uses: actions/checkout@v3 | 
| 26 |  | -      - name: Set up python | 
| 27 |  | -        uses: actions/setup-python@v4 | 
| 28 |  | -        with: | 
| 29 |  | -          python-version: 3.8 | 
| 30 |  | -      - name: Bootstrap poetry | 
|  | 47 | +      - uses: actions/checkout@v4 | 
|  | 48 | + | 
|  | 49 | +      - name: Install Rye | 
| 31 | 50 |         run: | | 
| 32 |  | -          curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 | 
|  | 51 | +          curl -sSf https://rye.astral.sh/get | bash | 
|  | 52 | +          echo "$HOME/.rye/shims" >> $GITHUB_PATH | 
|  | 53 | +        env: | 
|  | 54 | +          RYE_VERSION: '0.44.0' | 
|  | 55 | +          RYE_INSTALL_OPTION: '--yes' | 
|  | 56 | + | 
| 33 | 57 |       - name: Install dependencies | 
| 34 |  | -        run: poetry install | 
|  | 58 | +        run: rye sync --all-features | 
| 35 | 59 | 
 | 
| 36 |  | -      - name: Test | 
| 37 |  | -        run: poetry run pytest -rP . --ignore=tests/custom/test_client.py | 
|  | 60 | +      - name: Run build | 
|  | 61 | +        run: rye build | 
| 38 | 62 | 
 | 
| 39 |  | -  publish: | 
| 40 |  | -    needs: [compile, test] | 
| 41 |  | -    if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | 
| 42 |  | -    runs-on: ubuntu-latest | 
| 43 |  | -    steps: | 
| 44 |  | -      - name: Checkout repo | 
| 45 |  | -        uses: actions/checkout@v3 | 
| 46 |  | -      - name: Set up python | 
| 47 |  | -        uses: actions/setup-python@v4 | 
|  | 63 | +      - name: Get GitHub OIDC Token | 
|  | 64 | +        if: github.repository == 'stainless-sdks/letta-sdk-python' | 
|  | 65 | +        id: github-oidc | 
|  | 66 | +        uses: actions/github-script@v6 | 
| 48 | 67 |         with: | 
| 49 |  | -          python-version: 3.8 | 
| 50 |  | -      - name: Bootstrap poetry | 
| 51 |  | -        run: | | 
| 52 |  | -          curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 | 
| 53 |  | -      - name: Install dependencies | 
| 54 |  | -        run: poetry install | 
| 55 |  | -      - name: Publish to pypi | 
|  | 68 | +          script: core.setOutput('github_token', await core.getIDToken()); | 
|  | 69 | + | 
|  | 70 | +      - name: Upload tarball | 
|  | 71 | +        if: github.repository == 'stainless-sdks/letta-sdk-python' | 
|  | 72 | +        env: | 
|  | 73 | +          URL: https://pkg.stainless.com/s | 
|  | 74 | +          AUTH: ${{ steps.github-oidc.outputs.github_token }} | 
|  | 75 | +          SHA: ${{ github.sha }} | 
|  | 76 | +        run: ./scripts/utils/upload-artifact.sh | 
|  | 77 | + | 
|  | 78 | +  test: | 
|  | 79 | +    timeout-minutes: 10 | 
|  | 80 | +    name: test | 
|  | 81 | +    runs-on: ${{ github.repository == 'stainless-sdks/letta-sdk-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} | 
|  | 82 | +    if: github.event_name == 'push' || github.event.pull_request.head.repo.fork | 
|  | 83 | +    steps: | 
|  | 84 | +      - uses: actions/checkout@v4 | 
|  | 85 | + | 
|  | 86 | +      - name: Install Rye | 
| 56 | 87 |         run: | | 
| 57 |  | -          poetry config repositories.remote https://upload.pypi.org/legacy/ | 
| 58 |  | -          poetry --no-interaction -v publish --build --repository remote --username __token__ --password "$PYPI_TOKEN" | 
|  | 88 | +          curl -sSf https://rye.astral.sh/get | bash | 
|  | 89 | +          echo "$HOME/.rye/shims" >> $GITHUB_PATH | 
| 59 | 90 |         env: | 
| 60 |  | -          PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | 
|  | 91 | +          RYE_VERSION: '0.44.0' | 
|  | 92 | +          RYE_INSTALL_OPTION: '--yes' | 
|  | 93 | + | 
|  | 94 | +      - name: Bootstrap | 
|  | 95 | +        run: ./scripts/bootstrap | 
|  | 96 | + | 
|  | 97 | +      - name: Run tests | 
|  | 98 | +        run: ./scripts/test | 
0 commit comments