Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for azure-storage-blob>=12.0.0 #784

Closed
larserikgk opened this issue Nov 1, 2019 · 12 comments · Fixed by #805
Closed

Add support for azure-storage-blob>=12.0.0 #784

larserikgk opened this issue Nov 1, 2019 · 12 comments · Fixed by #805

Comments

@larserikgk
Copy link
Contributor

Yesterday version 12.0.0 of azure-storage-blob was released.

First of all I would like to request pinning versions of required libraries so new releases of these do not instantly break django-storages if they have any breaking changes. In my opinion it is much better to pin the requirements and update manually when needed/requested.

My nightly build using django-storages for Azure failed, and the first issue I found was the renaming of BlobPermissions to BlobSasPermissions. This must be updated in azure_storage.py

I have not looked through the rest of the changes yet, but there might be more issues hidden in the release notes. I will try to find the issues and submit a PR.

An immediate quick fix would be to pin azure-storage-blob to version 2.1.0. The [azure] module uses 1.3.1, so that is an option as well.

Release notes for azure-storage-blob 12.0.0:

@Bastien-Brd
Copy link

+1 👍

@larserikgk
Copy link
Contributor Author

larserikgk commented Nov 4, 2019

There are more changes than just renaming, so I suggest a requirement pin until someone has time to update the code according to 12.0.0 of azure-storage-blob. Please see #785

@jschneier
Copy link
Owner

Yeah, many changes. For now I will just pin to >1.3.1<2.1. I'm not a fan of pinning altogether.

@jschneier
Copy link
Owner

jschneier commented Nov 18, 2019

Sorry, let me clarify. Since most things (this library excepted) now use semantic versioning I think that pinning to version ranges is acceptable, pinning to specific versions is not though.

I'm a bit surprised at how much churn there is in the relevant libraries for django-storages.

@jschneier jschneier changed the title Release 12.0.0 of azure-storage-blob breaks azure storage Add support for azure-storage-blob>=12.0.0 Nov 18, 2019
@matthewgdv
Copy link

Any progress on this? I'm currently using a wrapper library for azure-storage-blob at work that's written for the new version (>=12.0.0), and unfortunately installing django-storages downgrades azure-storage-blob, killing the wrapper. I realize this dependency collision can be dealt with using venvs, but I don't have full control of the environment, so it's not really an option in this case.

@ghost
Copy link

ghost commented Mar 27, 2020

Any hope to have azure-storage-blob>=12.0.0? Lot of features missing in the old 2.1.0 (such as the new ContainerClient class to work with containers).

@lmmentel
Copy link

lmmentel commented Jul 8, 2021

It seems that #805 is ready to be merged, any chance of giving this some priority?

@lmmentel
Copy link

@jschneier would you be able to provide some information on what are the chances to get this finished? I would very much like to use django-storages and even put dev time to keep it up but if for some reason this is not moving forward I'll need to find an alternative which I'm not too excited about. Again I appreciate all the great work so far and hope you can provide a comment about what's needed to close this. Thanks!

@lodeagcf
Copy link

lodeagcf commented Aug 29, 2021

@lmmentel It's not ideal, but you can use the branch in #805 PR from @pjsier with latest Azure Storage Blob package, by adding following to your requirements.txt:

azure-storage-blob==12.8.1
git+https://github.com/pjsier/django-storages.git@update-azure-storage#egg=django-storages[azure]

Just make sure to unset AZURE_CONNECTION_STRING in your configs, because the format is completely different between what is implemented in #805, where it's a URL to a container, and what is implemented in vanilla django-storages -- where it's an input to BlockBlobService in a legacy format (described here).

Once I unset AZURE_CONNECTION_STRING, the changes made in #805 were good to go.

@jschneier
Copy link
Owner

jschneier commented Aug 30, 2021 via email

@lmmentel
Copy link

Thanks @lodeagcf, this is more or less what I'm doing although this is less that ideal for many reasons, I would like to pin package versions instead of relying on a branch form a fork ... The added complexity of installing packages from git instead of pypi also raises concerns.

@jschneier thanks for the response and the news about the release are great but could you say something about this specific issue and if it'll make it? As I said I'm willing to help out getting this fixed, just let me know what you think needs to get done.

@Ikszad
Copy link

Ikszad commented Sep 17, 2021

@lodeagcf Hello, I am having trouble with your solution.
I am using poetry to install the dependencies you suggested.

django-storages = {git = "https://github.com/pjsier/django-storages.git", rev = "update-azure-storage"}
azure-storage-blob = "12.8.1"

And getting import error on BlobPermission

ImportError: cannot import name 'BlobPermissions' from 'azure.storage.blob' (/home/duser/.cache/pypoetry/virtualenvs/project_env/lib/python3.9/site-packages/azure/storage/blob/__init__.py)
Any suggestions?

EDIT:
Turned out to be some issues with poetry...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants