File tree 4 files changed +50
-2
lines changed
openapi_python_client/templates
4 files changed +50
-2
lines changed Original file line number Diff line number Diff line change @@ -35,3 +35,18 @@ Things to know:
35
35
1 . If the API returns a response code that was not declared in the OpenAPI document, a
36
36
` {{ package_name }}.api.errors.ApiResponseError ` wil be raised
37
37
with the ` response ` attribute set to the ` httpx.Response ` that was received.
38
+
39
+
40
+ ## Building / publishing this Client
41
+ This project uses [ Poetry] ( https://python-poetry.org/ ) to manage dependencies and packaging. Here are the basics:
42
+ 1 . Update the metadata in pyproject.toml (e.g. authors, version)
43
+ 1 . If you're using a private repository, configure it with Poetry
44
+ 1 . ` poetry config repositories.<your-repository-name> <url-to-your-repository> `
45
+ 1 . ` poetry config http-basic.<your-repository-name> <username> <password> `
46
+ 1 . Publish the client with ` poetry publish --build -r <your-repository-name> ` or, if for public PyPI, just ` poetry publish --build `
47
+
48
+ If you want to install this client into another project without publishing it (e.g. for development) then:
49
+ 1 . If that project ** is using Poetry** , you can simply do ` poetry add <path-to-this-client> ` from that project
50
+ 1 . If that project is not using Poetry:
51
+ 1 . Build a wheel with ` poetry build -f wheel `
52
+ 1 . Install that wheel from the other project ` pip install <path-to-wheel> `
Original file line number Diff line number Diff line change @@ -34,4 +34,19 @@ Things to know:
34
34
1 . Any endpoint which did not have a tag will be in ` my_test_api_client.api.default `
35
35
1 . If the API returns a response code that was not declared in the OpenAPI document, a
36
36
` my_test_api_client.api.errors.ApiResponseError ` wil be raised
37
- with the ` response ` attribute set to the ` httpx.Response ` that was received.
37
+ with the ` response ` attribute set to the ` httpx.Response ` that was received.
38
+
39
+
40
+ ## Building / publishing this Client
41
+ This project uses [ Poetry] ( https://python-poetry.org/ ) to manage dependencies and packaging. Here are the basics:
42
+ 1 . Update the metadata in pyproject.toml (e.g. authors, version)
43
+ 1 . If you're using a private repository, configure it with Poetry
44
+ 1 . ` poetry config repositories.<your-repository-name> <url-to-your-repository> `
45
+ 1 . ` poetry config http-basic.<your-repository-name> <username> <password> `
46
+ 1 . Publish the client with ` poetry publish --build -r <your-repository-name> ` or, if for public PyPI, just ` poetry publish --build `
47
+
48
+ If you want to install this client into another project without publishing it (e.g. for development) then:
49
+ 1 . If that project ** is using Poetry** , you can simply do ` poetry add <path-to-this-client> ` from that project
50
+ 1 . If that project is not using Poetry:
51
+ 1 . Build a wheel with ` poetry build -f wheel `
52
+ 1 . Install that wheel from the other project ` pip install <path-to-wheel> `
Original file line number Diff line number Diff line change
1
+ """ Regenerate golden-master """
2
+ import shutil
3
+ from pathlib import Path
4
+
5
+ from typer .testing import CliRunner
6
+
7
+ from openapi_python_client .cli import app
8
+
9
+
10
+ if __name__ == '__main__' :
11
+ runner = CliRunner ()
12
+ openapi_path = Path (__file__ ).parent / "fastapi" / "openapi.json"
13
+ gm_path = Path (__file__ ).parent / "golden-master"
14
+ shutil .rmtree (gm_path )
15
+ output_path = Path .cwd () / "my-test-api-client"
16
+
17
+ runner .invoke (app , ["generate" , f"--path={ openapi_path } " ])
18
+
19
+ output_path .rename (gm_path )
Original file line number Diff line number Diff line change 1
- import os
2
1
import shutil
3
2
from filecmp import cmpfiles , dircmp
4
3
from pathlib import Path
You can’t perform that action at this time.
0 commit comments