You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,32 +1,32 @@
1
1
## Setting up the environment
2
2
3
-
### With Rye
3
+
### With `uv`
4
4
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:
5
+
We use [uv](https://docs.astral.sh/uv/) to manage dependencies because it will automatically provision a Python environment with the expected Python version. To set it up, run:
6
6
7
7
```sh
8
8
$ ./scripts/bootstrap
9
9
```
10
10
11
-
Or [install Rye manually](https://rye.astral.sh/guide/installation/) and run:
11
+
Or [install uv manually](https://docs.astral.sh/uv/getting-started/installation/) and run:
12
12
13
13
```sh
14
-
$ rye sync --all-features
14
+
$ uv sync --all-extras
15
15
```
16
16
17
-
You can then run scripts using `rye run python script.py` or by activating the virtual environment:
17
+
You can then run scripts using `uv run python script.py` or by manually activating the virtual environment:
18
18
19
19
```sh
20
-
#Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
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:
29
+
Alternatively if you don't want to install `uv`, 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:
30
30
31
31
```sh
32
32
$ pip install -r requirements-dev.lock
@@ -45,7 +45,7 @@ All files in the `examples/` directory are not modified by the generator and can
45
45
```py
46
46
# add an example to examples/<your-example>.py
47
47
48
-
#!/usr/bin/env -S rye run python
48
+
#!/usr/bin/env -S uv run python
49
49
…
50
50
```
51
51
@@ -72,7 +72,7 @@ Building this package will create two files in the `dist/` directory, a `.tar.gz
72
72
To create a distributable version of the library, all you have to do is run this command:
Copy file name to clipboardExpand all lines: README.md
-39Lines changed: 0 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,45 +29,6 @@ The REST API documentation can be found on [developers.cloudflare.com](https://d
29
29
pip install --pre cloudflare
30
30
```
31
31
32
-
## Authentication
33
-
34
-
The SDK supports multiple authentication methods. Each can be provided as a constructor argument or read automatically from an environment variable.
35
-
36
-
### API Token (recommended)
37
-
38
-
[API tokens](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/) are scoped to specific permissions and are the recommended way to authenticate.
39
-
40
-
```python
41
-
from cloudflare import Cloudflare
42
-
43
-
client = Cloudflare(api_token="your-api-token")
44
-
45
-
# Or set the CLOUDFLARE_API_TOKEN environment variable and omit the argument:
46
-
client = Cloudflare()
47
-
```
48
-
49
-
### API Key + Email
50
-
51
-
The [Global API Key](https://developers.cloudflare.com/fundamentals/api/get-started/keys/) authenticates using a key and email pair. Both must be provided together.
52
-
53
-
```python
54
-
from cloudflare import Cloudflare
55
-
56
-
client = Cloudflare(
57
-
api_key="your-global-api-key",
58
-
api_email="user@example.com",
59
-
)
60
-
61
-
# Or set CLOUDFLARE_API_KEY and CLOUDFLARE_EMAIL environment variables:
62
-
client = Cloudflare()
63
-
```
64
-
65
-
| Parameter | Environment variable | Header sent |
0 commit comments