diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml new file mode 100644 index 00000000..6b9ff8b6 --- /dev/null +++ b/.github/workflows/publish-pypi.yml @@ -0,0 +1,31 @@ +# 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/supermemoryai/python-sdk/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@v4 + + - 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' + + - name: Publish to PyPI + run: | + bash ./bin/publish-pypi + env: + PYPI_TOKEN: ${{ secrets.SUPERMEMORY_PYPI_TOKEN || secrets.PYPI_TOKEN }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml new file mode 100644 index 00000000..c5235d30 --- /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 == 'supermemoryai/python-sdk' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + + steps: + - uses: actions/checkout@v4 + + - name: Check release environment + run: | + bash ./bin/check-release-environment + env: + PYPI_TOKEN: ${{ secrets.SUPERMEMORY_PYPI_TOKEN || secrets.PYPI_TOKEN }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000..ba6c3483 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.1.0-alpha.1" +} \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 58bcaa0b..b07d08ce 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 8 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-f7a84a68f7d3173627cb589cec436ed7e89c98b2c3e66bbf42549da7346f3560.yml openapi_spec_hash: 40877051c2167db483e240b4226d840f -config_hash: 77849fd95b1e7c5a1691ab43ea3b180a +config_hash: eb32087403f958eead829e810f5a71b8 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..10dc4129 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,49 @@ +# Changelog + +## 0.1.0-alpha.1 (2025-04-29) + +Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/supermemoryai/python-sdk/compare/v0.0.1-alpha.0...v0.1.0-alpha.1) + +### Features + +* **api:** add filtering in list memories endpoint ([5d86a70](https://github.com/supermemoryai/python-sdk/commit/5d86a703c41b0ce90c8ac61f2eccd6c83f79c176)) +* **api:** api update ([924681b](https://github.com/supermemoryai/python-sdk/commit/924681b37fe9492f316be15559df2644e7660842)) +* **api:** api update ([02e6b69](https://github.com/supermemoryai/python-sdk/commit/02e6b6940d3e9a7d3bfa61af801bcfa5e1a11529)) +* **api:** api update ([7754bba](https://github.com/supermemoryai/python-sdk/commit/7754bba34d6a99d903acb7439caccbe5ab9aa598)) +* **api:** api update ([b15aa2f](https://github.com/supermemoryai/python-sdk/commit/b15aa2f8c7772f84485e610d5352e68c9f4b367b)) +* **api:** api update ([0dded4d](https://github.com/supermemoryai/python-sdk/commit/0dded4d6be51807c0a295495684bdb6aa5f853d1)) +* **api:** api update ([3a4c540](https://github.com/supermemoryai/python-sdk/commit/3a4c540b328cdfb4b9aba4e7f3a9a5def657e753)) +* **api:** api update ([c700956](https://github.com/supermemoryai/python-sdk/commit/c700956b44689bb82d054d2ffabc49a902be413b)) +* **api:** api update ([bc6255a](https://github.com/supermemoryai/python-sdk/commit/bc6255addc8757d56d803593913db96e9b12a4e1)) +* **api:** api update ([2abae10](https://github.com/supermemoryai/python-sdk/commit/2abae10ee88440ef931f7a127cb365c56d80a45d)) +* **api:** api update ([7d263ce](https://github.com/supermemoryai/python-sdk/commit/7d263cefd8242b701e96b181caf6e2b473f7acac)) +* **api:** api update ([ae64ee9](https://github.com/supermemoryai/python-sdk/commit/ae64ee969401c34da3704278bc05996cecc2214e)) +* **api:** api update ([e5b0dc5](https://github.com/supermemoryai/python-sdk/commit/e5b0dc54ccebf278fb3d26cce334daa816bc5324)) +* **api:** api update ([3d891f5](https://github.com/supermemoryai/python-sdk/commit/3d891f569dcec80be6b25757bd0f7fd41366b86c)) +* **api:** api update ([1cfd461](https://github.com/supermemoryai/python-sdk/commit/1cfd4616cd5230a3eedc01b4b6cb3fc2ad6828df)) +* **api:** api update ([775acf2](https://github.com/supermemoryai/python-sdk/commit/775acf29ed6814a9e00928a21d7e1b269bd1c827)) + + +### Bug Fixes + +* **pydantic v1:** more robust ModelField.annotation check ([7ab1994](https://github.com/supermemoryai/python-sdk/commit/7ab19942fc0ec181a3ada4c2748cef5c6f604f86)) + + +### Chores + +* broadly detect json family of content-type headers ([4adab85](https://github.com/supermemoryai/python-sdk/commit/4adab85222033e3ab74864916e3913590c2e3983)) +* **ci:** add timeout thresholds for CI jobs ([6f41dd1](https://github.com/supermemoryai/python-sdk/commit/6f41dd1bcde3a7bc32c02b5e9fe301699274a19f)) +* **ci:** only use depot for staging repos ([380881a](https://github.com/supermemoryai/python-sdk/commit/380881ab4ca3cc2b121f2fc4d16a567afd6bc763)) +* **client:** minor internal fixes ([1d88cf8](https://github.com/supermemoryai/python-sdk/commit/1d88cf891c3bfb06983f28fd7bc3365e92c45f84)) +* configure new SDK language ([2aa9714](https://github.com/supermemoryai/python-sdk/commit/2aa971422b0eeddb9319fe6780fcd4bfd5a9b6c7)) +* **internal:** base client updates ([2d628e4](https://github.com/supermemoryai/python-sdk/commit/2d628e42bdfdee7dbda8e177950b93efc3f0875d)) +* **internal:** bump pyright version ([ab4080a](https://github.com/supermemoryai/python-sdk/commit/ab4080a27dc73e5956fc663449720ece5966f383)) +* **internal:** codegen related update ([072db72](https://github.com/supermemoryai/python-sdk/commit/072db7257871c72e512c6776cfe680c2fb5df738)) +* **internal:** fix list file params ([67f4ba4](https://github.com/supermemoryai/python-sdk/commit/67f4ba4b3f89f42bd0f17c5bd88fb4663e3dbf1b)) +* **internal:** import reformatting ([154b1c5](https://github.com/supermemoryai/python-sdk/commit/154b1c58b7fd421aa2039cfb4438b72e2cbe4d38)) +* **internal:** minor formatting changes ([f07f0b9](https://github.com/supermemoryai/python-sdk/commit/f07f0b9dbc8c5f0ef4d3c4acfa980d991aba3943)) +* **internal:** refactor retries to not use recursion ([63072f1](https://github.com/supermemoryai/python-sdk/commit/63072f131bca572e22af65c2c8b3b42f5e5d866a)) +* **internal:** update models test ([24d7e92](https://github.com/supermemoryai/python-sdk/commit/24d7e92ceed67b23dc0189d36d30c8eb8bb2d075)) +* **internal:** update pyright settings ([211f7e9](https://github.com/supermemoryai/python-sdk/commit/211f7e9f03d8ff06f680364b8cfb1c38dde54935)) +* update SDK settings ([cc260f1](https://github.com/supermemoryai/python-sdk/commit/cc260f124b2858bfd9495a8da074fd20890f3f10)) +* update SDK settings ([937b5cb](https://github.com/supermemoryai/python-sdk/commit/937b5cb5e302e009bfc7475c4f942d4f5c24bcdd)) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ba069666..9426a1fa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -63,7 +63,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/supermemory-python.git +$ pip install git+ssh://git@github.com/supermemoryai/python-sdk.git ``` Alternatively, you can build from source and install the wheel file: @@ -121,7 +121,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/supermemory-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/supermemoryai/python-sdk/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 5307f7d5..3dfd7e8c 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,10 @@ The REST API documentation can be found on [docs.supermemory.com](https://docs.s ## Installation ```sh -# install from this staging repo -pip install git+ssh://git@github.com/stainless-sdks/supermemory-python.git +# install from PyPI +pip install --pre supermemory ``` -> [!NOTE] -> Once this package is [published to PyPI](https://app.stainless.com/docs/guides/publish), this will become: `pip install --pre supermemory` - ## Usage The full API of this library can be found in [api.md](api.md). @@ -218,9 +215,9 @@ memory = response.parse() # get the object that `memory.create()` would have re print(memory.id) ``` -These methods return an [`APIResponse`](https://github.com/stainless-sdks/supermemory-python/tree/main/src/supermemory/_response.py) object. +These methods return an [`APIResponse`](https://github.com/supermemoryai/python-sdk/tree/main/src/supermemory/_response.py) object. -The async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/supermemory-python/tree/main/src/supermemory/_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/supermemoryai/python-sdk/tree/main/src/supermemory/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. #### `.with_streaming_response` @@ -326,7 +323,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/supermemory-python/issues) with questions, bugs, or suggestions. +We are keen for your feedback; please open an [issue](https://www.github.com/supermemoryai/python-sdk/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 00000000..f2334980 --- /dev/null +++ b/bin/check-release-environment @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +errors=() + +if [ -z "${PYPI_TOKEN}" ]; then + errors+=("The SUPERMEMORY_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 926f11ad..8427a405 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "supermemory" -version = "0.0.1-alpha.0" +version = "0.1.0-alpha.1" description = "The official Python library for the supermemory API" dynamic = ["readme"] license = "Apache-2.0" @@ -34,8 +34,8 @@ classifiers = [ ] [project.urls] -Homepage = "https://github.com/stainless-sdks/supermemory-python" -Repository = "https://github.com/stainless-sdks/supermemory-python" +Homepage = "https://github.com/supermemoryai/python-sdk" +Repository = "https://github.com/supermemoryai/python-sdk" [tool.rye] @@ -121,7 +121,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/supermemory-python/tree/main/\g<2>)' +replacement = '[\1](https://github.com/supermemoryai/python-sdk/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 00000000..247d1fda --- /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/supermemory/_version.py" + ] +} \ No newline at end of file diff --git a/src/supermemory/_version.py b/src/supermemory/_version.py index 6242e1c3..a40c4ed9 100644 --- a/src/supermemory/_version.py +++ b/src/supermemory/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "supermemory" -__version__ = "0.0.1-alpha.0" +__version__ = "0.1.0-alpha.1" # x-release-please-version diff --git a/src/supermemory/resources/connection.py b/src/supermemory/resources/connection.py index 03eb9cb2..a55ea8b7 100644 --- a/src/supermemory/resources/connection.py +++ b/src/supermemory/resources/connection.py @@ -30,7 +30,7 @@ def with_raw_response(self) -> ConnectionResourceWithRawResponse: 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/supermemory-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/supermemoryai/python-sdk#accessing-raw-response-data-eg-headers """ return ConnectionResourceWithRawResponse(self) @@ -39,7 +39,7 @@ def with_streaming_response(self) -> ConnectionResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/supermemory-python#with_streaming_response + For more information, see https://www.github.com/supermemoryai/python-sdk#with_streaming_response """ return ConnectionResourceWithStreamingResponse(self) @@ -128,7 +128,7 @@ def with_raw_response(self) -> AsyncConnectionResourceWithRawResponse: 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/supermemory-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/supermemoryai/python-sdk#accessing-raw-response-data-eg-headers """ return AsyncConnectionResourceWithRawResponse(self) @@ -137,7 +137,7 @@ def with_streaming_response(self) -> AsyncConnectionResourceWithStreamingRespons """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/supermemory-python#with_streaming_response + For more information, see https://www.github.com/supermemoryai/python-sdk#with_streaming_response """ return AsyncConnectionResourceWithStreamingResponse(self) diff --git a/src/supermemory/resources/memory.py b/src/supermemory/resources/memory.py index 0941cf29..e0368257 100644 --- a/src/supermemory/resources/memory.py +++ b/src/supermemory/resources/memory.py @@ -34,7 +34,7 @@ def with_raw_response(self) -> MemoryResourceWithRawResponse: 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/supermemory-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/supermemoryai/python-sdk#accessing-raw-response-data-eg-headers """ return MemoryResourceWithRawResponse(self) @@ -43,7 +43,7 @@ def with_streaming_response(self) -> MemoryResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/supermemory-python#with_streaming_response + For more information, see https://www.github.com/supermemoryai/python-sdk#with_streaming_response """ return MemoryResourceWithStreamingResponse(self) @@ -228,7 +228,7 @@ def with_raw_response(self) -> AsyncMemoryResourceWithRawResponse: 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/supermemory-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/supermemoryai/python-sdk#accessing-raw-response-data-eg-headers """ return AsyncMemoryResourceWithRawResponse(self) @@ -237,7 +237,7 @@ def with_streaming_response(self) -> AsyncMemoryResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/supermemory-python#with_streaming_response + For more information, see https://www.github.com/supermemoryai/python-sdk#with_streaming_response """ return AsyncMemoryResourceWithStreamingResponse(self) diff --git a/src/supermemory/resources/search.py b/src/supermemory/resources/search.py index f238835d..6c55ba34 100644 --- a/src/supermemory/resources/search.py +++ b/src/supermemory/resources/search.py @@ -31,7 +31,7 @@ def with_raw_response(self) -> SearchResourceWithRawResponse: 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/supermemory-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/supermemoryai/python-sdk#accessing-raw-response-data-eg-headers """ return SearchResourceWithRawResponse(self) @@ -40,7 +40,7 @@ def with_streaming_response(self) -> SearchResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/supermemory-python#with_streaming_response + For more information, see https://www.github.com/supermemoryai/python-sdk#with_streaming_response """ return SearchResourceWithStreamingResponse(self) @@ -128,7 +128,7 @@ def with_raw_response(self) -> AsyncSearchResourceWithRawResponse: 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/supermemory-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/supermemoryai/python-sdk#accessing-raw-response-data-eg-headers """ return AsyncSearchResourceWithRawResponse(self) @@ -137,7 +137,7 @@ def with_streaming_response(self) -> AsyncSearchResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/supermemory-python#with_streaming_response + For more information, see https://www.github.com/supermemoryai/python-sdk#with_streaming_response """ return AsyncSearchResourceWithStreamingResponse(self) diff --git a/src/supermemory/resources/settings.py b/src/supermemory/resources/settings.py index 9aafcd3d..63b3604e 100644 --- a/src/supermemory/resources/settings.py +++ b/src/supermemory/resources/settings.py @@ -30,7 +30,7 @@ def with_raw_response(self) -> SettingsResourceWithRawResponse: 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/supermemory-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/supermemoryai/python-sdk#accessing-raw-response-data-eg-headers """ return SettingsResourceWithRawResponse(self) @@ -39,7 +39,7 @@ def with_streaming_response(self) -> SettingsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/supermemory-python#with_streaming_response + For more information, see https://www.github.com/supermemoryai/python-sdk#with_streaming_response """ return SettingsResourceWithStreamingResponse(self) @@ -98,7 +98,7 @@ def with_raw_response(self) -> AsyncSettingsResourceWithRawResponse: 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/supermemory-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/supermemoryai/python-sdk#accessing-raw-response-data-eg-headers """ return AsyncSettingsResourceWithRawResponse(self) @@ -107,7 +107,7 @@ def with_streaming_response(self) -> AsyncSettingsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/supermemory-python#with_streaming_response + For more information, see https://www.github.com/supermemoryai/python-sdk#with_streaming_response """ return AsyncSettingsResourceWithStreamingResponse(self)