-
Notifications
You must be signed in to change notification settings - Fork 24
Add settings #214
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
Add settings #214
Conversation
Settings can now be defined through environment variables, .env local file or regular arguments to the script. All variables need to be prefixed by PYTHON_INSPECTOR_ to be recognized. Example: PYTHON_INSPECTOR_INDEX_URL="https://pypy1.org,https://foo.bar" will add this two repositories overriding the public repository. Raise the minimum python version to 3.9 as 3.8 is EOL. Adapt base code to use new settings class Adapt tests to use new settings class Signed-off-by: Helio Chissini de Castro <[email protected]>
* Do not hide settings module imports with settings variable * Update requirements for pydantic and pydantic_settings * Restore tests on Python 3.8 * Regenerate tests expectations * Remove code formatting changes and minor typing changes * Improve support for defaults and index_urls Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
This was removed implicitly when adding a default OS to the CLI. Signed-off-by: Philippe Ombredanne <[email protected]>
In the meantime, I found out that click (the library which is used here for the command line processing) has built-in support for environment variables, and that it is trivial to add support for .env files with the https://github.com/theskumar/python-dotenv library which is also used in Flask (where click started).
So I am wondering if using the built-in click support would not be better than using pydantic and also limit the number of deps. |
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
The tests all pass. The only pending issue is the Ci for doc, and it will solved elsewhere. Merging. |
This PR builds on @heliocastro PR:
This is a draft. It should be split in something else for the CHANGELOG and for the tests.