diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml new file mode 100644 index 0000000..c6b4d12 --- /dev/null +++ b/.github/workflows/publish-pypi.yml @@ -0,0 +1,28 @@ +# 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/CtxOS/ctxos-sdk-python/actions/workflows/publish-pypi.yml +name: Publish PyPI +on: + workflow_dispatch: + + release: + types: [published] + +jobs: + publish: + name: publish + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v6 + + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + version: '0.9.13' + + - name: Publish to PyPI + run: | + bash ./bin/publish-pypi + env: + PYPI_TOKEN: ${{ secrets.CTXOS_PYPI_TOKEN || secrets.PYPI_TOKEN }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml new file mode 100644 index 0000000..9585df3 --- /dev/null +++ b/.github/workflows/release-doctor.yml @@ -0,0 +1,21 @@ +name: Release Doctor +on: + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + release_doctor: + name: release doctor + runs-on: ubuntu-latest + if: github.repository == 'CtxOS/ctxos-sdk-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + + steps: + - uses: actions/checkout@v6 + + - name: Check release environment + run: | + bash ./bin/check-release-environment + env: + PYPI_TOKEN: ${{ secrets.CTXOS_PYPI_TOKEN || secrets.PYPI_TOKEN }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..c7159c1 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.0.2" +} \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 5b32a93..813aaf8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/ctxos%2Fctxos-5bad4d14e1dfb7d8e256a124dd945cb5efb927a9232d469e8896976e8a6d6221.yml openapi_spec_hash: e2e61d288b0b6bb42341fbec6c1daf40 -config_hash: 0fc96bc6742a2b59d91f37d9865da225 +config_hash: dea9226c04a89774ff429f77e4f14100 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..a6ffe4f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,10 @@ +# Changelog + +## 0.0.2 (2026-03-08) + +Full Changelog: [v0.0.1...v0.0.2](https://github.com/CtxOS/ctxos-sdk-python/compare/v0.0.1...v0.0.2) + +### Chores + +* update SDK settings ([a2f69ee](https://github.com/CtxOS/ctxos-sdk-python/commit/a2f69ee025212a9fe724cb3518220a05e77206d9)) +* update SDK settings ([9fb5f15](https://github.com/CtxOS/ctxos-sdk-python/commit/9fb5f1584362550016f09b63395c0bb9e8809574)) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dc3eb88..3a8cb10 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -62,7 +62,7 @@ If you’d like to use the repository from source, you can either install from g To install via git: ```sh -$ pip install git+ssh://git@github.com/stainless-sdks/ctxos-python.git +$ pip install git+ssh://git@github.com/CtxOS/ctxos-sdk-python.git ``` Alternatively, you can build from source and install the wheel file: @@ -113,7 +113,7 @@ the changes aren't made through the automated pipeline, you may want to make rel ### Publish with a GitHub workflow -You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/stainless-sdks/ctxos-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. +You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/CtxOS/ctxos-sdk-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. ### Publish manually diff --git a/README.md b/README.md index 291974a..2bb7d9a 100644 --- a/README.md +++ b/README.md @@ -16,13 +16,10 @@ The full API of this library can be found in [api.md](api.md). ## Installation ```sh -# install from this staging repo -pip install git+ssh://git@github.com/stainless-sdks/ctxos-python.git +# install from PyPI +pip install ctxos ``` -> [!NOTE] -> Once this package is [published to PyPI](https://www.stainless.com/docs/guides/publish), this will become: `pip install ctxos` - ## Usage The full API of this library can be found in [api.md](api.md). @@ -81,8 +78,8 @@ By default, the async client uses `httpx` for HTTP requests. However, for improv You can enable this by installing `aiohttp`: ```sh -# install from this staging repo -pip install 'ctxos[aiohttp] @ git+ssh://git@github.com/stainless-sdks/ctxos-python.git' +# install from PyPI +pip install ctxos[aiohttp] ``` Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: @@ -260,9 +257,9 @@ complete = response.parse() # get the object that `complete.create()` would hav print(complete.id) ``` -These methods return an [`APIResponse`](https://github.com/stainless-sdks/ctxos-python/tree/main/src/ctxos/_response.py) object. +These methods return an [`APIResponse`](https://github.com/CtxOS/ctxos-sdk-python/tree/main/src/ctxos/_response.py) object. -The async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/ctxos-python/tree/main/src/ctxos/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. +The async client returns an [`AsyncAPIResponse`](https://github.com/CtxOS/ctxos-sdk-python/tree/main/src/ctxos/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. #### `.with_streaming_response` @@ -369,7 +366,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. -We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/ctxos-python/issues) with questions, bugs, or suggestions. +We are keen for your feedback; please open an [issue](https://www.github.com/CtxOS/ctxos-sdk-python/issues) with questions, bugs, or suggestions. ### Determining the installed version diff --git a/bin/check-release-environment b/bin/check-release-environment new file mode 100644 index 0000000..b845b0f --- /dev/null +++ b/bin/check-release-environment @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +errors=() + +if [ -z "${PYPI_TOKEN}" ]; then + errors+=("The PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") +fi + +lenErrors=${#errors[@]} + +if [[ lenErrors -gt 0 ]]; then + echo -e "Found the following errors in the release environment:\n" + + for error in "${errors[@]}"; do + echo -e "- $error\n" + done + + exit 1 +fi + +echo "The environment is ready to push releases!" diff --git a/pyproject.toml b/pyproject.toml index b601043..f777065 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "ctxos" -version = "0.0.1" +version = "0.0.2" description = "The official Python library for the ctxos API" dynamic = ["readme"] license = "Apache-2.0" @@ -37,8 +37,8 @@ classifiers = [ ] [project.urls] -Homepage = "https://github.com/stainless-sdks/ctxos-python" -Repository = "https://github.com/stainless-sdks/ctxos-python" +Homepage = "https://github.com/CtxOS/ctxos-sdk-python" +Repository = "https://github.com/CtxOS/ctxos-sdk-python" [project.optional-dependencies] aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"] @@ -112,7 +112,7 @@ path = "README.md" [[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]] # replace relative links with absolute links pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)' -replacement = '[\1](https://github.com/stainless-sdks/ctxos-python/tree/main/\g<2>)' +replacement = '[\1](https://github.com/CtxOS/ctxos-sdk-python/tree/main/\g<2>)' [tool.pytest.ini_options] testpaths = ["tests"] diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..bf2f58d --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,66 @@ +{ + "packages": { + ".": {} + }, + "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json", + "include-v-in-tag": true, + "include-component-in-tag": false, + "versioning": "prerelease", + "prerelease": true, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": false, + "pull-request-header": "Automated Release PR", + "pull-request-title-pattern": "release: ${version}", + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Performance Improvements" + }, + { + "type": "revert", + "section": "Reverts" + }, + { + "type": "chore", + "section": "Chores" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "style", + "section": "Styles" + }, + { + "type": "refactor", + "section": "Refactors" + }, + { + "type": "test", + "section": "Tests", + "hidden": true + }, + { + "type": "build", + "section": "Build System" + }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": true + } + ], + "release-type": "python", + "extra-files": [ + "src/ctxos/_version.py" + ] +} \ No newline at end of file diff --git a/src/ctxos/_version.py b/src/ctxos/_version.py index 803afc0..16a598f 100644 --- a/src/ctxos/_version.py +++ b/src/ctxos/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "ctxos" -__version__ = "0.0.1" +__version__ = "0.0.2" # x-release-please-version diff --git a/src/ctxos/resources/complete.py b/src/ctxos/resources/complete.py index 93cf66f..d9d5182 100644 --- a/src/ctxos/resources/complete.py +++ b/src/ctxos/resources/complete.py @@ -28,7 +28,7 @@ def with_raw_response(self) -> CompleteResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/ctxos-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/CtxOS/ctxos-sdk-python#accessing-raw-response-data-eg-headers """ return CompleteResourceWithRawResponse(self) @@ -37,7 +37,7 @@ def with_streaming_response(self) -> CompleteResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/ctxos-python#with_streaming_response + For more information, see https://www.github.com/CtxOS/ctxos-sdk-python#with_streaming_response """ return CompleteResourceWithStreamingResponse(self) @@ -92,7 +92,7 @@ def with_raw_response(self) -> AsyncCompleteResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/ctxos-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/CtxOS/ctxos-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncCompleteResourceWithRawResponse(self) @@ -101,7 +101,7 @@ def with_streaming_response(self) -> AsyncCompleteResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/ctxos-python#with_streaming_response + For more information, see https://www.github.com/CtxOS/ctxos-sdk-python#with_streaming_response """ return AsyncCompleteResourceWithStreamingResponse(self) diff --git a/src/ctxos/resources/tokens.py b/src/ctxos/resources/tokens.py index 867e61a..d62f8fb 100644 --- a/src/ctxos/resources/tokens.py +++ b/src/ctxos/resources/tokens.py @@ -28,7 +28,7 @@ def with_raw_response(self) -> TokensResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/ctxos-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/CtxOS/ctxos-sdk-python#accessing-raw-response-data-eg-headers """ return TokensResourceWithRawResponse(self) @@ -37,7 +37,7 @@ def with_streaming_response(self) -> TokensResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/ctxos-python#with_streaming_response + For more information, see https://www.github.com/CtxOS/ctxos-sdk-python#with_streaming_response """ return TokensResourceWithStreamingResponse(self) @@ -83,7 +83,7 @@ def with_raw_response(self) -> AsyncTokensResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/stainless-sdks/ctxos-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/CtxOS/ctxos-sdk-python#accessing-raw-response-data-eg-headers """ return AsyncTokensResourceWithRawResponse(self) @@ -92,7 +92,7 @@ def with_streaming_response(self) -> AsyncTokensResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/ctxos-python#with_streaming_response + For more information, see https://www.github.com/CtxOS/ctxos-sdk-python#with_streaming_response """ return AsyncTokensResourceWithStreamingResponse(self)