Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
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/jed-richards/tmdb-client-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.TMDB_CLIENT_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 == 'jed-richards/tmdb-client-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.TMDB_CLIENT_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.0.1-alpha.1"
}
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Changelog

## 0.0.1-alpha.1 (2025-01-09)

Full Changelog: [v0.0.1-alpha.0...v0.0.1-alpha.1](https://github.com/jed-richards/tmdb-client-python/compare/v0.0.1-alpha.0...v0.0.1-alpha.1)

### Bug Fixes

* **client:** only call .close() when needed ([#14](https://github.com/jed-richards/tmdb-client-python/issues/14)) ([03ff396](https://github.com/jed-richards/tmdb-client-python/commit/03ff396a1a3ed1aff8ddec6558c16b61c7a0a7c5))


### Chores

* add missing isclass check ([#12](https://github.com/jed-richards/tmdb-client-python/issues/12)) ([bf22165](https://github.com/jed-richards/tmdb-client-python/commit/bf2216509089b73a5a830e0c0393a0b0e694c27d))
* go live ([#1](https://github.com/jed-richards/tmdb-client-python/issues/1)) ([52d09bc](https://github.com/jed-richards/tmdb-client-python/commit/52d09bcc58858516926e87291888cd7876f30528))
* **internal:** add support for TypeAliasType ([#7](https://github.com/jed-richards/tmdb-client-python/issues/7)) ([a2431e4](https://github.com/jed-richards/tmdb-client-python/commit/a2431e4606b1297233cf838e4abf312e757edde8))
* **internal:** bump httpx dependency ([#13](https://github.com/jed-richards/tmdb-client-python/issues/13)) ([d9c9a06](https://github.com/jed-richards/tmdb-client-python/commit/d9c9a06ead15699f26276bfc5d8183e4ab72a22e))
* **internal:** bump pydantic dependency ([#4](https://github.com/jed-richards/tmdb-client-python/issues/4)) ([f003528](https://github.com/jed-richards/tmdb-client-python/commit/f0035285be67634d4e311df2cf3b798fd58d1a91))
* **internal:** bump pyright ([#6](https://github.com/jed-richards/tmdb-client-python/issues/6)) ([c9a92ad](https://github.com/jed-richards/tmdb-client-python/commit/c9a92ada7b47a1511dc4b0350709aadf41240745))
* **internal:** codegen related update ([#11](https://github.com/jed-richards/tmdb-client-python/issues/11)) ([741ad29](https://github.com/jed-richards/tmdb-client-python/commit/741ad292ca22a50b74b902b84b2e70e18a8dbf51))
* **internal:** codegen related update ([#16](https://github.com/jed-richards/tmdb-client-python/issues/16)) ([c4702b5](https://github.com/jed-richards/tmdb-client-python/commit/c4702b53299800eb15141b699eeb82a098782a95))
* **internal:** codegen related update ([#8](https://github.com/jed-richards/tmdb-client-python/issues/8)) ([9ccc77a](https://github.com/jed-richards/tmdb-client-python/commit/9ccc77a8ba80f8b141d24793f55b2b27124a21d0))
* **internal:** codegen related update ([#9](https://github.com/jed-richards/tmdb-client-python/issues/9)) ([01084c7](https://github.com/jed-richards/tmdb-client-python/commit/01084c7c7ae65525a21c1168d45a9da98809bc64))
* **internal:** fix some typos ([#10](https://github.com/jed-richards/tmdb-client-python/issues/10)) ([6fef57c](https://github.com/jed-richards/tmdb-client-python/commit/6fef57c3ac4687a3a912b1706ee608e73f0b3437))
* make the `Omit` type public ([#3](https://github.com/jed-richards/tmdb-client-python/issues/3)) ([910225b](https://github.com/jed-richards/tmdb-client-python/commit/910225bbb05dc000e96c966a00255d30ad5679a2))


### Documentation

* fix typos ([#15](https://github.com/jed-richards/tmdb-client-python/issues/15)) ([53cbcfb](https://github.com/jed-richards/tmdb-client-python/commit/53cbcfb1873ad9596e6bcb6c250a54d95e3c7865))
* **readme:** fix http client proxies example ([#5](https://github.com/jed-richards/tmdb-client-python/issues/5)) ([05b8868](https://github.com/jed-richards/tmdb-client-python/commit/05b886849209ea96594aaf8daab2ec65d5ba45ec))
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/tmdb-client-python.git
$ pip install git+ssh://git@github.com/jed-richards/tmdb-client-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/tmdb-client-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/jed-richards/tmdb-client-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.

### Publish manually

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2024 Tmdb Client
Copyright 2025 Tmdb Client

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
34 changes: 22 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ The REST API documentation can be found on [docs.tmdb-client.com](https://docs.t
## Installation

```sh
# install from this staging repo
pip install git+ssh://git@github.com/stainless-sdks/tmdb-client-python.git
# install from the production repo
pip install git+ssh://git@github.com/jed-richards/tmdb-client-python.git
```

> [!NOTE]
Expand Down Expand Up @@ -104,7 +104,7 @@ except tmdb_client.APIStatusError as e:
print(e.response)
```

Error codes are as followed:
Error codes are as follows:

| Status Code | Error Type |
| ----------- | -------------------------- |
Expand Down Expand Up @@ -206,9 +206,9 @@ latest = response.parse() # get the object that `movies.latest.retrieve()` woul
print(latest.id)
```

These methods return an [`APIResponse`](https://github.com/stainless-sdks/tmdb-client-python/tree/main/src/tmdb_client/_response.py) object.
These methods return an [`APIResponse`](https://github.com/jed-richards/tmdb-client-python/tree/main/src/tmdb_client/_response.py) object.

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

#### `.with_streaming_response`

Expand All @@ -235,8 +235,7 @@ If you need to access undocumented endpoints, params, or response properties, th
#### Undocumented endpoints

To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other
http verbs. Options on the client will be respected (such as retries) will be respected when making this
request.
http verbs. Options on the client will be respected (such as retries) when making this request.

```py
import httpx
Expand Down Expand Up @@ -265,18 +264,19 @@ can also get all the extra fields on the Pydantic model as a dict with

You can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:

- Support for proxies
- Custom transports
- Support for [proxies](https://www.python-httpx.org/advanced/proxies/)
- Custom [transports](https://www.python-httpx.org/advanced/transports/)
- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality

```python
import httpx
from tmdb_client import TmdbClient, DefaultHttpxClient

client = TmdbClient(
# Or use the `TMDB_CLIENT_BASE_URL` env var
base_url="http://my.test.server.example.com:8083",
http_client=DefaultHttpxClient(
proxies="http://my.test.proxy.example.com",
proxy="http://my.test.proxy.example.com",
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
),
)
Expand All @@ -292,17 +292,27 @@ client.with_options(http_client=DefaultHttpxClient(...))

By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.

```py
from tmdb_client import TmdbClient

with TmdbClient() as client:
# make requests here
...

# HTTP client is now closed
```

## Versioning

This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:

1. Changes that only affect static types, without breaking runtime behavior.
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
3. Changes that we do not expect to impact the vast majority of users in practice.

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/tmdb-client-python/issues) with questions, bugs, or suggestions.
We are keen for your feedback; please open an [issue](https://www.github.com/jed-richards/tmdb-client-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 TMDB_CLIENT_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!"
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "tmdb_client"
version = "0.0.1-alpha.0"
version = "0.0.1-alpha.1"
description = "The official Python library for the tmdb-client API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand All @@ -10,7 +10,7 @@ authors = [
dependencies = [
"httpx>=0.23.0, <1",
"pydantic>=1.9.0, <3",
"typing-extensions>=4.7, <5",
"typing-extensions>=4.10, <5",
"anyio>=3.5.0, <5",
"distro>=1.7.0, <2",
"sniffio",
Expand All @@ -34,8 +34,8 @@ classifiers = [
]

[project.urls]
Homepage = "https://github.com/stainless-sdks/tmdb-client-python"
Repository = "https://github.com/stainless-sdks/tmdb-client-python"
Homepage = "https://github.com/jed-richards/tmdb-client-python"
Repository = "https://github.com/jed-richards/tmdb-client-python"



Expand All @@ -54,7 +54,7 @@ dev-dependencies = [
"dirty-equals>=0.6.0",
"importlib-metadata>=6.7.0",
"rich>=13.7.1",
"nest_asyncio==1.6.0"
"nest_asyncio==1.6.0",
]

[tool.rye.scripts]
Expand Down Expand Up @@ -122,7 +122,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/tmdb-client-python/tree/main/\g<2>)'
replacement = '[\1](https://github.com/jed-richards/tmdb-client-python/tree/main/\g<2>)'

[tool.pytest.ini_options]
testpaths = ["tests"]
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/tmdb_client/_version.py"
]
}
11 changes: 5 additions & 6 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ h11==0.14.0
# via httpcore
httpcore==1.0.2
# via httpx
httpx==0.25.2
httpx==0.28.1
# via respx
# via tmdb-client
idna==3.4
Expand All @@ -62,21 +62,21 @@ platformdirs==3.11.0
# via virtualenv
pluggy==1.5.0
# via pytest
pydantic==2.9.2
pydantic==2.10.3
# via tmdb-client
pydantic-core==2.23.4
pydantic-core==2.27.1
# via pydantic
pygments==2.18.0
# via rich
pyright==1.1.389
pyright==1.1.390
pytest==8.3.3
# via pytest-asyncio
pytest-asyncio==0.24.0
python-dateutil==2.8.2
# via time-machine
pytz==2023.3.post1
# via dirty-equals
respx==0.20.2
respx==0.22.0
rich==13.7.1
ruff==0.6.9
setuptools==68.2.2
Expand All @@ -85,7 +85,6 @@ six==1.16.0
# via python-dateutil
sniffio==1.3.0
# via anyio
# via httpx
# via tmdb-client
time-machine==2.9.0
tomli==2.0.2
Expand Down
Loading
Loading