Skip to content

Commit

Permalink
Excavator: Upgrade API Version (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
svc-excavator-bot authored Jan 29, 2025
1 parent d40c6ec commit 85de682
Show file tree
Hide file tree
Showing 28 changed files with 338 additions and 281 deletions.
46 changes: 22 additions & 24 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,18 @@ jobs:
type: string
pydantic_version:
type: string
requests_version:
httpx_version:
type: string
docker:
- image: cimg/python:<< parameters.python_version >>
steps:
- checkout
- run: pip install --user tox
- run: poetry --no-ansi install --no-root --sync
- run: poetry --no-ansi run tox -v -e py<< parameters.python_version >>-pydantic<< parameters.pydantic_version >>-requests<< parameters.requests_version >> --recreate

pyright:
docker:
- image: cimg/python:3.12
steps:
- checkout
- run: pip install --user tox
- run: python -m tox -e pyright
- run: |
PYDANTIC_VERSION=<< parameters.pydantic_version >>.* \
HTTPX_VERSION=<< parameters.httpx_version >>.* \
poetry --no-ansi run tox -v -e py<< parameters.python_version >> --recreate
black:
docker:
Expand Down Expand Up @@ -65,26 +60,24 @@ workflows:
matrix:
parameters:
python_version: ["3.9", "3.10", "3.11", "3.12"]
pydantic_version: ["2.4"]
requests_version: ["2.31"]
pydantic_version: ["2.10"]
httpx_version: ["0.28"]
- test:
<<: *always-run
name: pydantic-<< matrix.pydantic_version >>
matrix:
parameters:
python_version: ["3.12"]
pydantic_version: ["2.1.0", "2.1", "2.2", "2.3", "2.4", "2.5"]
requests_version: ["2.31"]
pydantic_version: ["2.1", "2.2", "2.3", "2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10"]
httpx_version: ["0.28"]
- test:
<<: *always-run
name: requests-<< matrix.requests_version >>
name: httpx-<< matrix.httpx_version >>
matrix:
parameters:
python_version: ["3.12"]
pydantic_version: ["2.4"]
requests_version: ["2.25", "2.26", "2.31"]
- pyright:
<<: *always-run
pydantic_version: ["2.10"]
httpx_version: ["0.24", "0.25", "0.26", "0.27", "0.28"]
- black:
<<: *always-run
- circle-all:
Expand All @@ -95,18 +88,23 @@ workflows:
- python-3.11
- python-3.12

- pydantic-2.1.0
- pydantic-2.1
- pydantic-2.2
- pydantic-2.3
- pydantic-2.4
- pydantic-2.5
- pydantic-2.6
- pydantic-2.7
- pydantic-2.8
- pydantic-2.9
- pydantic-2.10

- requests-2.25
- requests-2.26
- requests-2.31
- httpx-0.24
- httpx-0.25
- httpx-0.26
- httpx-0.27
- httpx-0.28

- pyright
- black
- publish:
requires:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
**/__pycache__
*.pyc
tmp
test.py
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,12 @@ There are a handful of other exception classes that could be thrown when instant
| ErrorClass | Thrown Directly | Description |
| ------------------------ | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| NotAuthenticated | Yes | You used either `ConfidentialClientAuth` or `PublicClientAuth` to make an API call without going through the OAuth process first. |
| ConnectionError | Yes | An issue occurred when connecting to the server. This also catches both `ProxyError` and `SSLError`. |
| ConnectionError | Yes | An issue occurred when connecting to the server. This also catches `ProxyError`. |
| ProxyError | Yes | An issue occurred when connecting to or authenticating with a proxy server. |
| SSLError | Yes | An SSL error occurred when connecting to the server. |
| TimeoutError | No | The request timed out. This catches both `ConnectTimeout` and `ReadTimeout`. |
| TimeoutError | No | The request timed out. This catches both `ConnectTimeout`, `ReadTimeout` and `WriteTimeout`. |
| ConnectTimeout | Yes | The request timed out when attempting to connect to the server. |
| ReadTimeout | Yes | The server did not send any data in the allotted amount of time. |
| WriteTimeout | Yes | There was a timeout when writing data to the server. |
| StreamConsumedError | Yes | The content of the given stream has already been consumed. |
| SDKInternalError | Yes | An unexpected issue occurred and should be reported. |

Expand Down Expand Up @@ -375,7 +375,7 @@ The full list of options can be found below.
- `default_headers` (dict[str, str]): HTTP headers to include with all requests.
- `proxies` (dict["http" | "https", str]): Proxies to use for HTTP and HTTPS requests.
- `timeout` (int | float): The default timeout for all requests in seconds.
- `verify` (bool | str): SSL verification, can be a boolean or a path to a CA bundle.
- `verify` (bool | str): SSL verification, can be a boolean or a path to a CA bundle. Defaults to `True`.
- `default_params` (dict[str, Any]): URL query parameters to include with all requests.
- `scheme` ("http" | "https"): URL scheme to use ('http' or 'https'). Defaults to 'https'.

Expand Down
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-112.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Migrate backend from `requests` to `httpx`
links:
- https://github.com/palantir/foundry-platform-python/pull/112
7 changes: 5 additions & 2 deletions foundry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
from foundry._errors import RateLimitError
from foundry._errors import ReadTimeout
from foundry._errors import SDKInternalError
from foundry._errors import SSLError
from foundry._errors import StreamConsumedError
from foundry._errors import TimeoutError
from foundry._errors import UnauthorizedError
from foundry._errors import UnprocessableEntityError
from foundry._errors import WriteTimeout

# The OpenAPI document version from the spec information
# See https://swagger.io/specification/#info-object
Expand All @@ -61,7 +61,6 @@
"NotAuthenticated",
"ConnectionError",
"ProxyError",
"SSLError",
"PalantirRPCException",
"BadRequestError",
"UnauthorizedError",
Expand All @@ -72,4 +71,8 @@
"InternalServerError",
"SDKInternalError",
"StreamConsumedError",
"ConnectTimeout",
"ReadTimeout",
"WriteTimeout",
"TimeoutError",
]
Loading

0 comments on commit 85de682

Please sign in to comment.