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

fastapi startproject not works if git is not installed. #127

Open
danilovmy opened this issue Jun 22, 2023 · 0 comments
Open

fastapi startproject not works if git is not installed. #127

danilovmy opened this issue Jun 22, 2023 · 0 comments

Comments

@danilovmy
Copy link

new windows system. I want work local. i dont need git for my goals.

falls on context.py

# row 43
    def validate_project(cls, values: dict):
        try:
            values["username"] = subprocess.check_output(["git", "config", "--get", "user.name"])
            values["email"] = subprocess.check_output(["git", "config", "--get", "user.email"])
        except subprocess.CalledProcessError:  #(Exception file not found error and not only )
            ... 

my opinion it should be possible to takeinfo from cli:

fastapi startproject myproject --user username --email e@ma.il

in this case it can be:

def validate_project(cls, values: dict):
    try:
        values["username"] = subprocess.check_output(["git", "config", "--get", "user.name"])
        values["email"] = subprocess.check_output(["git", "config", "--get", "user.email"])
    except Exception as error: (Exception file not found error and not only subprocess.CalledProcessError)
        values["email"] = get something from args in cli on start
        values["username"] = get something from args in cli on start
        ... 
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

No branches or pull requests

1 participant