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

Adds ability to set alternate local folder for config/metadata directory #111

Merged
merged 7 commits into from
Nov 29, 2024

Conversation

cfleur
Copy link
Contributor

@cfleur cfleur commented Oct 11, 2024

User can configure location of config directory by setting an environment variable. Rebases #109 off of v1.4.1. Closes #108. NOTE: documentation update needed!

Copy link

netlify bot commented Oct 11, 2024

Deploy Preview for em27-retrieval-pipeline ready!

Name Link
🔨 Latest commit 88220f4
🔍 Latest deploy log https://app.netlify.com/sites/em27-retrieval-pipeline/deploys/6749860f2ba7cb00088d9dc0
😎 Deploy Preview https://deploy-preview-111--em27-retrieval-pipeline.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@cfleur
Copy link
Contributor Author

cfleur commented Oct 11, 2024

@dostuffthatmatters where should documentation for this be updated?
Also a question regarding logging: I noticed the main module in retrievals wraps the config loading in a try-except block. I was thinking of doing the same for the bundles and profiles as well, and I noticed the logging is defined inside the retrieval utils. Could you share a bit on the logic for that? Is a different logging used is different places? Does this have to do something with the containers? What is the best practice to log exceptions outside of the retrievals module?
Lastely let me know if you have any comments on the new envutils module? I was not sure whether this logic should belong to a class in types or this way as utility functions?

@cfleur cfleur force-pushed the alternate-config-path branch from 23acbda to 4505d32 Compare October 16, 2024 11:14
@cfleur
Copy link
Contributor Author

cfleur commented Oct 16, 2024

@dostuffthatmatters I think this PR is now ready, the documentation has also been updated. Let me know if you have any comments.

Copy link
Member

@dostuffthatmatters dostuffthatmatters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the implementation! Looks very minimal and useful. Good work.

I only have three remarks:

  • the small adjustments to the docs
  • avoid the chained calls
  • refactor the import style

Also, could you please rename the utils.envutils to utils.environment?

docs/pages/guides/metadata.mdx Show resolved Hide resolved
docs/pages/guides/metadata.mdx Show resolved Hide resolved
src/utils/envutils.py Outdated Show resolved Hide resolved
src/utils/envutils.py Outdated Show resolved Hide resolved
tests/integration/test_config.py Outdated Show resolved Hide resolved
src/retrieval/main.py Outdated Show resolved Hide resolved
src/profiles/main.py Outdated Show resolved Hide resolved
src/bundle/main.py Outdated Show resolved Hide resolved
cli.py Outdated Show resolved Hide resolved
cli.py Outdated Show resolved Hide resolved
@cfleur cfleur force-pushed the alternate-config-path branch from abe1e44 to 7098ff4 Compare October 17, 2024 15:42
@cfleur
Copy link
Contributor Author

cfleur commented Oct 21, 2024

@dostuffthatmatters I think the requested changes have been updated, and there are a few threads on some of the comments that you can have a look at.

@dostuffthatmatters dostuffthatmatters self-requested a review November 2, 2024 08:03
tests/integration/test_profiles_connection.py Outdated Show resolved Hide resolved
src/utils/environment.py Outdated Show resolved Hide resolved
cli.py Show resolved Hide resolved
@dostuffthatmatters
Copy link
Member

Hi @cfleur,

apologies for the late reply. There was other rather urgent things to do.

Thank you for the refactoring. I marked some required changes above.

Best,
Moritz

- Removes dependency of environment fuctions on each other, refactors
  variables
- Updates documentation about how to export .env file in environment
- methods that get config path from environment placed inside
  types.Config class
@cfleur
Copy link
Contributor Author

cfleur commented Nov 22, 2024

Updates to location of functions getting the config directory environment variable has been changed from utils.environment -> types.Config in latest commit.

A consequence of this is that it allows to input directly the value of the environment variable into Config.load method, reverting the original changes from this PR to calls to Config.load with an argument.

However changes to file imports in these files remain, as they update import order to follow the PEP 8 style guide for imports, namely grouping imports by type and separating them by a space.

@cfleur
Copy link
Contributor Author

cfleur commented Nov 28, 2024

@dostuffthatmatters are you okay with this or do you prefer the imports reverted in the now unchanged files?
Also would you like the commits to be squashed in the branch or remain like this?

@dostuffthatmatters
Copy link
Member

Hi @cfleur,

no all good now. Thank you very much for implementing all the requested changes. The improvement looks very clean now! I will merge it in a bit after I run the complete tests.

@dostuffthatmatters dostuffthatmatters merged commit 88220f4 into tum-esm:main Nov 29, 2024
7 checks passed
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

Successfully merging this pull request may close these issues.

Ability to specifiy alternate local config location
2 participants