Skip to content

Commit 5241c72

Browse files
Add optional parameters to PNConfiguration.__init__ (#228)
* PubNub SDK 10.6.0 release. --------- Co-authored-by: PubNub Release Bot <120067856+pubnub-release-bot@users.noreply.github.com>
1 parent 07ddfab commit 5241c72

5 files changed

Lines changed: 26 additions & 12 deletions

File tree

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
* @seba-aln @jguz-pubnub @wkal-pubnub
2-
README.md @techwritermat @kazydek @seba-aln @jguz-pubnub
1+
* @parfeon @jguz-pubnub
2+
README.md @techwritermat @kazydek @parfeon @jguz-pubnub

.pubnub.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: python
2-
version: 10.5.0
2+
version: 10.6.0
33
schema: 1
44
scm: github.com/pubnub/python
55
sdks:
@@ -18,7 +18,7 @@ sdks:
1818
distributions:
1919
- distribution-type: library
2020
distribution-repository: package
21-
package-name: pubnub-10.5.0
21+
package-name: pubnub-10.6.0
2222
location: https://pypi.org/project/pubnub/
2323
supported-platforms:
2424
supported-operating-systems:
@@ -94,8 +94,8 @@ sdks:
9494
-
9595
distribution-type: library
9696
distribution-repository: git release
97-
package-name: pubnub-10.5.0
98-
location: https://github.com/pubnub/python/releases/download/10.5.0/pubnub-10.5.0.tar.gz
97+
package-name: pubnub-10.6.0
98+
location: https://github.com/pubnub/python/releases/download/10.6.0/pubnub-10.6.0.tar.gz
9999
supported-platforms:
100100
supported-operating-systems:
101101
Linux:
@@ -169,6 +169,11 @@ sdks:
169169
license-url: https://github.com/encode/httpx/blob/master/LICENSE.md
170170
is-required: Required
171171
changelog:
172+
- date: 2026-01-29
173+
version: 10.6.0
174+
changes:
175+
- type: feature
176+
text: "Add optional parameters to PNConfiguration.__init__, allowing developers to set subscribe_key, publish_key, and uuid during initialization."
172177
- date: 2025-12-02
173178
version: 10.5.0
174179
changes:

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 10.6.0
2+
January 29 2026
3+
4+
#### Added
5+
- Add optional parameters to PNConfiguration.__init__, allowing developers to set subscribe_key, publish_key, and uuid during initialization. Fixed the following issues reported by [@JanluOfficial](https://github.com/JanluOfficial): [#227](https://github.com/pubnub/python/issues/227).
6+
17
## 10.5.0
28
December 02 2025
39

pubnub/pnconfiguration.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import warnings
2-
from typing import Any
2+
from typing import Any, Optional
33
from copy import deepcopy
44
from Cryptodome.Cipher import AES
55
from pubnub.enums import PNHeartbeatNotificationOptions, PNReconnectionPolicy
@@ -14,16 +14,19 @@ class PNConfiguration(object):
1414
DEFAULT_CRYPTO_MODULE = LegacyCryptoModule
1515
_locked = False
1616

17-
def __init__(self):
17+
def __init__(self,
18+
subscribe_key: Optional[str] = None,
19+
publish_key: Optional[str] = None,
20+
uuid: Optional[str] = None):
1821
# TODO: add validation
19-
self._uuid = None
22+
self._uuid = uuid
2023
self.origin = "ps.pndsn.com"
2124
self.ssl = True
2225
self.non_subscribe_request_timeout = 10
2326
self.subscribe_request_timeout = 310
2427
self.connect_timeout = 10
25-
self.subscribe_key = None
26-
self.publish_key = None
28+
self.subscribe_key = subscribe_key
29+
self.publish_key = publish_key
2730
self.secret_key = None
2831
self.cipher_key = None
2932
self._cipher_mode = AES.MODE_CBC

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='pubnub',
5-
version='10.5.0',
5+
version='10.6.0',
66
description='PubNub Real-time push service in the cloud',
77
author='PubNub',
88
author_email='support@pubnub.com',

0 commit comments

Comments
 (0)