Skip to content

Commit f59f073

Browse files
authored
Merge pull request #164 from david-lev/dev
[ci] update CI configuration for pytest and upgrade action versions
2 parents 35f30e2 + a910417 commit f59f073

File tree

4 files changed

+54
-13
lines changed

4 files changed

+54
-13
lines changed

.github/workflows/tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Tests with pytest
1+
name: CI
22

33
on:
44
push:
@@ -11,7 +11,7 @@ permissions:
1111

1212
jobs:
1313
tests:
14-
name: Tests with pytest
14+
name: pytest
1515
runs-on: ${{ matrix.os }}
1616
strategy:
1717
fail-fast: false
@@ -20,9 +20,9 @@ jobs:
2020
python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14' ]
2121

2222
steps:
23-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@v6
2424
- name: Set up Python ${{ matrix.python-version }}
25-
uses: actions/setup-python@v5
25+
uses: actions/setup-python@v6
2626
with:
2727
python-version: ${{ matrix.python-version }}
2828
cache: pip

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,16 @@
44
> NOTE: pywa follows the [semver](https://semver.org/) versioning standard.
55
66

7-
#### 3.6.1 (2025-12-11) **Latest**
7+
#### 3.7.0 (2026-01-11) **Latest**
8+
9+
- [media] allow to override the default 1-hour TTL for `No Storage-enabled` business phone numbers
10+
- [types] add `QRCodeImageType` and enhance `QRCode` methods for image handling
11+
- [templates] adding `product_extensions` and `text_formatting_optimization` to `CreativeFeaturesSpec`
12+
- [api] add method to exchange Embedded Signup token for business access token
13+
- [ci] update GitHub Actions workflows for improved publishing and testing
14+
- [core] support Python 3.14
15+
16+
#### 3.6.1 (2025-12-11)
817

918
- [helpers] fix media URL in template param
1019
- [tests] test resolve_media_param

pywa/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
from pywa.client import WhatsApp
1010
from pywa.utils import Version
1111

12-
__version__ = "3.6.1"
12+
__version__ = "3.7.0"
1313
__author__ = "David Lev"
1414
__license__ = "MIT"

pywa/types/calls.py

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,23 @@ class STRPKeyExchangeProtocol(utils.StrEnum):
887887
UNKNOWN = "UNKNOWN"
888888

889889

890+
@dataclasses.dataclass(slots=True, kw_only=True, frozen=True)
891+
class CallIcons:
892+
"""
893+
Configure whether WhatsApp call button icon displays for users when chatting with the business.
894+
895+
Attributes:
896+
restrict_to_user_countries: Restrict the visibility of call icons to these countries. For example if you restrict it to “US,” then it will apply to all the people who have a US registered phone number. These people could be physically located inside or outside of the USA.
897+
"""
898+
899+
restrict_to_user_countries: list[str]
900+
901+
def to_dict(self) -> dict:
902+
return {
903+
"restrict_to_user_countries": self.restrict_to_user_countries,
904+
}
905+
906+
890907
@dataclasses.dataclass(slots=True, kw_only=True)
891908
class CallingSettings:
892909
"""
@@ -897,13 +914,15 @@ class CallingSettings:
897914
Attributes:
898915
status: Enable or disable the Calling API for the given business phone number.
899916
call_icon_visibility: Configure whether the WhatsApp call button icon displays for users when chatting with the business. See `Call Icon Visibility <https://developers.facebook.com/docs/whatsapp/cloud-api/calling/call-settings#parameter-details>`_ for more details.
917+
call_icons: Configure the visibility of call icons based on user countries.
900918
call_hours: Allows you to specify and trigger call settings for incoming calls based on your timezone, business operating hours, and holiday schedules.
901919
callback_permission_status: Configure whether a WhatsApp user is prompted with a call permission request after calling your business.
902920
sip: Configure call signaling via signal initiation protocol (SIP). Note: When SIP is enabled, you cannot use calling related endpoints and will not receive calling related webhooks.
903921
"""
904922

905923
status: CallingSettingsStatus | None = None
906924
call_icon_visibility: CallIconVisibility | None = None
925+
call_icons: CallIcons | None = None
907926
call_hours: CallHours | None = None
908927
callback_permission_status: CallbackPermissionStatus | None = None
909928
srtp_key_exchange_protocol: STRPKeyExchangeProtocol | None = None
@@ -915,6 +934,8 @@ def to_dict(self):
915934
data["status"] = self.status.value
916935
if self.call_icon_visibility:
917936
data["call_icon_visibility"] = self.call_icon_visibility.value
937+
if self.call_icons:
938+
data["call_icons"] = self.call_icons.to_dict()
918939
if self.callback_permission_status:
919940
data["callback_permission_status"] = self.callback_permission_status.value
920941
if self.call_hours:
@@ -932,6 +953,13 @@ def from_dict(cls, data: dict) -> CallingSettings:
932953
call_icon_visibility=CallIconVisibility(data["call_icon_visibility"])
933954
if "call_icon_visibility" in data
934955
else None,
956+
call_icons=CallIcons(
957+
restrict_to_user_countries=data["call_icons"][
958+
"restrict_to_user_countries"
959+
]
960+
)
961+
if "call_icons" in data
962+
else None,
935963
call_hours=CallHours.from_dict(data["call_hours"])
936964
if "call_hours" in data
937965
else None,
@@ -985,13 +1013,17 @@ def from_dict(cls, data: dict) -> BusinessPhoneNumberSettings:
9851013

9861014
def to_dict(self) -> dict:
9871015
return {
988-
"calling": self.calling.to_dict() if self.calling else None,
989-
"storage_configuration": dataclasses.asdict(self.storage_configuration)
990-
if self.storage_configuration
991-
else None,
992-
"user_identity_change": self.user_identity_change.to_dict()
993-
if self.user_identity_change
994-
else None,
1016+
k: v
1017+
for k, v in {
1018+
"calling": self.calling.to_dict() if self.calling else None,
1019+
"storage_configuration": dataclasses.asdict(self.storage_configuration)
1020+
if self.storage_configuration
1021+
else None,
1022+
"user_identity_change": self.user_identity_change.to_dict()
1023+
if self.user_identity_change
1024+
else None,
1025+
}.items()
1026+
if v is not None
9951027
}
9961028

9971029

0 commit comments

Comments
 (0)