diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e4547ee..0fb99af6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,28 +2,44 @@ ## [v1.2.0](https://github.com/ably/ably-python/tree/v1.2.0) -**Breaking API Changes**: Please see our [Upgrade / Migration Guide](UPDATING.md) for notes on changes you need to make to your code to update it to use the new API introduced by version 1.2.x. +**Breaking API Changes**: Please see our [Upgrade / Migration Guide](UPDATING.md) for notes on changes you need to make to your code to update it to use the new API introduced by version 1.2.0. [Full Changelog](https://github.com/ably/ably-python/compare/v1.1.1...v1.2.0) **Implemented enhancements:** +- Respect content-type with charset [\#256](https://github.com/ably/ably-python/issues/256) +- Release a new version for python 3.10 support [\#249](https://github.com/ably/ably-python/issues/249) - Support HTTP/2 [\#197](https://github.com/ably/ably-python/issues/197) - Support Async HTTP [\#171](https://github.com/ably/ably-python/issues/171) - Implement RSC7d \(Ably-Agent header\) [\#168](https://github.com/ably/ably-python/issues/168) - Defaults: Generate environment fallbacks [\#155](https://github.com/ably/ably-python/issues/155) +- Clarify string encoding when sending push notifications [\#119](https://github.com/ably/ably-python/issues/119) - Support for environments fallbacks [\#198](https://github.com/ably/ably-python/pull/198) ([d8x](https://github.com/d8x)) -- Add support for TO3m [\#172](https://github.com/ably/ably-python/issues/172) **Fixed bugs:** -- Token issue potential bug [\#54](https://github.com/ably/ably-python/issues/54) - Channel.publish sometimes returns None after exhausting retries [\#160](https://github.com/ably/ably-python/issues/160) +- Token issue potential bug [\#54](https://github.com/ably/ably-python/issues/54) + +**Closed issues:** + +- Conform ReadMe and create Contributing Document [\#199](https://github.com/ably/ably-python/issues/199) +- Add support for DataTypes TokenParams AO2g [\#187](https://github.com/ably/ably-python/issues/187) +- Add support for TO3m [\#172](https://github.com/ably/ably-python/issues/172 - Using a clientId should no longer be forcing token auth in the 1.1 spec [\#149](https://github.com/ably/ably-python/issues/149) **Merged pull requests:** -- \[\#187\] Query time parameter for getting current time from Ably system [\#206](https://github.com/ably/ably-python/pull/206) ([d8x](https://github.com/d8x)) +- Add support for Python 3.10, age out 3.6 [\#253](https://github.com/ably/ably-python/pull/253) ([tomkirbygreen](https://github.com/tomkirbygreen)) +- Compat with 'httpx' public API changes. [\#252](https://github.com/ably/ably-python/pull/252) ([tomkirbygreen](https://github.com/tomkirbygreen)) +- Respect content-type with charset [\#248](https://github.com/ably/ably-python/pull/248) ([tomkirbygreen](https://github.com/tomkirbygreen)) +- 'TypedBuffer' fix attempt to call a non-callable object [\#226](https://github.com/ably/ably-python/pull/226) ([tomkirbygreen](https://github.com/tomkirbygreen)) +- 'auth' module, fix possible unbound local variables warning [\#225](https://github.com/ably/ably-python/pull/225) ([tomkirbygreen](https://github.com/tomkirbygreen)) +- rest setup - fix redeclared name without usage [\#217](https://github.com/ably/ably-python/pull/217) ([tomkirbygreen](https://github.com/tomkirbygreen)) +- Fixes mutable-value used as argument default value [\#215](https://github.com/ably/ably-python/pull/215) ([tomkirbygreen](https://github.com/tomkirbygreen)) +- Fixes most of the PEP 8 coding style violations [\#214](https://github.com/ably/ably-python/pull/214) ([tomkirbygreen](https://github.com/tomkirbygreen)) +- 'Channel' remove unused 'history' parameter 'timeout'. [\#209](https://github.com/ably/ably-python/pull/209) ([tomkirbygreen](https://github.com/tomkirbygreen)) - \[\#149\] Specifying clientId does not force token auth [\#204](https://github.com/ably/ably-python/pull/204) ([d8x](https://github.com/d8x)) - Support for async [\#202](https://github.com/ably/ably-python/pull/202) ([d8x](https://github.com/d8x)) - Support for HTTP/2 Protocol [\#200](https://github.com/ably/ably-python/pull/200) ([d8x](https://github.com/d8x)) @@ -31,8 +47,6 @@ - RSC7d - Support for Ably-Agent header [\#195](https://github.com/ably/ably-python/pull/195) ([d8x](https://github.com/d8x)) - fix error message for invalid push data type [\#169](https://github.com/ably/ably-python/pull/169) ([netspencer](https://github.com/netspencer)) - Raise error if all servers reply with a 5xx response [\#161](https://github.com/ably/ably-python/pull/161) ([jdavid](https://github.com/jdavid)) -- Python 2.7 cleanup [\#157](https://github.com/ably/ably-python/pull/157) ([jdavid](https://github.com/jdavid)) -- Support Python 3.5+ [\#156](https://github.com/ably/ably-python/pull/156) ([jdavid](https://github.com/jdavid)) ## [v1.1.1](https://github.com/ably/ably-python/tree/v1.1.1) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2bb6e2bf..5f896533 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -30,12 +30,10 @@ The release process must include the following steps: 3. Add a commit to bump the version number, updating [`setup.py`](./setup.py) and [`ably/__init__.py`](./ably/__init__.py) 4. Add a commit to update the change log 5. Push the release branch to GitHub -6. Open a PR for the release against the release branch you just pushed -7. Gain approval(s) for the release PR from maintainer(s) -8. Land the release PR to `main` -9. From the `main` branch, run `python setup.py sdist upload -r ably` to build and upload this new package to PyPi -10. Create a tag named like `v1.2.3` and push it to GitHub - e.g. `git tag v1.2.3 && git push origin v1.2.3` -11. Create the release on GitHub including populating the release notes +6. Create a release PR (ensure you include an SDK Team Engineering Lead and the SDK Team Product Manager as reviewers) and gain approvals for it, then merge that to `main` +7. From the `main` branch, run `python setup.py sdist upload -r ably` to build and upload this new package to PyPi +8. Create a tag named like `v1.2.3` and push it to GitHub - e.g. `git tag v1.2.3 && git push origin v1.2.3` +9. Create the release on GitHub including populating the release notes We tend to use [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator) to collate the information required for a change log update. Your mileage may vary, but it seems the most reliable method to invoke the generator is something like: diff --git a/README.md b/README.md index 064f8178..89210e51 100644 --- a/README.md +++ b/README.md @@ -43,10 +43,10 @@ Or, if you need encryption features: cd ably-python python setup.py install -## Breaking API Changes in Version 1.2.x +## Breaking API Changes in Version 1.2.0 -Please see our Upgrade / Migration Guide for notes on changes you need to make to your code to update it to use the new API -introduced by version 1.2.x +Please see our [Upgrade / Migration Guide](UPDATING.md) for notes on changes you need to make to your code to update it to use the new API +introduced by version 1.2.0. ## Usage diff --git a/UPDATING.md b/UPDATING.md index 2f972e6d..7e056ba4 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -4,29 +4,28 @@ We have made **breaking changes** in the version 1.2 release of this SDK. -In this guide we aim to highlight the main differences you will encounter when migrating your code from the interfaces we were offering -prior to the version 1.2.0 release. +In this guide we aim to highlight the main differences you will encounter when migrating your code from the interfaces we were offering prior to the version 1.2.0 release. These include: - - Deprecating Python 3.4 - - Introduction of Asynchronous way of using the SDK -### Using the SDK API in synchronous way + - Deprecation of support for Python versions 3.4, 3.5 and 3.6 + - New, asynchronous API -This way using it is still possible. In order to use SDK in synchronous way please use the <= 1.1.0 version of this SDK. +### Deprecation of Python 3.4, 3.5 and 3.6 -### Deprecating Python 3.4 +The minimum version of Python has increased to 3.7. +You may need to upgrade your environment in order to use this newer version of this SDK. +To see which versions of Python we test the SDK against, please look at our +[GitHub workflows](.github/workflows). -This python version is already not supported, hence we decided to drop support of this version. Please upgrade your environment in order -to use the 1.2.x version. +### Asynchronous API +The 1.2.0 version introduces a breaking change, which changes the way of interacting with the SDK from synchronous to asynchronous, using [the `asyncio` foundational library](https://docs.python.org/3.7/library/asyncio.html) to provide support for `async`/`await` syntax. +Because of this breaking change, every call that interacts with the Ably REST API must be refactored to this asynchronous way. -### Introduction of Asynchronous way of using the SDK +#### Publishing Messages -The 1.2.x version introduces breaking change, which aims to change way of interacting with the SDK from Synchronous way to Asynchronous. Because of that -every call that is interacting with the Ably Rest API must be done in asynchronous way. - -#### Synchronous way of using the sdk with publishing sample message +This old style, synchronous example: ```python from ably import AblyRest @@ -36,12 +35,11 @@ def main(): channel = ably.channels.get("channel_name") channel.publish('event', 'message') - if __name__ == "__main__": main() ``` -#### Asynchronous way +Must now be replaced with this new style, asynchronous form: ```python import asyncio @@ -52,12 +50,13 @@ async def main(): channel = ably.channels.get("channel_name") await channel.publish('event', 'message') - if __name__ == "__main__": asyncio.run(main()) ``` -#### Synchronous way of querying the history +#### Querying History + +This old style, synchronous example: ```python message_page = channel.history() # Returns a PaginatedResult @@ -66,7 +65,7 @@ message_page.has_next() # => True, indicates there is another page message_page.next().items # List with messages from the second page ``` -#### Asynchronous way +Must now be replaced with this new style, asynchronous form: ```python message_page = await channel.history() # Returns a PaginatedResult @@ -76,7 +75,9 @@ next_page = await message_page.next() # Returns a next page next_page.items # List with messages from the second page ``` -#### Synchronous way of querying presence members on a channel +#### Querying Presence Members on a Channel + +This old style, synchronous example: ```python members_page = channel.presence.get() # Returns a PaginatedResult @@ -84,7 +85,7 @@ members_page.items members_page.items[0].client_id # client_id of first member present ``` -#### Asynchronous way +Must now be replaced with this new style, asynchronous form: ```python members_page = await channel.presence.get() # Returns a PaginatedResult @@ -92,7 +93,9 @@ members_page.items members_page.items[0].client_id # client_id of first member present ``` -#### Synchronous way of querying the presence of history +#### Querying Channel Presence History + +This old style, synchronous example: ```python presence_page = channel.presence.history() # Returns a PaginatedResult @@ -100,7 +103,7 @@ presence_page.items presence_page.items[0].client_id # client_id of first member ``` -#### Asynchronous way +Must now be replaced with this new style, asynchronous form: ```python presence_page = await channel.presence.history() # Returns a PaginatedResult @@ -108,7 +111,9 @@ presence_page.items presence_page.items[0].client_id # client_id of first member ``` -#### Synchronous way of generating a token +#### Generating a Token + +This old style, synchronous example: ```python token_details = client.auth.request_token() @@ -116,7 +121,7 @@ token_details.token # => "xVLyHw.CLchevH3hF....MDh9ZC_Q" new_client = AblyRest(token=token_details) ``` -#### Asynchronous way +Must now be replaced with this new style, asynchronous form: ```python token_details = await client.auth.request_token() @@ -125,7 +130,9 @@ new_client = AblyRest(token=token_details) await new_client.close() ``` -#### Synchronous way of generating a TokenRequest +#### Generating a TokenRequest + +This old style, synchronous example: ```python token_request = client.auth.create_token_request( @@ -139,7 +146,7 @@ token_request = client.auth.create_token_request( new_client = AblyRest(token=token_request) ``` -#### Asynchronous way +Must now be replaced with this new style, asynchronous form: ```python token_request = await client.auth.create_token_request( @@ -154,14 +161,16 @@ new_client = AblyRest(token=token_request) await new_client.close() ``` -#### Synchronous way of fetching your application's stats +#### Fetching Application Statistics + +This old style, synchronous example: ```python stats = client.stats() # Returns a PaginatedResult stats.items ``` -#### Asynchronous way +Must now be replaced with this new style, asynchronous form: ```python stats = await client.stats() # Returns a PaginatedResult @@ -169,15 +178,17 @@ stats.items await client.close() ``` -#### Synchronous way of fetching the Ably service time +#### Fetching the Ably Service Time + +This old style, synchronous example: ```python client.time() ``` -#### Asynchronous way +Must now be replaced with this new style, asynchronous form: ```python await client.time() await client.close() -``` \ No newline at end of file +```