Skip to content

Commit

Permalink
Merge pull request #2 from OmniStack-sh/release-please--branches--mai…
Browse files Browse the repository at this point in the history
…n--changes--next

release: 0.1.0-alpha.1
  • Loading branch information
dvlpjrs authored Oct 17, 2024
2 parents 7d28614 + 0392c97 commit 642118f
Show file tree
Hide file tree
Showing 13 changed files with 177 additions and 27 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -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/OmniStack-sh/omnistack-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@v4

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

- name: Publish to PyPI
run: |
bash ./bin/publish-pypi
env:
PYPI_TOKEN: ${{ secrets.OMNISTACK_PYPI_TOKEN || secrets.PYPI_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
@@ -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 == 'OmniStack-sh/omnistack-python' && (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.OMNISTACK_PYPI_TOKEN || secrets.PYPI_TOKEN }}
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.1.0-alpha.1"
}
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Changelog

## 0.1.0-alpha.1 (2024-10-17)

Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/OmniStack-sh/omnistack-python/compare/v0.0.1-alpha.0...v0.1.0-alpha.1)

### Features

* **api:** api update ([7d28614](https://github.com/OmniStack-sh/omnistack-python/commit/7d28614ac5d0b945e7b6df013d5c9c63522760c5))
* **api:** api update ([#1](https://github.com/OmniStack-sh/omnistack-python/issues/1)) ([4d80dcc](https://github.com/OmniStack-sh/omnistack-python/commit/4d80dcc27b29333c398502ca08e8cd4f9e82e6e4))
* **api:** update via SDK Studio ([55e43c9](https://github.com/OmniStack-sh/omnistack-python/commit/55e43c987366864154869a6f7c91ad267ce612dc))
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/omnistack-python.git
$ pip install git+ssh://git@github.com/OmniStack-sh/omnistack-python.git
```

Alternatively, you can build from source and install the wheel file:
Expand Down Expand Up @@ -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/omnistack-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/OmniStack-sh/omnistack-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.

### Publish manually

Expand Down
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@ The REST API documentation can be found on [docs.omnistack.com](https://docs.omn
## Installation

```sh
# install from this staging repo
pip install git+ssh://git@github.com/stainless-sdks/omnistack-python.git
# install from PyPI
pip install --pre omnistack
```

> [!NOTE]
> Once this package is [published to PyPI](https://app.stainlessapi.com/docs/guides/publish), this will become: `pip install --pre omnistack`
## Usage

The full API of this library can be found in [api.md](api.md).
Expand Down Expand Up @@ -214,9 +211,9 @@ completion = response.parse() # get the object that `openai.completions.create(
print(completion)
```

These methods return an [`APIResponse`](https://github.com/stainless-sdks/omnistack-python/tree/main/src/omnistack/_response.py) object.
These methods return an [`APIResponse`](https://github.com/OmniStack-sh/omnistack-python/tree/main/src/omnistack/_response.py) object.

The async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/omnistack-python/tree/main/src/omnistack/_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/OmniStack-sh/omnistack-python/tree/main/src/omnistack/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.

#### `.with_streaming_response`

Expand Down Expand Up @@ -313,7 +310,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/omnistack-python/issues) with questions, bugs, or suggestions.
We are keen for your feedback; please open an [issue](https://www.github.com/OmniStack-sh/omnistack-python/issues) with questions, bugs, or suggestions.

### Determining the installed version

Expand Down
21 changes: 21 additions & 0 deletions bin/check-release-environment
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

errors=()

if [ -z "${PYPI_TOKEN}" ]; then
errors+=("The OMNISTACK_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!"
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "omnistack"
version = "0.0.1-alpha.0"
version = "0.1.0-alpha.1"
description = "The official Python library for the omnistack API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -36,8 +36,8 @@ classifiers = [
]

[project.urls]
Homepage = "https://github.com/stainless-sdks/omnistack-python"
Repository = "https://github.com/stainless-sdks/omnistack-python"
Homepage = "https://github.com/OmniStack-sh/omnistack-python"
Repository = "https://github.com/OmniStack-sh/omnistack-python"



Expand Down Expand Up @@ -123,7 +123,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/omnistack-python/tree/main/\g<2>)'
replacement = '[\1](https://github.com/OmniStack-sh/omnistack-python/tree/main/\g<2>)'

[tool.black]
line-length = 120
Expand Down
66 changes: 66 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -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/omnistack/_version.py"
]
}
2 changes: 1 addition & 1 deletion src/omnistack/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "omnistack"
__version__ = "0.0.1-alpha.0"
__version__ = "0.1.0-alpha.1" # x-release-please-version
8 changes: 4 additions & 4 deletions src/omnistack/resources/openai/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def with_raw_response(self) -> ChatResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return the
the raw response object instead of the parsed content.
For more information, see https://www.github.com/stainless-sdks/omnistack-python#accessing-raw-response-data-eg-headers
For more information, see https://www.github.com/OmniStack-sh/omnistack-python#accessing-raw-response-data-eg-headers
"""
return ChatResourceWithRawResponse(self)

Expand All @@ -43,7 +43,7 @@ def with_streaming_response(self) -> ChatResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/stainless-sdks/omnistack-python#with_streaming_response
For more information, see https://www.github.com/OmniStack-sh/omnistack-python#with_streaming_response
"""
return ChatResourceWithStreamingResponse(self)

Expand Down Expand Up @@ -302,7 +302,7 @@ def with_raw_response(self) -> AsyncChatResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return the
the raw response object instead of the parsed content.
For more information, see https://www.github.com/stainless-sdks/omnistack-python#accessing-raw-response-data-eg-headers
For more information, see https://www.github.com/OmniStack-sh/omnistack-python#accessing-raw-response-data-eg-headers
"""
return AsyncChatResourceWithRawResponse(self)

Expand All @@ -311,7 +311,7 @@ def with_streaming_response(self) -> AsyncChatResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/stainless-sdks/omnistack-python#with_streaming_response
For more information, see https://www.github.com/OmniStack-sh/omnistack-python#with_streaming_response
"""
return AsyncChatResourceWithStreamingResponse(self)

Expand Down
8 changes: 4 additions & 4 deletions src/omnistack/resources/openai/completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def with_raw_response(self) -> CompletionsResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return the
the raw response object instead of the parsed content.
For more information, see https://www.github.com/stainless-sdks/omnistack-python#accessing-raw-response-data-eg-headers
For more information, see https://www.github.com/OmniStack-sh/omnistack-python#accessing-raw-response-data-eg-headers
"""
return CompletionsResourceWithRawResponse(self)

Expand All @@ -43,7 +43,7 @@ def with_streaming_response(self) -> CompletionsResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/stainless-sdks/omnistack-python#with_streaming_response
For more information, see https://www.github.com/OmniStack-sh/omnistack-python#with_streaming_response
"""
return CompletionsResourceWithStreamingResponse(self)

Expand Down Expand Up @@ -241,7 +241,7 @@ def with_raw_response(self) -> AsyncCompletionsResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return the
the raw response object instead of the parsed content.
For more information, see https://www.github.com/stainless-sdks/omnistack-python#accessing-raw-response-data-eg-headers
For more information, see https://www.github.com/OmniStack-sh/omnistack-python#accessing-raw-response-data-eg-headers
"""
return AsyncCompletionsResourceWithRawResponse(self)

Expand All @@ -250,7 +250,7 @@ def with_streaming_response(self) -> AsyncCompletionsResourceWithStreamingRespon
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/stainless-sdks/omnistack-python#with_streaming_response
For more information, see https://www.github.com/OmniStack-sh/omnistack-python#with_streaming_response
"""
return AsyncCompletionsResourceWithStreamingResponse(self)

Expand Down
8 changes: 4 additions & 4 deletions src/omnistack/resources/openai/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def with_raw_response(self) -> OpenAIResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return the
the raw response object instead of the parsed content.
For more information, see https://www.github.com/stainless-sdks/omnistack-python#accessing-raw-response-data-eg-headers
For more information, see https://www.github.com/OmniStack-sh/omnistack-python#accessing-raw-response-data-eg-headers
"""
return OpenAIResourceWithRawResponse(self)

Expand All @@ -48,7 +48,7 @@ def with_streaming_response(self) -> OpenAIResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/stainless-sdks/omnistack-python#with_streaming_response
For more information, see https://www.github.com/OmniStack-sh/omnistack-python#with_streaming_response
"""
return OpenAIResourceWithStreamingResponse(self)

Expand All @@ -68,7 +68,7 @@ def with_raw_response(self) -> AsyncOpenAIResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return the
the raw response object instead of the parsed content.
For more information, see https://www.github.com/stainless-sdks/omnistack-python#accessing-raw-response-data-eg-headers
For more information, see https://www.github.com/OmniStack-sh/omnistack-python#accessing-raw-response-data-eg-headers
"""
return AsyncOpenAIResourceWithRawResponse(self)

Expand All @@ -77,7 +77,7 @@ def with_streaming_response(self) -> AsyncOpenAIResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/stainless-sdks/omnistack-python#with_streaming_response
For more information, see https://www.github.com/OmniStack-sh/omnistack-python#with_streaming_response
"""
return AsyncOpenAIResourceWithStreamingResponse(self)

Expand Down

0 comments on commit 642118f

Please sign in to comment.