Skip to content

Commit

Permalink
release: 0.48.6 (#483)
Browse files Browse the repository at this point in the history
* chore(ci): update rye to v0.35.0 (#482)

* chore(internal): minor request options handling changes (#484)

* chore(internal): add helper function (#485)

* chore(internal): update mypy (#486)

* chore(ci): also run workflows for PRs targeting `next` (#487)

* chore(internal): minor import restructuring (#488)

* docs(examples): use named params more (#490)

* release: 0.48.6

---------

Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
Co-authored-by: Stainless Bot <[email protected]>
  • Loading branch information
stainless-app[bot] and Stainless Bot authored Jul 11, 2024
1 parent d4413a8 commit 90c34d6
Show file tree
Hide file tree
Showing 62 changed files with 718 additions and 761 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}

USER vscode

RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.24.0" RYE_INSTALL_OPTION="--yes" bash
RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.35.0" RYE_INSTALL_OPTION="--yes" bash
ENV PATH=/home/vscode/.rye/shims:$PATH

RUN echo "[[ -d .venv ]] && source .venv/bin/activate" >> /home/vscode/.bashrc
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
pull_request:
branches:
- main
- next

jobs:
lint:
Expand All @@ -21,7 +22,7 @@ jobs:
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: 0.24.0
RYE_VERSION: '0.35.0'
RYE_INSTALL_OPTION: '--yes'

- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: 0.24.0
RYE_INSTALL_OPTION: "--yes"
RYE_VERSION: '0.35.0'
RYE_INSTALL_OPTION: '--yes'

- name: Publish to PyPI
run: |
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.48.5"
".": "0.48.6"
}
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## 0.48.6 (2024-07-11)

Full Changelog: [v0.48.5...v0.48.6](https://github.com/lithic-com/lithic-python/compare/v0.48.5...v0.48.6)

### Chores

* **ci:** also run workflows for PRs targeting `next` ([#487](https://github.com/lithic-com/lithic-python/issues/487)) ([dd74e55](https://github.com/lithic-com/lithic-python/commit/dd74e5533fac8962ff69837c177462721a4a8710))
* **ci:** update rye to v0.35.0 ([#482](https://github.com/lithic-com/lithic-python/issues/482)) ([30f2c5b](https://github.com/lithic-com/lithic-python/commit/30f2c5b716e74cae4178267b4959496c33fe5335))
* **internal:** add helper function ([#485](https://github.com/lithic-com/lithic-python/issues/485)) ([e688304](https://github.com/lithic-com/lithic-python/commit/e6883042caa64572f8fcb06fcc1ba6db823c652c))
* **internal:** minor import restructuring ([#488](https://github.com/lithic-com/lithic-python/issues/488)) ([10206cf](https://github.com/lithic-com/lithic-python/commit/10206cfb133a0631f011638eb8b746d08a8eb67f))
* **internal:** minor request options handling changes ([#484](https://github.com/lithic-com/lithic-python/issues/484)) ([1f8293c](https://github.com/lithic-com/lithic-python/commit/1f8293cc4e4a1bea29c21ccfe715edc7acdf53c7))
* **internal:** update mypy ([#486](https://github.com/lithic-com/lithic-python/issues/486)) ([f05d7a1](https://github.com/lithic-com/lithic-python/commit/f05d7a17bac4ea11826b7117283b218368b88592))


### Documentation

* **examples:** use named params more ([#490](https://github.com/lithic-com/lithic-python/issues/490)) ([f42beef](https://github.com/lithic-com/lithic-python/commit/f42beef8c98751bc2d64b02253eb4c9c14759422))

## 0.48.5 (2024-07-02)

Full Changelog: [v0.48.4...v0.48.5](https://github.com/lithic-com/lithic-python/compare/v0.48.4...v0.48.5)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "lithic"
version = "0.48.5"
version = "0.48.6"
description = "The official Python library for the lithic API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
3 changes: 2 additions & 1 deletion requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# features: []
# all-features: true
# with-sources: false
# generate-hashes: false

-e file:.
annotated-types==0.6.0
Expand Down Expand Up @@ -48,7 +49,7 @@ markdown-it-py==3.0.0
# via rich
mdurl==0.1.2
# via markdown-it-py
mypy==1.7.1
mypy==1.10.1
mypy-extensions==1.0.0
# via mypy
nodeenv==1.8.0
Expand Down
1 change: 1 addition & 0 deletions requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# features: []
# all-features: true
# with-sources: false
# generate-hashes: false

-e file:.
annotated-types==0.6.0
Expand Down
22 changes: 16 additions & 6 deletions src/lithic/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,11 @@ def _request(
stream: bool,
stream_cls: type[_StreamT] | None,
) -> ResponseT | _StreamT:
# create a copy of the options we were given so that if the
# options are mutated later & we then retry, the retries are
# given the original options
input_options = model_copy(options)

cast_to = self._maybe_override_cast_to(cast_to, options)
self._prepare_options(options)

Expand All @@ -980,7 +985,7 @@ def _request(

if retries > 0:
return self._retry_request(
options,
input_options,
cast_to,
retries,
stream=stream,
Expand All @@ -995,7 +1000,7 @@ def _request(

if retries > 0:
return self._retry_request(
options,
input_options,
cast_to,
retries,
stream=stream,
Expand Down Expand Up @@ -1023,7 +1028,7 @@ def _request(
if retries > 0 and self._should_retry(err.response):
err.response.close()
return self._retry_request(
options,
input_options,
cast_to,
retries,
err.response.headers,
Expand Down Expand Up @@ -1532,6 +1537,11 @@ async def _request(
# execute it earlier while we are in an async context
self._platform = await asyncify(get_platform)()

# create a copy of the options we were given so that if the
# options are mutated later & we then retry, the retries are
# given the original options
input_options = model_copy(options)

cast_to = self._maybe_override_cast_to(cast_to, options)
await self._prepare_options(options)

Expand All @@ -1554,7 +1564,7 @@ async def _request(

if retries > 0:
return await self._retry_request(
options,
input_options,
cast_to,
retries,
stream=stream,
Expand All @@ -1569,7 +1579,7 @@ async def _request(

if retries > 0:
return await self._retry_request(
options,
input_options,
cast_to,
retries,
stream=stream,
Expand All @@ -1592,7 +1602,7 @@ async def _request(
if retries > 0 and self._should_retry(err.response):
await err.response.aclose()
return await self._retry_request(
options,
input_options,
cast_to,
retries,
err.response.headers,
Expand Down
8 changes: 8 additions & 0 deletions src/lithic/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,14 @@ def validate_type(*, type_: type[_T], value: object) -> _T:
return cast(_T, _validate_non_model_type(type_=type_, value=value))


def set_pydantic_config(typ: Any, config: pydantic.ConfigDict) -> None:
"""Add a pydantic config for the given type.
Note: this is a no-op on Pydantic v1.
"""
setattr(typ, "__pydantic_config__", config) # noqa: B010


# our use of subclasssing here causes weirdness for type checkers,
# so we just pretend that we don't subclass
if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion src/lithic/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "lithic"
__version__ = "0.48.5" # x-release-please-version
__version__ = "0.48.6" # x-release-please-version
5 changes: 1 addition & 4 deletions src/lithic/resources/account_holders.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
from ..pagination import SyncSinglePage, AsyncSinglePage
from .._base_client import (
AsyncPaginator,
make_request_options,
)
from .._base_client import AsyncPaginator, make_request_options
from ..types.account_holder import AccountHolder
from ..types.account_holder_document import AccountHolderDocument
from ..types.account_holder_create_response import AccountHolderCreateResponse
Expand Down
5 changes: 1 addition & 4 deletions src/lithic/resources/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
from ..pagination import SyncCursorPage, AsyncCursorPage
from .._base_client import (
AsyncPaginator,
make_request_options,
)
from .._base_client import AsyncPaginator, make_request_options
from ..types.account import Account
from ..types.account_spend_limits import AccountSpendLimits

Expand Down
5 changes: 1 addition & 4 deletions src/lithic/resources/aggregate_balances.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
from ..pagination import SyncSinglePage, AsyncSinglePage
from .._base_client import (
AsyncPaginator,
make_request_options,
)
from .._base_client import AsyncPaginator, make_request_options
from ..types.aggregate_balance import AggregateBalance

__all__ = ["AggregateBalances", "AsyncAggregateBalances"]
Expand Down
5 changes: 1 addition & 4 deletions src/lithic/resources/auth_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
from ..pagination import SyncCursorPage, AsyncCursorPage
from .._base_client import (
AsyncPaginator,
make_request_options,
)
from .._base_client import AsyncPaginator, make_request_options
from ..types.auth_rule import AuthRule
from ..types.auth_rule_remove_response import AuthRuleRemoveResponse
from ..types.auth_rule_retrieve_response import AuthRuleRetrieveResponse
Expand Down
4 changes: 1 addition & 3 deletions src/lithic/resources/auth_stream_enrollment.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
from .._base_client import (
make_request_options,
)
from .._base_client import make_request_options
from ..types.auth_stream_secret import AuthStreamSecret

__all__ = ["AuthStreamEnrollment", "AsyncAuthStreamEnrollment"]
Expand Down
5 changes: 1 addition & 4 deletions src/lithic/resources/balances.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
from ..pagination import SyncSinglePage, AsyncSinglePage
from .._base_client import (
AsyncPaginator,
make_request_options,
)
from .._base_client import AsyncPaginator, make_request_options
from ..types.balance import Balance

__all__ = ["Balances", "AsyncBalances"]
Expand Down
5 changes: 1 addition & 4 deletions src/lithic/resources/book_transfers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
from ..pagination import SyncCursorPage, AsyncCursorPage
from .._base_client import (
AsyncPaginator,
make_request_options,
)
from .._base_client import AsyncPaginator, make_request_options
from ..types.book_transfer_response import BookTransferResponse

__all__ = ["BookTransfers", "AsyncBookTransfers"]
Expand Down
5 changes: 1 addition & 4 deletions src/lithic/resources/card_programs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
from ..pagination import SyncCursorPage, AsyncCursorPage
from .._base_client import (
AsyncPaginator,
make_request_options,
)
from .._base_client import AsyncPaginator, make_request_options
from ..types.card_program import CardProgram

__all__ = ["CardPrograms", "AsyncCardPrograms"]
Expand Down
5 changes: 1 addition & 4 deletions src/lithic/resources/cards/aggregate_balances.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
from ...pagination import SyncSinglePage, AsyncSinglePage
from ...types.cards import aggregate_balance_list_params
from ..._base_client import (
AsyncPaginator,
make_request_options,
)
from ..._base_client import AsyncPaginator, make_request_options
from ...types.cards.aggregate_balance_list_response import AggregateBalanceListResponse

__all__ = ["AggregateBalances", "AsyncAggregateBalances"]
Expand Down
5 changes: 1 addition & 4 deletions src/lithic/resources/cards/balances.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
from ...pagination import SyncSinglePage, AsyncSinglePage
from ...types.cards import balance_list_params
from ..._base_client import (
AsyncPaginator,
make_request_options,
)
from ..._base_client import AsyncPaginator, make_request_options
from ...types.cards.balance_list_response import BalanceListResponse

__all__ = ["Balances", "AsyncBalances"]
Expand Down
6 changes: 1 addition & 5 deletions src/lithic/resources/cards/cards.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@
from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
from ...pagination import SyncCursorPage, AsyncCursorPage
from ...types.card import Card
from ..._base_client import (
AsyncPaginator,
_merge_mappings,
make_request_options,
)
from ..._base_client import AsyncPaginator, _merge_mappings, make_request_options
from .aggregate_balances import (
AggregateBalances,
AsyncAggregateBalances,
Expand Down
5 changes: 1 addition & 4 deletions src/lithic/resources/cards/financial_transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
from ...pagination import SyncSinglePage, AsyncSinglePage
from ...types.cards import financial_transaction_list_params
from ..._base_client import (
AsyncPaginator,
make_request_options,
)
from ..._base_client import AsyncPaginator, make_request_options
from ...types.financial_transaction import FinancialTransaction

__all__ = ["FinancialTransactions", "AsyncFinancialTransactions"]
Expand Down
5 changes: 1 addition & 4 deletions src/lithic/resources/digital_card_art.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
from ..pagination import SyncCursorPage, AsyncCursorPage
from .._base_client import (
AsyncPaginator,
make_request_options,
)
from .._base_client import AsyncPaginator, make_request_options
from ..types.digital_card_art import DigitalCardArt

__all__ = ["DigitalCardArtResource", "AsyncDigitalCardArtResource"]
Expand Down
5 changes: 1 addition & 4 deletions src/lithic/resources/disputes.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
from ..pagination import SyncCursorPage, AsyncCursorPage
from .._base_client import (
AsyncPaginator,
make_request_options,
)
from .._base_client import AsyncPaginator, make_request_options
from ..types.dispute import Dispute
from ..types.dispute_evidence import DisputeEvidence

Expand Down
5 changes: 1 addition & 4 deletions src/lithic/resources/events/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@
SubscriptionsWithStreamingResponse,
AsyncSubscriptionsWithStreamingResponse,
)
from ..._base_client import (
AsyncPaginator,
make_request_options,
)
from ..._base_client import AsyncPaginator, make_request_options
from ...types.message_attempt import MessageAttempt

__all__ = ["Events", "AsyncEvents"]
Expand Down
5 changes: 1 addition & 4 deletions src/lithic/resources/events/subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
from ...pagination import SyncCursorPage, AsyncCursorPage
from ..._base_client import (
AsyncPaginator,
make_request_options,
)
from ..._base_client import AsyncPaginator, make_request_options
from ...types.events import (
subscription_list_params,
subscription_create_params,
Expand Down
Loading

0 comments on commit 90c34d6

Please sign in to comment.