Skip to content

Commit a985a8b

Browse files
author
Stainless Bot
committed
docs: improve and reference contributing documentation (#1767)
1 parent b7d9ce7 commit a985a8b

File tree

2 files changed

+28
-20
lines changed

2 files changed

+28
-20
lines changed

CONTRIBUTING.md

+24-20
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22

33
### With Rye
44

5-
We use [Rye](https://rye-up.com/) to manage dependencies so we highly recommend [installing it](https://rye-up.com/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
@@ -39,17 +43,17 @@ modify the contents of the `src/openai/lib/` and `examples/` directories.
3943

4044
All files in the `examples/` directory are not modified by the generator and can be freely edited or added to.
4145

42-
```bash
46+
```ts
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://[email protected]/openai/openai-python.git
65+
```sh
66+
$ pip install git+ssh://[email protected]/openai/openai-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

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -713,3 +713,7 @@ print(openai.__version__)
713713
## Requirements
714714

715715
Python 3.7 or higher.
716+
717+
## Contributing
718+
719+
See [the contributing documentation](./CONTRIBUTING.md).

0 commit comments

Comments
 (0)