Skip to content

Commit 4804c40

Browse files
authored
Merge pull request #1 from moderation-api/release-please--branches--main--changes--next
release: 1.0.0
2 parents 50ee715 + ba1f7e2 commit 4804c40

23 files changed

Lines changed: 273 additions & 95 deletions

‎.github/workflows/publish-pypi.yml‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This workflow is triggered when a GitHub release is created.
2+
# It can also be run manually to re-publish to PyPI in case it failed for some reason.
3+
# You can run this workflow by navigating to https://www.github.com/moderation-api/sdk-python/actions/workflows/publish-pypi.yml
4+
name: Publish PyPI
5+
on:
6+
workflow_dispatch:
7+
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
publish:
13+
name: publish
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install Rye
20+
run: |
21+
curl -sSf https://rye.astral.sh/get | bash
22+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
23+
env:
24+
RYE_VERSION: '0.44.0'
25+
RYE_INSTALL_OPTION: '--yes'
26+
27+
- name: Publish to PyPI
28+
run: |
29+
bash ./bin/publish-pypi
30+
env:
31+
PYPI_TOKEN: ${{ secrets.MODERATION_API_PYPI_TOKEN || secrets.PYPI_TOKEN }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Release Doctor
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
8+
jobs:
9+
release_doctor:
10+
name: release doctor
11+
runs-on: ubuntu-latest
12+
if: github.repository == 'moderation-api/sdk-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Check release environment
18+
run: |
19+
bash ./bin/check-release-environment
20+
env:
21+
PYPI_TOKEN: ${{ secrets.MODERATION_API_PYPI_TOKEN || secrets.PYPI_TOKEN }}

‎.release-please-manifest.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "1.0.0"
3+
}

‎.stats.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 27
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api%2Fmoderation-api-b71e4bef3bf1d91ff75dc3414d212613e5be0efb29b773ff12363814491fc604.yml
3-
openapi_spec_hash: 261c3af6614314fbdd6ea3f7fb61979a
4-
config_hash: 3e15855f4c5098c08626c2728c6cbd88
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api%2Fmoderation-api-3eaa6a0657e9f67ea196c65d3b604c71f5406108983981ec696642563fda0a93.yml
3+
openapi_spec_hash: c417a44bb9fa62a02eca68bbb307c712
4+
config_hash: 6d4d59b89f68ea23dddfdefeee29c973

‎CHANGELOG.md‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Changelog
2+
3+
## 1.0.0 (2025-12-06)
4+
5+
Full Changelog: [v0.0.1...v1.0.0](https://github.com/moderation-api/sdk-python/compare/v0.0.1...v1.0.0)
6+
7+
### Features
8+
9+
* **api:** api update ([bc91d96](https://github.com/moderation-api/sdk-python/commit/bc91d96e25700bf7c01fa62b7f22fa11880313dc))
10+
* **api:** api update ([a9968a7](https://github.com/moderation-api/sdk-python/commit/a9968a7a8e5ff58d2fd87633b4afff658523cf5a))
11+
* **api:** api update ([4823b5e](https://github.com/moderation-api/sdk-python/commit/4823b5e2fbd811e2f4eb08e3181d4674d03a59b3))
12+
* **api:** api update ([ad12a65](https://github.com/moderation-api/sdk-python/commit/ad12a65a09be5b7eaf14f770c1c4edb321db6640))
13+
* **api:** manual updates ([50ee715](https://github.com/moderation-api/sdk-python/commit/50ee7151e5ae1e22a2d8017e3f32a7816145a1ac))
14+
* **api:** manual updates ([c8e371a](https://github.com/moderation-api/sdk-python/commit/c8e371ae1be439008fbfb10cfe65d7798aef5eb6))
15+
* **api:** manual updates ([f017cbc](https://github.com/moderation-api/sdk-python/commit/f017cbcec45065e9e6a2f2bfa66cd1e5fa22b851))
16+
* **api:** manual updates ([c49725c](https://github.com/moderation-api/sdk-python/commit/c49725cb034edec7411733f2f63a688940573cac))
17+
* **api:** manual updates ([fa2efc8](https://github.com/moderation-api/sdk-python/commit/fa2efc8b09c8da26be5ec99c97f6ed11bdfc727b))
18+
* **api:** manual updates ([2957153](https://github.com/moderation-api/sdk-python/commit/29571536bb27811f9bd573829884bc36beb8a61b))
19+
* **api:** manual updates ([3ad868f](https://github.com/moderation-api/sdk-python/commit/3ad868f45c737db62e7486299e07027b608047d1))
20+
* **api:** manual updates ([75eae97](https://github.com/moderation-api/sdk-python/commit/75eae9712e59c4a7e8554f83f3ec2a4a55b10e46))
21+
* **api:** manual updates ([2ea195a](https://github.com/moderation-api/sdk-python/commit/2ea195a89e76808ba1957802a6394ea4bf20b039))
22+
* **api:** removed deprecated moderate endpoints ([6c5dd93](https://github.com/moderation-api/sdk-python/commit/6c5dd93fbe80619e6e4b270dfd4624b713ba9c15))
23+
24+
25+
### Bug Fixes
26+
27+
* ensure streams are always closed ([b4d4449](https://github.com/moderation-api/sdk-python/commit/b4d44494343f4925353071967649a414c05ae369))
28+
29+
30+
### Chores
31+
32+
* configure new SDK language ([74c5185](https://github.com/moderation-api/sdk-python/commit/74c5185ae751945b7b24839e406f7c371c8d0b34))
33+
* **deps:** mypy 1.18.1 has a regression, pin to 1.17 ([bbf694f](https://github.com/moderation-api/sdk-python/commit/bbf694f626644c1349960516a152a46bd8af1489))
34+
* **docs:** use environment variables for authentication in code snippets ([166f1cf](https://github.com/moderation-api/sdk-python/commit/166f1cf82be98f8fe92607b3983144af07788da9))
35+
* update lockfile ([ba4d9b9](https://github.com/moderation-api/sdk-python/commit/ba4d9b97fdc0d4a6a34058edc9d0b8dde4c8d5ba))
36+
* update SDK settings ([60af1e1](https://github.com/moderation-api/sdk-python/commit/60af1e123350c2cbacd9f05320048539d28b2cc4))

‎CONTRIBUTING.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ If you’d like to use the repository from source, you can either install from g
6262
To install via git:
6363

6464
```sh
65-
$ pip install git+ssh://git@github.com/stainless-sdks/moderation-api-python.git
65+
$ pip install git+ssh://git@github.com/moderation-api/sdk-python.git
6666
```
6767

6868
Alternatively, you can build from source and install the wheel file:
@@ -120,7 +120,7 @@ the changes aren't made through the automated pipeline, you may want to make rel
120120

121121
### Publish with a GitHub workflow
122122

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

125125
### Publish manually
126126

‎README.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ The REST API documentation can be found on [docs.moderationapi.com](https://docs
1616
## Installation
1717

1818
```sh
19-
# install from this staging repo
20-
pip install git+ssh://git@github.com/stainless-sdks/moderation-api-python.git
19+
# install from the production repo
20+
pip install git+ssh://git@github.com/moderation-api/sdk-python.git
2121
```
2222

2323
> [!NOTE]
@@ -85,8 +85,8 @@ By default, the async client uses `httpx` for HTTP requests. However, for improv
8585
You can enable this by installing `aiohttp`:
8686

8787
```sh
88-
# install from this staging repo
89-
pip install 'moderation_api[aiohttp] @ git+ssh://git@github.com/stainless-sdks/moderation-api-python.git'
88+
# install from the production repo
89+
pip install 'moderation_api[aiohttp] @ git+ssh://git@github.com/moderation-api/sdk-python.git'
9090
```
9191

9292
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
@@ -290,9 +290,9 @@ content = response.parse() # get the object that `content.submit()` would have
290290
print(content.recommendation)
291291
```
292292

293-
These methods return an [`APIResponse`](https://github.com/stainless-sdks/moderation-api-python/tree/main/src/moderation_api/_response.py) object.
293+
These methods return an [`APIResponse`](https://github.com/moderation-api/sdk-python/tree/main/src/moderation_api/_response.py) object.
294294

295-
The async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/moderation-api-python/tree/main/src/moderation_api/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
295+
The async client returns an [`AsyncAPIResponse`](https://github.com/moderation-api/sdk-python/tree/main/src/moderation_api/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
296296

297297
#### `.with_streaming_response`
298298

@@ -401,7 +401,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con
401401

402402
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
403403

404-
We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/moderation-api-python/issues) with questions, bugs, or suggestions.
404+
We are keen for your feedback; please open an [issue](https://www.github.com/moderation-api/sdk-python/issues) with questions, bugs, or suggestions.
405405

406406
### Determining the installed version
407407

‎bin/check-release-environment‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
3+
errors=()
4+
5+
if [ -z "${PYPI_TOKEN}" ]; then
6+
errors+=("The PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
7+
fi
8+
9+
lenErrors=${#errors[@]}
10+
11+
if [[ lenErrors -gt 0 ]]; then
12+
echo -e "Found the following errors in the release environment:\n"
13+
14+
for error in "${errors[@]}"; do
15+
echo -e "- $error\n"
16+
done
17+
18+
exit 1
19+
fi
20+
21+
echo "The environment is ready to push releases!"

‎pyproject.toml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "moderation_api"
3-
version = "0.0.1"
3+
version = "1.0.0"
44
description = "The official Python library for the moderation-api API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -37,8 +37,8 @@ classifiers = [
3737
]
3838

3939
[project.urls]
40-
Homepage = "https://github.com/stainless-sdks/moderation-api-python"
41-
Repository = "https://github.com/stainless-sdks/moderation-api-python"
40+
Homepage = "https://github.com/moderation-api/sdk-python"
41+
Repository = "https://github.com/moderation-api/sdk-python"
4242

4343
[project.optional-dependencies]
4444
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"]
@@ -126,7 +126,7 @@ path = "README.md"
126126
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
127127
# replace relative links with absolute links
128128
pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)'
129-
replacement = '[\1](https://github.com/stainless-sdks/moderation-api-python/tree/main/\g<2>)'
129+
replacement = '[\1](https://github.com/moderation-api/sdk-python/tree/main/\g<2>)'
130130

131131
[tool.pytest.ini_options]
132132
testpaths = ["tests"]

‎release-please-config.json‎

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"packages": {
3+
".": {}
4+
},
5+
"$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json",
6+
"include-v-in-tag": true,
7+
"include-component-in-tag": false,
8+
"versioning": "prerelease",
9+
"prerelease": true,
10+
"bump-minor-pre-major": true,
11+
"bump-patch-for-minor-pre-major": false,
12+
"pull-request-header": "Automated Release PR",
13+
"pull-request-title-pattern": "release: ${version}",
14+
"changelog-sections": [
15+
{
16+
"type": "feat",
17+
"section": "Features"
18+
},
19+
{
20+
"type": "fix",
21+
"section": "Bug Fixes"
22+
},
23+
{
24+
"type": "perf",
25+
"section": "Performance Improvements"
26+
},
27+
{
28+
"type": "revert",
29+
"section": "Reverts"
30+
},
31+
{
32+
"type": "chore",
33+
"section": "Chores"
34+
},
35+
{
36+
"type": "docs",
37+
"section": "Documentation"
38+
},
39+
{
40+
"type": "style",
41+
"section": "Styles"
42+
},
43+
{
44+
"type": "refactor",
45+
"section": "Refactors"
46+
},
47+
{
48+
"type": "test",
49+
"section": "Tests",
50+
"hidden": true
51+
},
52+
{
53+
"type": "build",
54+
"section": "Build System"
55+
},
56+
{
57+
"type": "ci",
58+
"section": "Continuous Integration",
59+
"hidden": true
60+
}
61+
],
62+
"release-type": "python",
63+
"extra-files": [
64+
"src/moderation_api/_version.py"
65+
]
66+
}

0 commit comments

Comments
 (0)