Code Monkey home page Code Monkey logo

Comments (17)

JonasKs avatar JonasKs commented on June 19, 2024 1

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. 😊

Fork

First off, you need to fork the project. You do this by clicking this button:

image

You then go into your project, which should now exist under your own profile here.

Clone

Clone this project, either using https or ssh. If you haven't set up SSH keys, you chose https.

image

Copy this URL, and paste it in your terminal in the folder you'd like it to clone to:

git clone <url>

Example:
image

OR with ssh:

image

(Cloning projects can also be done through clients or editors, but I can't help you with that)

Install the project dependencies

Now, we have the project installed. If you have poetry, you can just type poetry install and it'll install the entire environment:

image

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 brew install poetry. pip install poetry should also work in most cases.

When you've written poetry install you can write poetry shell to activate the environment:

image

Pre-commit

This 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 pre-commit install. This will install the pre-commit hooks:
image

Changing branch and edit the code

Now, all we have to do is create a new branch (from the branch you're on) and edit the code:

git checkout -b fix/typing-error

image

And then, edit our code in your editor.

Now, we can write git status to see what files we've made changes to:

image

We then add this file to commit, by typing git add <filename>, or git add . to add them all. When you've added the file, you can create a commit. git commit -m "<commit message>" is the simplest way:

image

As you can see, the pre-commit hooks are now installing.

Making pre-commit hooks pass

With my changes, the pre-commit hook actually changed my file, and my commit did not go through:
image

Typing git status I can see that the file is changed from last time I add it:

image

Since the file was fixed, all I need to do is to add the file and try to commit again:

image

Success!

Pushing and creating a pull request

Now we push these changes into our branch by typing git push origin <branch name>:

image

Then, navigate back to this repository in the web browser and you'll see this button. Click it and create a pull request.

image

When you create the pull request, tests will automatically run in the branch. 😊

from fastapi-azure-auth.

JonasKs avatar JonasKs commented on June 19, 2024

Hi!
That’s weird. I’ll try to reproduce today or tomorrow.

Could you let me know which version of this library you use?

iss_callable: Optional[Callable[[str], Awaitable[str]]] = None Seems to be the issue. Reading this SO thread, an upgrade of Python 3.9 could be sufficient.

from fastapi-azure-auth.

JonasKs avatar JonasKs commented on June 19, 2024

A pull request to change from collections to the typing library as suggested is welcome too, if that fixes the problem for you 😊

from fastapi-azure-auth.

ravaszf avatar ravaszf commented on June 19, 2024

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.

from fastapi-azure-auth.

JonasKs avatar JonasKs commented on June 19, 2024

Perfect! Would you like to submit a PR to fix it here as well? 😊

from fastapi-azure-auth.

ravaszf avatar ravaszf commented on June 19, 2024

Bare in mind I'm a total noob here :) So not sure how to do that properly.

from fastapi-azure-auth.

ravaszf avatar ravaszf commented on June 19, 2024

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.

from fastapi-azure-auth.

JonasKs avatar JonasKs commented on June 19, 2024

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.

from fastapi-azure-auth.

ravaszf avatar ravaszf commented on June 19, 2024

Hi Jonas,

I've tried to contribute by following your guide, but ran into some issues with poetry. My company uses a proxy repo and one of the requirements of poetry is blocked, so I can't install it. Unfortunately I don1t have permissions to view the detailed report, so I don't know why is it blocked exactly, but apparently for now this is a no-go, on my company machine at least.

So I figured I'll try from my private PC, but that had nothing development related set up and got to the point where I've installed poetry with pip install. But then for pre-commit install I don't get any output. No error either, seemingly nothing happens:
kép

So not sure what's going on, but didn't want to proceed. Any ideas on that?

And another note regarding Python 3.10.0. I've made a rookie mistake and did not create venvs, and did not realize that after installing 3.10.0 my code was still running on 3.9.1. So it's actually possible that upgrading too would solve the issue. Unfortunately I can't verify as on 3.10.0 I can't install the dotenv package, due to above mentioned proxy repo blocking this as well, so I can't compile the code without rewriting it with an alternative to dotenv. Or finding the right team and getting dotenv unblocked. Neither of them would be quick.

from fastapi-azure-auth.

JonasKs avatar JonasKs commented on June 19, 2024

I've tried to contribute by following your guide, but ran into some issues with poetry. My company uses a proxy repo and one of the requirements of poetry is blocked, so I can't install it. Unfortunately I don1t have permissions to view the detailed report, so I don't know why is it blocked exactly, but apparently for now this is a no-go, on my company machine at least.

Ah, dang.

So I figured I'll try from my private PC, but that had nothing development related set up and got to the point where I've installed poetry with pip install. But then for pre-commit install I don't get any output. No error either, seemingly nothing happens:

Hmm, what happens if you run pre-commit run --all-files?

And another note regarding Python 3.10.0. I've made a rookie mistake and did not create venvs, and did not realize that after installing 3.10.0 my code was still running on 3.9.1. So it's actually possible that upgrading too would solve the issue. Unfortunately I can't verify as on 3.10.0 I can't install the dotenv package, due to above mentioned proxy repo blocking this as well, so I can't compile the code without rewriting it with an alternative to dotenv. Or finding the right team and getting dotenv unblocked. Neither of them would be quick.

Sounds pretty rough to develop at your work environment, not gonna lie. 😁

from fastapi-azure-auth.

ravaszf avatar ravaszf commented on June 19, 2024

I've tried to contribute by following your guide, but ran into some issues with poetry. My company uses a proxy repo and one of the requirements of poetry is blocked, so I can't install it. Unfortunately I don1t have permissions to view the detailed report, so I don't know why is it blocked exactly, but apparently for now this is a no-go, on my company machine at least.

Ah, dang.

So I figured I'll try from my private PC, but that had nothing development related set up and got to the point where I've installed poetry with pip install. But then for pre-commit install I don't get any output. No error either, seemingly nothing happens:

Hmm, what happens if you run pre-commit run --all-files?

Same, no output at all :/

And another note regarding Python 3.10.0. I've made a rookie mistake and did not create venvs, and did not realize that after installing 3.10.0 my code was still running on 3.9.1. So it's actually possible that upgrading too would solve the issue. Unfortunately I can't verify as on 3.10.0 I can't install the dotenv package, due to above mentioned proxy repo blocking this as well, so I can't compile the code without rewriting it with an alternative to dotenv. Or finding the right team and getting dotenv unblocked. Neither of them would be quick.

Sounds pretty rough to develop at your work environment, not gonna lie. 😁

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.

from fastapi-azure-auth.

JonasKs avatar JonasKs commented on June 19, 2024

Hmm, that’s weird.

I’m not sure what’s wrong honestly. If you have poetry and then write poetry install, then poetry shell you should be in the environment, with pre-commit installed.

from fastapi-azure-auth.

ravaszf avatar ravaszf commented on June 19, 2024

Yeah, weird. poetry install completed successfully, the venv shown by poetry shell looks a bit different than your's, but I think that's because I'm on Windows. Yet still nothing for pre-commit install:
kép

Btw, it was surprisingly easy to find someone with a way around the blocked dotenv package, so I was able to test Python 3.10.0 and with that it works even if I revert to collections.abc.

from fastapi-azure-auth.

JonasKs avatar JonasKs commented on June 19, 2024

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 😄

from fastapi-azure-auth.

ravaszf avatar ravaszf commented on June 19, 2024

Unfortunately I could not figure out what's wrong with poetry, but I've created a new PR.

from fastapi-azure-auth.

JonasKs avatar JonasKs commented on June 19, 2024

Thank you! 😄 I'll fix whatever needs fixing and push a new version to PyPi ASAP.

from fastapi-azure-auth.

JonasKs avatar JonasKs commented on June 19, 2024

@ravaszf , I've pushed a change to PyPi.

Thank you for your bug report and contribution! Let me know if there's anything more I can help you with.

EDIT: You've also been tagged as a contributor if you look at the release here. We also appreciate a ⭐ on the project if you haven't done so 😊

from fastapi-azure-auth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.