-
Notifications
You must be signed in to change notification settings - Fork 70
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
[BUG] TypeError at library import (Python 3.9.1) #49
Comments
Hi! Could you let me know which version of this library you use?
|
A pull request to change from collections to the typing library as suggested is welcome too, if that fixes the problem for you 😊 |
Thank you for the quick reply. Right, I forgot to mention that I'm using the latest version of the library, 3.2.0. I've tried to upgrade from Python 3.9.1 to 3.10.0, but that did not make any difference. Python 3.9.2 is not available for me due to company policies. Then I changed from collections to typing and now the code compiles and I can authenticate successfully. Thanks for the suggestion. |
Perfect! Would you like to submit a PR to fix it here as well? 😊 |
Bare in mind I'm a total noob here :) So not sure how to do that properly. |
Well, I'd say that's a even better reason to make an attempt! I'll write the steps here, if you want to try it out (and become a contributor), you'll have the opportunity now. These steps are the same for basically all open source projects. I'll be happy to answer any questions you might have! If you don't have time or don't want to, just let me know and I'll do it. 😊 ForkFirst off, you need to fork the project. You do this by clicking this button: You then go into your project, which should now exist under your own profile here. CloneClone this project, either using Copy this URL, and paste it in your terminal in the folder you'd like it to clone to: git clone <url> OR with ssh: (Cloning projects can also be done through clients or editors, but I can't help you with that) Install the project dependenciesNow, we have the project installed. If you have poetry, you can just type If you don't have poetry, you must install it first. There's the official way here, but if you're on a mac you can also just do a When you've written Pre-commitThis project uses pre-commit. It's not really documented anywhere, so I'll make sure to do that! How ever, all it requires is that you run Changing branch and edit the codeNow, all we have to do is create a new branch (from the branch you're on) and edit the code:
And then, edit our code in your editor. Now, we can write We then add this file to commit, by typing As you can see, the Making pre-commit hooks passWith my changes, the pre-commit hook actually changed my file, and my commit did not go through: Typing Since the file was fixed, all I need to do is to add the file and try to commit again: Success! Pushing and creating a pull requestNow we push these changes into our branch by typing Then, navigate back to this repository in the web browser and you'll see this button. Click it and create a pull request. When you create the pull request, tests will automatically run in the branch. 😊 |
Thanks for the detailed guide, I'd definitely would like to give it a try, but won't have time today. I'd get back to it tomorrow or the day after, as time allows. Hope that works. |
No rush at all! Let me know if you have any questions or bump into any issues. 😄 EDIT: I've now added a CONTRIBUTING.md file, which sums the comment up in a few steps. |
Ah, dang.
Hmm, what happens if you run
Sounds pretty rough to develop at your work environment, not gonna lie. 😁 |
Same, no output at all :/
Yeah, especially if one's not a developer, like myself :) Also, it's a fairly new tool, Both the tool and the processes around it are still tweaked, which also does not help much. |
Hmm, that’s weird. I’m not sure what’s wrong honestly. If you have poetry and then write |
Yeah, I honestly don’t know what’s wrong 🤔 If you’d like to fix the bug and then submit a PR, it’s not the end of the world with linting. I can fix that in your PR 😄 |
Unfortunately I could not figure out what's wrong with poetry, but I've created a new PR. |
Thank you! 😄 I'll fix whatever needs fixing and push a new version to PyPi ASAP. |
Describe the bug
I'm new to Python/FastAPI, so it is very well possible that it's just me doing something wrong, but my code fails to compile as soon as I add the line to import either SingleTenantAzureAuthorizationCodeBearer or MultiTenantAzureAuthorizationCodeBearer and I'm getting this error: TypeError: unhashable type: 'list'
First I thought it's related to my already written code, so I've started a clean project and followed the tutorial in the documentation, but that also fails as soon as I add the import line. So I'm completely lost here.
I'm using Python 3.9.1 and FastAPI 0.74.1
To Reproduce
Add code line:
from fastapi_azure_auth import SingleTenantAzureAuthorizationCodeBearer
Stack trace
Your configuration
Exactly the same as the tutorial here: https://intility.github.io/fastapi-azure-auth/single-tenant/fastapi_configuration
The text was updated successfully, but these errors were encountered: