s3rius / FastAPI-template

Feature rich robust FastAPI template.
MIT License
1.79k stars 161 forks source link

dummy module error #173

Open mate-dravucz opened 1 year ago

mate-dravucz commented 1 year ago

Hi,

I am trying to generate a new project and I selected these options: Rest API No database No CI/CD Add dummy model
Add example routers Adds traefik labels to docker container

I am getting an error since the dummy module is missing. Am I doing something wrong? I tried running it with Docker too same exception. Great project btw.

Mac Ventura 13.3 Python 3.11.4 Poetry (version 1.5.1) fastapi==0.97.0 fastapi-template==4.1.5

Error:

Check with Flake8........................................................Passed
Validate types with MyPy.................................................Failed
- hook id: mypy
- exit code: 1

deriv_project/web/api/router.py:3: error: Module "deriv_project.web.api" has no
attribute "dummy"  [attr-defined]
    from deriv_project.web.api import dummy, echo, monitoring
    ^
Found 1 error in 1 file (checked 18 source files)

Check python ast.........................................................Passed
Trim Trailing Whitespace.................................................Passed
Check Toml...............................................................Passed
Fix End of Files.........................................................Passed
Add trailing commas......................................................Passed
Pretty format YAML.......................................................Passed
Format with Black........................................................Passed
autoflake................................................................Passed
isort....................................................................Passed
Check with Flake8........................................................Passed
Validate types with MyPy.................................................Failed
- hook id: mypy
- exit code: 1

deriv_project/web/api/router.py:3: error: Module "deriv_project.web.api" has no
attribute "dummy"  [attr-defined]
    from deriv_project.web.api import dummy, echo, monitoring
    ^
Found 1 error in 1 file (checked 18 source files)

Project successfully generated. You can read information about usage in README.md
s3rius commented 1 year ago

Wow. We'll fix it. Can you please send me fastapi-template.options from your pyproject.toml?

mate-dravucz commented 1 year ago

Thanks,

[fastapi-template.options]
project_name = "test123"
api_type = "rest"
enable_redis = "None"
enable_rmq = "None"
ci_type = "none"
enable_migrations = "None"
enable_taskiq = "None"
enable_kube = "None"
kube_name = "test123"
enable_routers = "True"
enable_kafka = "True"
enable_loguru = "None"
traefik_labels = "None"
add_dummy = "True"
orm = "none"
self_hosted_swagger = "None"
prometheus_enabled = "None"
sentry_enabled = "None"
otlp_enabled = "None"