Skip to content

Create settings.yaml if not found in Module Creation #41

Description

@geanderson-ai

in get_metadata
assert setting_path.exists(), "settings.yaml file not found"
AssertionError: settings.yaml file not found

Activity

  1. ItayTheDar commented on Jan 20, 2024

    @ItayTheDar
    Contributor

    Hi @geanderson-ai! thanks for raising this issue.
    Normally, setting.yaml file is created as part of the create-nest-app command. The data stored in this file is critical for the generation of a new module. if we create the file on runtime as part of the generating module command, there will be a missing configuration that should let pynest know how to create the new module.
    I do agree that there is room to change the assertion message to be much more informative and let the user know what he should do

  2. JEub commented on May 7, 2024

    @JEub

    Can confirm, the settings file is getting created in the environment where the project is initialized. However, it does not port to other developers in their own local environments.

    To locally resolve this (for others who may be facing this issue) add a settings.yaml file to the <your python environment path>/lib/site-packages/nest directory with the following contents:

    config:
      db_type: <your database type>
      is_async: <true | false>
  3. JEub commented on May 7, 2024

    @JEub

    @ItayTheDar would it make more sense to ship this settings file as part of the application project directory instead of pointing the template to the library path at Path(__file__).parent.parent / "settings.yaml"?

    I suspect it would make joint development significantly easier.

  4. ItayTheDar commented on May 17, 2024

    @ItayTheDar
    Contributor

    @JEub I think that this is a bad practice and my bad from the beginning. This was for me a way to maintain context for the cli commands generations but it is too fragile. I need some configuration files that is generated with the application and follows the best practices

  5. ItayTheDar commented on Sep 28, 2026

    @ItayTheDar
    Contributor

    I opened #140 to fix this: generated projects now keep settings.yaml in the project root, and subsequent CLI commands read that project-local file. The PR includes regression tests and an end-to-end CLI/HTTP check. It is not merged yet.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions