Closed echoes341 closed 4 years ago
We had the same issue after upgrading to the latest version and it's because there are several breaking changes in the new version... Change the import to:
from bunq.sdk.context.bunq_context import ApiContext
In case it might help, other breaking changes that I have encountered are:
from bunq.sdk.client import Pagination
should now be from bunq import Pagination
from bunq.sdk.context import BunqContext
should now be from bunq.sdk.context.bunq_context import BunqContext
from bunq.sdk.context import ApiContext
should now be from bunq.sdk.context.bunq_context import ApiContext
from bunq.sdk.context import ApiEnvironmentType
should now be from bunq.sdk.context.api_environment_type import ApiEnvironmentType
And whereas before you could initialize the ApiContext with something as
api_context = ApiContext(ENVIRONMENT_TYPE, API_KEY, DEVICE_DESCRIPTION)
It should now be:api_context = ApiContext.create(ENVIRONMENT_TYPE, API_KEY, DEVICE_DESCRIPTION)
Good luck!
Thank you @MarcellaJP !
The changelog is restored in https://github.com/bunq/sdk_python/commit/9d7dbc97304e12b73e8e06776f560dc45e61f4ac, indicating that major refactoring was merged in https://github.com/bunq/sdk_python/pull/117.
@angelomelonas It would be neat if a word of caution would be added to the README and in the description of the 1.13.1 release itself that updating from 1.10.16 to 1.13.1 requires users of this package to implement the fixes as indicated by @MarcellaJP.
Hi everyone. I apologise for the very late response to this issue.
In order to improve the readability and maintainability of the Python SDK, we performed this refactor. Instead of having functions in very large files, we extracted them into separate files (to match the directory and file structure of the other SDKs). In the process, we also added type hints and other general improvements.
Unfortunately, this leads to the breaking changes @echoes341 and @MarcellaJP mention above. We definitely should have mentioned them in the CHANGELOG.
We have created a new issue which mentions the breaking changes. We will create a new PR that mentions the breaking changes (and the issue) in the CHANGELOG.
Awesome, thanks @angelomelonas 🔥 🤩
I cannot import
ApiContext
. I'm not expert on Python, so there's no much I can do to help unfortunately.Steps to reproduce:
This is easy to reproduce with docker
$ docker run --rm -it python bash
On the interactive shell:
What should happen:
What happens:
SDK version and environment
Response id
Extra info: