Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
87d1adf
docs: add CONTRIBUTING.md (#170)
stainless-bot Feb 8, 2024
d5b9f5f
chore(ci): uses Stainless GitHub App for releases (#172)
stainless-bot Feb 15, 2024
2503fbc
chore(internal): refactor release environment script (#173)
stainless-bot Feb 15, 2024
450508a
chore(internal): bump rye to v0.24.0 (#175)
stainless-bot Feb 20, 2024
abdbcc6
chore(internal): update deps (#176)
stainless-bot Feb 22, 2024
f5c6f0c
chore(internal): bump pyright (#177)
stainless-bot Feb 26, 2024
677ef7e
chore(client): use anyio.sleep instead of asyncio.sleep (#178)
stainless-bot Feb 27, 2024
ace9451
chore(internal): minor core client restructuring (#179)
stainless-bot Feb 29, 2024
ff322f1
docs(contributing): improve wording (#180)
stainless-bot Feb 29, 2024
795ae88
chore(docs): mention install from git repo (#181)
stainless-bot Mar 1, 2024
17a94e7
chore(internal): split up transforms into sync / async (#182)
stainless-bot Mar 4, 2024
fc2721e
chore(internal): support more input types (#183)
stainless-bot Mar 4, 2024
17dacf2
chore(client): improve error message for invalid http_client argument…
stainless-bot Mar 5, 2024
247964e
chore(internal): add core support for deserializing into number respo…
stainless-bot Mar 6, 2024
03ff063
chore(internal): bump pyright (#186)
stainless-bot Mar 8, 2024
9982119
chore(internal): support parsing Annotated types (#187)
stainless-bot Mar 8, 2024
7a739b9
chore: export NOT_GIVEN sentinel value (#188)
stainless-bot Mar 8, 2024
3b9e36f
feat(api): updates (#189)
stainless-bot Mar 8, 2024
10c6452
release: 1.43.0
stainless-bot Mar 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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-up.com/get | RYE_VERSION="0.15.2" RYE_INSTALL_OPTION="--yes" bash
RUN curl -sSf https://rye-up.com/get | RYE_VERSION="0.24.0" RYE_INSTALL_OPTION="--yes" bash
ENV PATH=/home/vscode/.rye/shims:$PATH

RUN echo "[[ -d .venv ]] && source .venv/bin/activate" >> /home/vscode/.bashrc
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
if: github.repository == 'orbcorp/orb-python'

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Rye
run: |
curl -sSf https://rye-up.com/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: 0.15.2
RYE_VERSION: 0.24.0
RYE_INSTALL_OPTION: "--yes"

- name: Install dependencies
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.

10 changes: 7 additions & 3 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/orbcorp/orb-python/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/orbcorp/orb-python/actions/workflows/publish-pypi.yml
name: Publish PyPI
on:
workflow_dispatch:

release:
types: [published]

jobs:
publish:
name: publish
Expand All @@ -17,7 +21,7 @@ jobs:
curl -sSf https://rye-up.com/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: 0.15.2
RYE_VERSION: 0.24.0
RYE_INSTALL_OPTION: "--yes"

- name: Publish to PyPI
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.ORB_PYPI_TOKEN || secrets.PYPI_TOKEN }}
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.42.3"
".": "1.43.0"
}
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
# Changelog

## 1.43.0 (2024-03-09)

Full Changelog: [v1.42.3...v1.43.0](https://github.com/orbcorp/orb-python/compare/v1.42.3...v1.43.0)

### Features

* **api:** updates ([#189](https://github.com/orbcorp/orb-python/issues/189)) ([3b9e36f](https://github.com/orbcorp/orb-python/commit/3b9e36f1fbca43b9e29794778178056d94870b2e))


### Chores

* **ci:** uses Stainless GitHub App for releases ([#172](https://github.com/orbcorp/orb-python/issues/172)) ([d5b9f5f](https://github.com/orbcorp/orb-python/commit/d5b9f5fff40d93d4aad599b38b8771284619d01d))
* **client:** improve error message for invalid http_client argument ([#184](https://github.com/orbcorp/orb-python/issues/184)) ([17dacf2](https://github.com/orbcorp/orb-python/commit/17dacf22512f6bb7d3cc0c87905f92d964a84a76))
* **client:** use anyio.sleep instead of asyncio.sleep ([#178](https://github.com/orbcorp/orb-python/issues/178)) ([677ef7e](https://github.com/orbcorp/orb-python/commit/677ef7e68840dd04cfbd7cae8e6a5af9998bc306))
* **docs:** mention install from git repo ([#181](https://github.com/orbcorp/orb-python/issues/181)) ([795ae88](https://github.com/orbcorp/orb-python/commit/795ae882855d557105339689155110f4506da4c2))
* export NOT_GIVEN sentinel value ([#188](https://github.com/orbcorp/orb-python/issues/188)) ([7a739b9](https://github.com/orbcorp/orb-python/commit/7a739b9a3b0a06704e02944c1af01930335c2b97))
* **internal:** add core support for deserializing into number response ([#185](https://github.com/orbcorp/orb-python/issues/185)) ([247964e](https://github.com/orbcorp/orb-python/commit/247964ea68575e12ba5aad7c39675a48e3653474))
* **internal:** bump pyright ([#177](https://github.com/orbcorp/orb-python/issues/177)) ([f5c6f0c](https://github.com/orbcorp/orb-python/commit/f5c6f0c3b5a432933a053f227d630df20582c4c4))
* **internal:** bump pyright ([#186](https://github.com/orbcorp/orb-python/issues/186)) ([03ff063](https://github.com/orbcorp/orb-python/commit/03ff063b02838b75a1e8f602aae312afd12e44b6))
* **internal:** bump rye to v0.24.0 ([#175](https://github.com/orbcorp/orb-python/issues/175)) ([450508a](https://github.com/orbcorp/orb-python/commit/450508a34a4838b92c54ff10ba439f6d60808b04))
* **internal:** minor core client restructuring ([#179](https://github.com/orbcorp/orb-python/issues/179)) ([ace9451](https://github.com/orbcorp/orb-python/commit/ace945177ced39721f2eb8ea1ddd9b9b448b73bd))
* **internal:** refactor release environment script ([#173](https://github.com/orbcorp/orb-python/issues/173)) ([2503fbc](https://github.com/orbcorp/orb-python/commit/2503fbc1c20524c9057ab5a1ef25bb279ee35827))
* **internal:** split up transforms into sync / async ([#182](https://github.com/orbcorp/orb-python/issues/182)) ([17a94e7](https://github.com/orbcorp/orb-python/commit/17a94e75d071908b7e9048d26a26adaf16f2b52c))
* **internal:** support more input types ([#183](https://github.com/orbcorp/orb-python/issues/183)) ([fc2721e](https://github.com/orbcorp/orb-python/commit/fc2721e1638b3c79d5e22f573923c09142196c43))
* **internal:** support parsing Annotated types ([#187](https://github.com/orbcorp/orb-python/issues/187)) ([9982119](https://github.com/orbcorp/orb-python/commit/9982119ec618bba15f0e1cfa1eac9adc5168206a))
* **internal:** update deps ([#176](https://github.com/orbcorp/orb-python/issues/176)) ([abdbcc6](https://github.com/orbcorp/orb-python/commit/abdbcc69bb3efc80fabe4980c6eacc3cf8725dbd))


### Documentation

* add CONTRIBUTING.md ([#170](https://github.com/orbcorp/orb-python/issues/170)) ([87d1adf](https://github.com/orbcorp/orb-python/commit/87d1adfaaeb7afaf4741e9e26afb07ac7962b6c1))
* **contributing:** improve wording ([#180](https://github.com/orbcorp/orb-python/issues/180)) ([ff322f1](https://github.com/orbcorp/orb-python/commit/ff322f16b36dba9051c6c6c7c49d2c34419317ca))

## 1.42.3 (2024-02-07)

Full Changelog: [v1.42.2...v1.42.3](https://github.com/orbcorp/orb-python/compare/v1.42.2...v1.42.3)
Expand Down
125 changes: 125 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
## Setting up the environment

### With Rye

We use [Rye](https://rye-up.com/) to manage dependencies so we highly recommend [installing it](https://rye-up.com/guide/installation/) as it will automatically provision a Python environment with the expected Python version.

After installing Rye, you'll just have to run this command:

```sh
$ rye sync --all-features
```

You can then run scripts using `rye run python script.py` or by activating the virtual environment:

```sh
$ rye shell
# or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work
$ source .venv/bin/activate

# now you can omit the `rye run` prefix
$ python script.py
```

### Without Rye

Alternatively if you don't want to install `Rye`, you can stick with the standard `pip` setup by ensuring you have the Python version specified in `.python-version`, create a virtual environment however you desire and then install dependencies using this command:

```sh
$ 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/orb/lib/` and `examples/` directories are exceptions and will never be overridden.

## Adding and running examples

All files in the `examples/` directory are not modified by the Stainless generator and can be freely edited or
added to.

```bash
# add an example to examples/<your-example>.py

#!/usr/bin/env -S rye run python
```

```
chmod +x examples/<your-example>.py
# run the example against your api
./examples/<your-example>.py
```

## Using the repository from source

If you’d like to use the repository from source, you can either install from git or link to a cloned repository:

To install via git:

```bash
pip install git+ssh://git@github.com/orbcorp/orb-python.git
```

Alternatively, you can build from source and install the wheel file:

Building this package will create two files in the `dist/` directory, a `.tar.gz` containing the source files and a `.whl` that can be used to install the package efficiently.

To create a distributable version of the library, all you have to do is run this command:

```bash
rye build
# or
python -m build
```

Then to install:

```sh
pip install ./path-to-wheel-file.whl
```

## Running tests

Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.

```bash
# you will need npm installed
npx prism path/to/your/openapi.yml
```

```bash
rye run pytest
```

## Linting and formatting

This repository uses [ruff](https://github.com/astral-sh/ruff) and
[black](https://github.com/psf/black) to format the code in the repository.

To lint:

```bash
rye run lint
```

To format and fix all ruff issues automatically:

```bash
rye run format
```

## Publishing and releases

Changes made to this repository via the automated release PR pipeline should publish to PyPI automatically. If
the changes aren't made through the automated pipeline, you may want to make releases manually.

### Publish with a GitHub workflow

You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/orbcorp/orb-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.

### Publish manually

If you need to manually release a package, you can run the `bin/publish-pypi` script with an `PYPI_TOKEN` set on
the environment.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The REST API documentation can be found [on docs.withorb.com](https://docs.witho
## Installation

```sh
# install from PyPI
pip install orb-billing
```

Expand Down
8 changes: 2 additions & 6 deletions bin/check-release-environment
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@

errors=()

if [ -z "${STAINLESS_API_KEY}" ]; then
errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organization secrets on GitHub.")
fi

if [ -z "${PYPI_TOKEN}" ]; then
errors+=("The ORB_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
fi

len=${#errors[@]}
lenErrors=${#errors[@]}

if [[ len -gt 0 ]]; then
if [[ lenErrors -gt 0 ]]; then
echo -e "Found the following errors in the release environment:\n"

for error in "${errors[@]}"; do
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "orb-billing"
version = "1.42.3"
version = "1.43.0"
description = "The official Python library for the orb API"
readme = "README.md"
license = "Apache-2.0"
Expand Down
Loading