Skip to content

Commit 8c3a33b

Browse files
authored
Addressing (some) stainless notion doc comments (#264)
* Added session create helper * Using existing types * Showing only async python examples * docs show using uv * Added local example * lint fix
1 parent 4abfc84 commit 8c3a33b

File tree

11 files changed

+826
-302
lines changed

11 files changed

+826
-302
lines changed

CONTRIBUTING.md

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,10 @@ Or [install uv manually](https://docs.astral.sh/uv/getting-started/installation/
1414
$ uv sync --all-extras
1515
```
1616

17-
You can then run scripts using `uv run python script.py` or by manually activating the virtual environment:
17+
You can then run scripts using `uv run python script.py`:
1818

1919
```sh
20-
# manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work
21-
$ source .venv/bin/activate
22-
23-
# now you can omit the `uv run` prefix
24-
$ python script.py
25-
```
26-
27-
### Without `uv`
28-
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-
31-
```sh
32-
$ pip install -r requirements-dev.lock
20+
uv run python script.py
3321
```
3422

3523
## Modifying/Adding code
@@ -103,7 +91,7 @@ If you’d like to use the repository from source, you can either install from g
10391
To install via git:
10492

10593
```sh
106-
$ pip install git+ssh://git@github.com/browserbase/stagehand-python#stainless.git
94+
uv run pip install git+ssh://git@github.com/browserbase/stagehand-python#stainless.git
10795
```
10896

10997
Alternatively, you can build from source and install the wheel file:
@@ -115,13 +103,13 @@ To create a distributable version of the library, all you have to do is run this
115103
```sh
116104
$ uv build
117105
# or
118-
$ python -m build
106+
$ uv run python -m build
119107
```
120108

121109
Then to install:
122110

123111
```sh
124-
$ pip install ./path-to-wheel-file.whl
112+
uv run pip install ./path-to-wheel-file.whl
125113
```
126114

127115
## Running tests
@@ -134,7 +122,7 @@ $ npx prism mock path/to/your/openapi.yml
134122
```
135123

136124
```sh
137-
$ ./scripts/test
125+
$ uv run -- ./scripts/test
138126
```
139127

140128
## Linting and formatting
@@ -145,13 +133,13 @@ This repository uses [ruff](https://github.com/astral-sh/ruff) and
145133
To lint:
146134

147135
```sh
148-
$ ./scripts/lint
136+
$ uv run -- ./scripts/lint
149137
```
150138

151139
To format and fix all ruff issues automatically:
152140

153141
```sh
154-
$ ./scripts/format
142+
$ uv run -- ./scripts/format
155143
```
156144

157145
## Publishing and releases

0 commit comments

Comments
 (0)