karrio-easypost 2026.1__py3-none-any.whl → 2026.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -61,23 +61,11 @@ def rate_request(payload: models.RateRequest, _) -> lib.Serializable:
61
61
  initializer=provider_units.shipping_options_initializer,
62
62
  )
63
63
  is_intl = shipper.country_code != recipient.country_code
64
- customs = (
65
- models.Customs(
66
- commodities=(
67
- package.parcel.items
68
- if any(package.parcel.items)
69
- else [
70
- models.Commodity(
71
- sku="0000",
72
- quantity=1,
73
- weight=package.weight.value,
74
- weight_unit=package.weight_unit.value,
75
- )
76
- ]
77
- )
78
- )
79
- if is_intl
80
- else None
64
+ customs = lib.to_customs_info(
65
+ payload.customs,
66
+ shipper=payload.shipper,
67
+ recipient=payload.recipient,
68
+ weight_unit=package.weight_unit.value,
81
69
  )
82
70
 
83
71
  requests = easypost.ShipmentRequest(
@@ -163,9 +151,9 @@ def rate_request(payload: models.RateRequest, _) -> lib.Serializable:
163
151
  options={option.code: option.state for _, option in options.items()},
164
152
  customs_info=(
165
153
  easypost.CustomsInfo(
166
- contents_type="other",
167
- customs_certify=True,
168
- customs_signer=shipper.person_name,
154
+ contents_type=customs.content_type or "other",
155
+ customs_certify=customs.certify if customs.certify is not None else True,
156
+ customs_signer=customs.signer or shipper.person_name,
169
157
  customs_items=[
170
158
  easypost.CustomsItem(
171
159
  description=lib.text(
@@ -182,10 +170,14 @@ def rate_request(payload: models.RateRequest, _) -> lib.Serializable:
182
170
  printed_commodity_identifier=(item.sku or item.id),
183
171
  hs_tariff_number=item.hs_code,
184
172
  )
185
- for item in customs.commodities
173
+ for item in (
174
+ package.parcel.items
175
+ if any(package.parcel.items)
176
+ else customs.commodities or []
177
+ )
186
178
  ],
187
179
  )
188
- if customs
180
+ if payload.customs and is_intl
189
181
  else None
190
182
  ),
191
183
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: karrio_easypost
3
- Version: 2026.1
3
+ Version: 2026.1.1
4
4
  Summary: Karrio - EasyPost Shipping extension
5
5
  Author-email: karrio <hello@karrio.io>
6
6
  License-Expression: LGPL-3.0
@@ -5,7 +5,7 @@ karrio/mappers/easypost/settings.py,sha256=tVxN6QXlpYgjslfMRzc-6uvI1E-vp6H6f_NsD
5
5
  karrio/plugins/easypost/__init__.py,sha256=UwD6JC4LkF47ZodzuHvaq8l__713e_aCLTej3SkEhH4,484
6
6
  karrio/providers/easypost/__init__.py,sha256=v89eaMBV-Kn7Za7WzrXpSkKfFG2HSRB0SXByoI2hOec,333
7
7
  karrio/providers/easypost/error.py,sha256=GrONkEpEi8ujKNvd4I9Z9xGfqFrc4QE2wOkoMJOFEjk,953
8
- karrio/providers/easypost/rate.py,sha256=_uJ_9PgB5AM_oMDjAsY_wFd_DUz-zm_zu4qPkSyZHTY,7710
8
+ karrio/providers/easypost/rate.py,sha256=lT8b5WUT0PBGa66sq6G97LBqDZ559esaKJmaOiydnpY,7676
9
9
  karrio/providers/easypost/tracking.py,sha256=DvjNyjLDFHDZ9Iu9zJjZwxOBCb8rXz3uBtwu8dlAmxg,4913
10
10
  karrio/providers/easypost/units.py,sha256=4VrHtGONrsqDv7zwWu_GC37N_V8RjXV1gf3tAUR_yV0,54794
11
11
  karrio/providers/easypost/utils.py,sha256=rJ1uxvaOXcwCAbPmiklk0UoJwhbix0sjVc6jV1BWbtQ,774
@@ -18,9 +18,9 @@ karrio/schemas/easypost/shipment_purchase.py,sha256=xNQWUKV6aYFFdTn7xLCjjtya0h-o
18
18
  karrio/schemas/easypost/shipment_request.py,sha256=7HirvgDktcppvHlEeMz49ryK6sPWIBP-c1_1xE3y8ow,2858
19
19
  karrio/schemas/easypost/shipments_response.py,sha256=KgWbIoPvI1NoQOGoV30-K3Dl6JFkKdAS3B3yHQfb6R4,8957
20
20
  karrio/schemas/easypost/trackers_response.py,sha256=Q0Z74hKZYLDmfKh7lzxM7cfe3x-z-LXve94d7s3r9Kw,2915
21
- karrio_easypost-2026.1.dist-info/licenses/LICENSE,sha256=qvVLDB3Y1leH0p_1m30RxZrOGOx8F9O5eZIwdyVzcuQ,7651
22
- karrio_easypost-2026.1.dist-info/METADATA,sha256=kC4Ul6Oj0myt8ejS_68bP0tQHbqBENKX5XWfuaGTQGo,1038
23
- karrio_easypost-2026.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
24
- karrio_easypost-2026.1.dist-info/entry_points.txt,sha256=mArG7sxxZUl07ycYJn7BGzz1uv-hZPVROniK64EbUz4,61
25
- karrio_easypost-2026.1.dist-info/top_level.txt,sha256=FZCY8Nwft8oEGHdl--xku8P3TrnOxu5dETEU_fWpRSM,20
26
- karrio_easypost-2026.1.dist-info/RECORD,,
21
+ karrio_easypost-2026.1.1.dist-info/licenses/LICENSE,sha256=qvVLDB3Y1leH0p_1m30RxZrOGOx8F9O5eZIwdyVzcuQ,7651
22
+ karrio_easypost-2026.1.1.dist-info/METADATA,sha256=kEheX5Eq5TGqFNaL59ImNTekUYQviKWKL-93uRM_XkU,1040
23
+ karrio_easypost-2026.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
24
+ karrio_easypost-2026.1.1.dist-info/entry_points.txt,sha256=mArG7sxxZUl07ycYJn7BGzz1uv-hZPVROniK64EbUz4,61
25
+ karrio_easypost-2026.1.1.dist-info/top_level.txt,sha256=FZCY8Nwft8oEGHdl--xku8P3TrnOxu5dETEU_fWpRSM,20
26
+ karrio_easypost-2026.1.1.dist-info/RECORD,,