File tree Expand file tree Collapse file tree 4 files changed +50
-2
lines changed
openapi_python_client/templates Expand file tree Collapse file tree 4 files changed +50
-2
lines changed Original file line number Diff line number Diff line change @@ -35,3 +35,18 @@ Things to know:
35351 . If the API returns a response code that was not declared in the OpenAPI document, a
3636 ` {{ package_name }}.api.errors.ApiResponseError ` wil be raised
3737 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:
34341 . Any endpoint which did not have a tag will be in ` my_test_api_client.api.default `
35351 . If the API returns a response code that was not declared in the OpenAPI document, a
3636 ` 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
21import shutil
32from filecmp import cmpfiles , dircmp
43from pathlib import Path
You can’t perform that action at this time.
0 commit comments