Skip to content

Commit f563b7d

Browse files
committed
2 parents cca58a5 + bf9d860 commit f563b7d

3,106 files changed

Lines changed: 199211 additions & 82529 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: CI
2+
23
on:
34
push:
45
branches:
@@ -8,11 +9,15 @@ on:
89
- main
910
- next
1011

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
1116
jobs:
1217
lint:
1318
name: lint
1419
runs-on: ubuntu-latest
15-
20+
timeout-minutes: 5
1621

1722
steps:
1823
- uses: actions/checkout@v4
@@ -33,6 +38,7 @@ jobs:
3338
test:
3439
name: test
3540
runs-on: ubuntu-latest
41+
timeout-minutes: 30
3642

3743
steps:
3844
- uses: actions/checkout@v4
@@ -53,6 +59,7 @@ jobs:
5359
examples:
5460
name: examples
5561
runs-on: ubuntu-latest
62+
timeout-minutes: 5
5663

5764
steps:
5865
- uses: actions/checkout@v4
@@ -68,10 +75,11 @@ jobs:
6875
run: |
6976
rye sync --all-features
7077
71-
- env:
78+
- env:
7279
CLOUDFLARE_ACCOUNT_ID: f037e56e89293a057740de681ac9abbe
7380
CLOUDFLARE_EMAIL: terraform-acceptance-test@cfapi.net
74-
CLOUDFLARE_ZONE_ID: 0da42c8d2132a9ddaf714f9e7c92011
81+
CLOUDFLARE_ZONE_ID: 0da42c8d2132a9ddaf714f9e7c920711
7582
CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }}
7683
run: |
77-
rye run python ./examples/workers/ai/demo.py
84+
rye run python ./examples/ai/demo.py
85+
rye run python ./examples/dns/record.py

.github/workflows/release-doctor.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
name: Release Doctor
2+
23
on:
34
pull_request:
5+
branches:
6+
- main
47
workflow_dispatch:
58

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
613
jobs:
714
release_doctor:
815
name: release doctor
916
runs-on: ubuntu-latest
17+
timeout-minutes: 2
1018
if: github.repository == 'cloudflare/cloudflare-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
1119

1220
steps:

.github/workflows/semgrep.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
on:
2+
workflow_dispatch: {}
3+
schedule:
4+
- cron: '0 4 * * *'
5+
name: Semgrep config
6+
jobs:
7+
semgrep:
8+
name: semgrep/ci
9+
runs-on: ubuntu-latest
10+
env:
11+
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
12+
SEMGREP_URL: https://cloudflare.semgrep.dev
13+
SEMGREP_APP_URL: https://cloudflare.semgrep.dev
14+
SEMGREP_VERSION_CHECK_URL: https://cloudflare.semgrep.dev/api/check-version
15+
container:
16+
image: returntocorp/semgrep
17+
steps:
18+
- uses: actions/checkout@v4
19+
- run: semgrep ci

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "3.1.0"
2+
".": "4.0.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 1256
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-923d8c7667b68c786e6c026c4f4851798943c7d68ea055c0043d9253413c5847.yml
1+
configured_endpoints: 1493
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3d78f855257b55bbb80884f99c3802cae877968d140eed3557fcb2cdd5f937b3.yml

CHANGELOG.md

Lines changed: 264 additions & 0 deletions
Large diffs are not rendered by default.

CONTRIBUTING.md

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22

33
### With Rye
44

5-
We use [Rye](https://rye.astral.sh/) to manage dependencies so we highly recommend [installing it](https://rye.astral.sh/guide/installation/) as it will automatically provision a Python environment with the expected Python version.
5+
We use [Rye](https://rye.astral.sh/) to manage dependencies because it will automatically provision a Python environment with the expected Python version. To set it up, run:
66

7-
After installing Rye, you'll just have to run this command:
7+
```sh
8+
$ ./scripts/bootstrap
9+
```
10+
11+
Or [install Rye manually](https://rye.astral.sh/guide/installation/) and run:
812

913
```sh
1014
$ rye sync --all-features
@@ -31,25 +35,25 @@ $ pip install -r requirements-dev.lock
3135

3236
## Modifying/Adding code
3337

34-
Most of the SDK is generated code, and any modified code will be overridden on the next generation. The
35-
`src/cloudflare/lib/` and `examples/` directories are exceptions and will never be overridden.
38+
Most of the SDK is generated code. Modifications to code will be persisted between generations, but may
39+
result in merge conflicts between manual patches and changes from the generator. The generator will never
40+
modify the contents of the `src/cloudflare/lib/` and `examples/` directories.
3641

3742
## Adding and running examples
3843

39-
All files in the `examples/` directory are not modified by the Stainless generator and can be freely edited or
40-
added to.
44+
All files in the `examples/` directory are not modified by the generator and can be freely edited or added to.
4145

42-
```bash
46+
```py
4347
# add an example to examples/<your-example>.py
4448

4549
#!/usr/bin/env -S rye run python
4650
4751
```
4852

49-
```
50-
chmod +x examples/<your-example>.py
53+
```sh
54+
$ chmod +x examples/<your-example>.py
5155
# run the example against your api
52-
./examples/<your-example>.py
56+
$ ./examples/<your-example>.py
5357
```
5458

5559
## Using the repository from source
@@ -58,8 +62,8 @@ If you’d like to use the repository from source, you can either install from g
5862

5963
To install via git:
6064

61-
```bash
62-
pip install git+ssh://git@github.com/cloudflare/cloudflare-python.git
65+
```sh
66+
$ pip install git+ssh://git@github.com/cloudflare/cloudflare-python.git
6367
```
6468

6569
Alternatively, you can build from source and install the wheel file:
@@ -68,29 +72,29 @@ Building this package will create two files in the `dist/` directory, a `.tar.gz
6872

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

71-
```bash
72-
rye build
75+
```sh
76+
$ rye build
7377
# or
74-
python -m build
78+
$ python -m build
7579
```
7680

7781
Then to install:
7882

7983
```sh
80-
pip install ./path-to-wheel-file.whl
84+
$ pip install ./path-to-wheel-file.whl
8185
```
8286

8387
## Running tests
8488

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

87-
```bash
91+
```sh
8892
# you will need npm installed
89-
npx prism mock path/to/your/openapi.yml
93+
$ npx prism mock path/to/your/openapi.yml
9094
```
9195

92-
```bash
93-
rye run pytest
96+
```sh
97+
$ ./scripts/test
9498
```
9599

96100
## Linting and formatting
@@ -100,14 +104,14 @@ This repository uses [ruff](https://github.com/astral-sh/ruff) and
100104

101105
To lint:
102106

103-
```bash
104-
rye run lint
107+
```sh
108+
$ ./scripts/lint
105109
```
106110

107111
To format and fix all ruff issues automatically:
108112

109-
```bash
110-
rye run format
113+
```sh
114+
$ ./scripts/format
111115
```
112116

113117
## Publishing and releases

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2024 Cloudflare
189+
Copyright 2025 Cloudflare
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)