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

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

Open
geanderson-ai opened this issue Jan 19, 2024 · 4 comments
Open

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

geanderson-ai opened this issue Jan 19, 2024 · 4 comments

Comments

@geanderson-ai
Copy link

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

@ItayTheDar
Copy link
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

@JEub
Copy link

JEub commented May 7, 2024

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>

@JEub
Copy link

JEub commented May 7, 2024

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

@ItayTheDar
Copy link
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

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

3 participants