Skip to content

Commit

Permalink
Fixes for various errors (#146)
Browse files Browse the repository at this point in the history
* Fix typo in consumer models

Closes #145

* Add urls to PyPi package

Closes #115

Fix for is_error

Closes #102

* Typo and a shorthand

* PubNub SDK 7.0.2 release.

Co-authored-by: Client Engineering Bot <60980775+client-engineering-bot@users.noreply.github.com>
  • Loading branch information
seba-aln and client-engineering-bot authored Nov 24, 2022
1 parent 342c981 commit 8ee850b
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 12 deletions.
17 changes: 13 additions & 4 deletions .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: python
version: 7.0.1
version: 7.0.2
schema: 1
scm: github.com/pubnub/python
sdks:
Expand All @@ -18,7 +18,7 @@ sdks:
distributions:
- distribution-type: library
distribution-repository: package
package-name: pubnub-7.0.1
package-name: pubnub-7.0.2
location: https://pypi.org/project/pubnub/
supported-platforms:
supported-operating-systems:
Expand Down Expand Up @@ -97,8 +97,8 @@ sdks:
-
distribution-type: library
distribution-repository: git release
package-name: pubnub-7.0.1
location: https://github.com/pubnub/python/releases/download/7.0.1/pubnub-7.0.1.tar.gz
package-name: pubnub-7.0.2
location: https://github.com/pubnub/python/releases/download/7.0.2/pubnub-7.0.2.tar.gz
supported-platforms:
supported-operating-systems:
Linux:
Expand Down Expand Up @@ -169,6 +169,15 @@ sdks:
license-url: https://github.com/aio-libs/aiohttp/blob/master/LICENSE.txt
is-required: Required
changelog:
- date: 2022-11-24
version: 7.0.2
changes:
- type: bug
text: "This change fixes typo in consumer models user and space resulting in setting invalid flags for the request."
- type: bug
text: "This change fixes error in calling and returning value of `status.is_error()` method."
- type: bug
text: "This change adds additional informations to PyPi package. Informations include URLs to source code and documentation, required python version (at least 3.7) and updates a list of supported python versions (removed 3.6 and added 3.10)."
- date: 2022-10-05
version: 7.0.1
changes:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 7.0.2
November 24 2022

#### Fixed
- This change fixes typo in consumer models user and space resulting in setting invalid flags for the request.
- This change fixes error in calling and returning value of `status.is_error()` method.
- This change adds additional informations to PyPi package. Informations include URLs to source code and documentation, required python version (at least 3.7) and updates a list of supported python versions (removed 3.6 and added 3.10). Fixed the following issues reported by [@Saluev](https://github.com/Saluev), [@natekspencer](https://github.com/natekspencer) and [@andriyor](https://github.com/andriyor): [#145](https://github.com/pubnub/python/issues/145), [#102](https://github.com/pubnub/python/issues/102) and [#115](https://github.com/pubnub/python/issues/115).

## 7.0.1
October 05 2022

Expand Down
2 changes: 1 addition & 1 deletion pubnub/models/consumer/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ def __init__(self):
self.affected_groups = None

def is_error(self):
return self.error is not None
return bool(self.error)
2 changes: 1 addition & 1 deletion pubnub/models/consumer/v3/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def get(self):
return self

def update(self):
self._get = True
self._update = True
return self

def join(self):
Expand Down
2 changes: 1 addition & 1 deletion pubnub/models/consumer/v3/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def get(self):
return self

def update(self):
self._get = True
self._update = True
return self

def join(self):
Expand Down
2 changes: 1 addition & 1 deletion pubnub/pubnub.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def _perform_heartbeat_loop(self):

def heartbeat_callback(raw_result, status):
heartbeat_verbosity = self._pubnub.config.heartbeat_notification_options
if status.is_error:
if status.is_error():
if heartbeat_verbosity in (PNHeartbeatNotificationOptions.ALL, PNHeartbeatNotificationOptions.FAILURES):
self._listener_manager.announce_status(status)
else:
Expand Down
2 changes: 1 addition & 1 deletion pubnub/pubnub_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ async def _perform_heartbeat_loop(self):
envelope = await heartbeat_call

heartbeat_verbosity = self._pubnub.config.heartbeat_notification_options
if envelope.status.is_error:
if envelope.status.is_error():
if heartbeat_verbosity in (PNHeartbeatNotificationOptions.ALL, PNHeartbeatNotificationOptions.FAILURES):
self._listener_manager.announce_status(envelope.status)
else:
Expand Down
2 changes: 1 addition & 1 deletion pubnub/pubnub_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

class PubNubCore:
"""A base class for PubNub Python API implementations"""
SDK_VERSION = "7.0.1"
SDK_VERSION = "7.0.2"
SDK_NAME = "PubNub-Python"

TIMESTAMP_DIVIDER = 1000
Expand Down
9 changes: 7 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,32 @@

setup(
name='pubnub',
version='7.0.1',
version='7.0.2',
description='PubNub Real-time push service in the cloud',
author='PubNub',
author_email='support@pubnub.com',
url='http://pubnub.com',
project_urls={
'Source': 'https://github.com/pubnub/python',
'Documentation': 'https://www.pubnub.com/docs/sdks/python',
},
packages=find_packages(exclude=("examples*", 'tests*')),
license='MIT',
classifiers=(
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Programming Language :: Python',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: Implementation :: CPython',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Software Development :: Libraries :: Python Modules',
),
python_requires='>=3.7',
install_requires=[
'pycryptodomex>=3.3',
'requests>=2.4',
Expand Down

0 comments on commit 8ee850b

Please sign in to comment.