Skip to content

Commit

Permalink
release: 4.0.alpha (#249)
Browse files Browse the repository at this point in the history
* chore: go live (#250)

* feat(api): update via SDK Studio (#251)

* feat(api): update via SDK Studio (#252)

* chore: update SDK settings (#253)

* release: 0.1.0

---------

Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
  • Loading branch information
stainless-app[bot] authored Jul 19, 2024
1 parent 44d360a commit 7727515
Show file tree
Hide file tree
Showing 311 changed files with 1,514 additions and 1,514 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}

USER vscode

RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.24.0" RYE_INSTALL_OPTION="--yes" bash
RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.35.0" RYE_INSTALL_OPTION="--yes" bash
ENV PATH=/home/vscode/.rye/shims:$PATH

RUN echo "[[ -d .venv ]] && source .venv/bin/activate" >> /home/vscode/.bashrc
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
pull_request:
branches:
- v3
- next

jobs:
lint:
Expand All @@ -21,7 +22,7 @@ jobs:
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: 0.24.0
RYE_VERSION: '0.35.0'
RYE_INSTALL_OPTION: '--yes'

- name: Install dependencies
Expand All @@ -41,7 +42,7 @@ jobs:
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: 0.24.0
RYE_VERSION: '0.35.0'
RYE_INSTALL_OPTION: '--yes'

- name: Bootstrap
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/create-releases.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/handle-release-pr-title-edit.yml

This file was deleted.

12 changes: 8 additions & 4 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# workflow for re-running publishing to PyPI in case it fails for some reason
# you can run this workflow by navigating to https://www.github.com/intercom/python-intercom/actions/workflows/publish-pypi.yml
# 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/intercom/python-intercom/actions/workflows/publish-pypi.yml
name: Publish PyPI
on:
workflow_dispatch:

release:
types: [published]

jobs:
publish:
name: publish
Expand All @@ -17,8 +21,8 @@ jobs:
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: 0.24.0
RYE_INSTALL_OPTION: "--yes"
RYE_VERSION: '0.35.0'
RYE_INSTALL_OPTION: '--yes'

- name: Publish to PyPI
run: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ jobs:
run: |
bash ./bin/check-release-environment
env:
STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }}
PYPI_TOKEN: ${{ secrets.INTERCOM_PYPI_TOKEN || secrets.PYPI_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.prism.log
.vscode
_dev

Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.0.1"
".": "0.1.0"
}
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Changelog

## 0.1.0 (2024-07-17)

Full Changelog: [v0.0.1...v0.1.0](https://github.com/intercom/python-intercom/compare/v0.0.1...v0.1.0)

### Features

* **api:** OpenAPI spec update ([7b99dc3](https://github.com/intercom/python-intercom/commit/7b99dc3ea6ce3c61845510a06f313624d92db628))
* **api:** OpenAPI spec update ([632e659](https://github.com/intercom/python-intercom/commit/632e659f6a0694e1c262e77d8a1da664e67488fa))
* **api:** OpenAPI spec update ([a561dff](https://github.com/intercom/python-intercom/commit/a561dffa1225722412e78890ea2668f58a3d6aa9))
* **api:** update via SDK Studio ([44d360a](https://github.com/intercom/python-intercom/commit/44d360a2e477e2e3cbc2441a2f1ef6dae51e6331))
* **api:** update via SDK Studio ([4f981c5](https://github.com/intercom/python-intercom/commit/4f981c5818eb35a61bcd98952c30322cce6b4e77))
* **api:** update via SDK Studio ([1802937](https://github.com/intercom/python-intercom/commit/1802937e0c6c1366861f4d54d62335b132a6aca8))
* **api:** update via SDK Studio ([c5ee578](https://github.com/intercom/python-intercom/commit/c5ee5781b766f90017b9e40e040dc6ee4010b403))
* **api:** update via SDK Studio ([8d1d513](https://github.com/intercom/python-intercom/commit/8d1d5135cd2ad5a9e92116611e42e5ce471e4c55))
* **api:** update via SDK Studio ([4b7275f](https://github.com/intercom/python-intercom/commit/4b7275faddb82e20d8beb21ad5d1edf8d1ff4e39))
* **api:** update via SDK Studio ([cd48024](https://github.com/intercom/python-intercom/commit/cd480246a573bc08a1cc1182a318f1b3a3b6d709))
* **api:** update via SDK Studio ([dfd8fba](https://github.com/intercom/python-intercom/commit/dfd8fbaea39b1e55b22ee632f7558e96a349e473))
* **api:** update via SDK Studio ([0bd7ae4](https://github.com/intercom/python-intercom/commit/0bd7ae43a2ecfb9f6a190e50a72a139e772a279f))
* **api:** update via SDK Studio ([638c48b](https://github.com/intercom/python-intercom/commit/638c48b6b6aa01b49232d89b8a8e8509055fc062))
* **api:** update via SDK Studio ([bce089e](https://github.com/intercom/python-intercom/commit/bce089efbaf0406130d1ded51c15b752f332bc94))
* **api:** update via SDK Studio ([635b1d1](https://github.com/intercom/python-intercom/commit/635b1d18a40f730ab28529301297a809e1c9d5dc))
* **api:** update via SDK Studio ([b1b9219](https://github.com/intercom/python-intercom/commit/b1b92197c2758c1f121f52cf636033c4b9ba6f42))
* **api:** update via SDK Studio ([e3069e9](https://github.com/intercom/python-intercom/commit/e3069e903f7188941c2a6f69a982bf6e49a04313))
* **api:** update via SDK Studio ([6210114](https://github.com/intercom/python-intercom/commit/62101148adf4ecf0b5aeea53b110feaaba296ede))
* **api:** update via SDK Studio ([aff3c46](https://github.com/intercom/python-intercom/commit/aff3c46f12717bee8bc2a662cd99f34c73e959af))
* **api:** update via SDK Studio ([#251](https://github.com/intercom/python-intercom/issues/251)) ([67e848d](https://github.com/intercom/python-intercom/commit/67e848dfa7681cf197fab68a74d492b6b8f35c39))
* **api:** update via SDK Studio ([#252](https://github.com/intercom/python-intercom/issues/252)) ([0faa8c2](https://github.com/intercom/python-intercom/commit/0faa8c2b3d4557242e1f2ee5dd86bd3c60e11fb7))


### Chores

* go live ([#250](https://github.com/intercom/python-intercom/issues/250)) ([6e3ce75](https://github.com/intercom/python-intercom/commit/6e3ce753e0578fb82d79c77fd4f3dd1184839b4d))
* update SDK settings ([#253](https://github.com/intercom/python-intercom/issues/253)) ([a937722](https://github.com/intercom/python-intercom/commit/a9377223662206e95044d70d44e6f76307204c0d))
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $ pip install -r requirements-dev.lock
## Modifying/Adding code

Most of the SDK is generated code, and any modified code will be overridden on the next generation. The
`src/python_minus_intercom/lib/` and `examples/` directories are exceptions and will never be overridden.
`src/python_intercom/lib/` and `examples/` directories are exceptions and will never be overridden.

## Adding and running examples

Expand Down
41 changes: 19 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,22 @@ It is generated with [Stainless](https://www.stainlessapi.com/).

## Documentation

The REST API documentation can be found [on developers.intercom.com](https://developers.intercom.com). The full API of this library can be found in [api.md](api.md).
The REST API documentation can be found on [developers.intercom.com](https://developers.intercom.com). The full API of this library can be found in [api.md](api.md).

## Installation

```sh
# install from the production repo
pip install git+ssh://git@github.com/intercom/python-intercom#v3.git
# install from PyPI
pip install python-intercom
```

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

The full API of this library can be found in [api.md](api.md).

```python
import os
from python_minus_intercom import Intercom
from python_intercom import Intercom

client = Intercom(
# This is the default and can be omitted
Expand All @@ -53,7 +50,7 @@ Simply import `AsyncIntercom` instead of `Intercom` and use `await` with each AP
```python
import os
import asyncio
from python_minus_intercom import AsyncIntercom
from python_intercom import AsyncIntercom

client = AsyncIntercom(
# This is the default and can be omitted
Expand Down Expand Up @@ -84,27 +81,27 @@ Typed requests and responses provide autocomplete and documentation within your

## Handling errors

When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `python_minus_intercom.APIConnectionError` is raised.
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `python_intercom.APIConnectionError` is raised.

When the API returns a non-success status code (that is, 4xx or 5xx
response), a subclass of `python_minus_intercom.APIStatusError` is raised, containing `status_code` and `response` properties.
response), a subclass of `python_intercom.APIStatusError` is raised, containing `status_code` and `response` properties.

All errors inherit from `python_minus_intercom.APIError`.
All errors inherit from `python_intercom.APIError`.

```python
import python_minus_intercom
from python_minus_intercom import Intercom
import python_intercom
from python_intercom import Intercom

client = Intercom()

try:
client.me.retrieve()
except python_minus_intercom.APIConnectionError as e:
except python_intercom.APIConnectionError as e:
print("The server could not be reached")
print(e.__cause__) # an underlying Exception, likely raised within httpx.
except python_minus_intercom.RateLimitError as e:
except python_intercom.RateLimitError as e:
print("A 429 status code was received; we should back off a bit.")
except python_minus_intercom.APIStatusError as e:
except python_intercom.APIStatusError as e:
print("Another non-200-range status code was received")
print(e.status_code)
print(e.response)
Expand Down Expand Up @@ -132,7 +129,7 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
You can use the `max_retries` option to configure or disable retry settings:

```python
from python_minus_intercom import Intercom
from python_intercom import Intercom

# Configure the default for all requests:
client = Intercom(
Expand All @@ -150,7 +147,7 @@ By default requests time out after 1 minute. You can configure this with a `time
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:

```python
from python_minus_intercom import Intercom
from python_intercom import Intercom

# Configure the default for all requests:
client = Intercom(
Expand Down Expand Up @@ -200,7 +197,7 @@ if response.my_field is None:
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,

```py
from python_minus_intercom import Intercom
from python_intercom import Intercom

client = Intercom()
response = client.me.with_raw_response.retrieve()
Expand All @@ -210,9 +207,9 @@ me = response.parse() # get the object that `me.retrieve()` would have returned
print(me.id)
```

These methods return an [`APIResponse`](https://github.com/intercom/python-intercom/tree/v3/src/python_minus_intercom/_response.py) object.
These methods return an [`APIResponse`](https://github.com/intercom/python-intercom/tree/v3/src/python_intercom/_response.py) object.

The async client returns an [`AsyncAPIResponse`](https://github.com/intercom/python-intercom/tree/v3/src/python_minus_intercom/_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/intercom/python-intercom/tree/v3/src/python_intercom/_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 @@ -274,7 +271,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality

```python
from python_minus_intercom import Intercom, DefaultHttpxClient
from python_intercom import Intercom, DefaultHttpxClient

client = Intercom(
# Or use the `INTERCOM_BASE_URL` env var
Expand Down
Loading

0 comments on commit 7727515

Please sign in to comment.