Skip to content

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

Description

@danilovmy

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions