[PR #52] [MERGED] Use pydantic settings #80

Closed
opened 2026-03-02 16:48:05 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/initialcommit-com/git-sim/pull/52
Author: @paketb0te
Created: 2/10/2023
Status: Merged
Merged: 2/10/2023
Merged by: @initialcommit-io

Base: mainHead: use_pydantic_settings


📝 Commits (2)

  • f90e126 use pydantic BaseSettings
  • 5609ab1 remove obsolete env var handling

📊 Changes

18 files changed (+170 additions, -173 deletions)

View changed files

📝 git_sim/__main__.py (+35 -35)
📝 git_sim/add.py (+2 -2)
📝 git_sim/animations.py (+9 -17)
📝 git_sim/branch.py (+4 -4)
📝 git_sim/cherrypick.py (+2 -2)
📝 git_sim/commit.py (+3 -3)
📝 git_sim/git_sim_base_command.py (+56 -56)
📝 git_sim/log.py (+3 -3)
📝 git_sim/merge.py (+2 -2)
📝 git_sim/rebase.py (+7 -7)
📝 git_sim/reset.py (+2 -2)
📝 git_sim/restore.py (+2 -2)
📝 git_sim/revert.py (+7 -7)
📝 git_sim/settings.py (+25 -21)
📝 git_sim/stash.py (+2 -2)
📝 git_sim/status.py (+4 -4)
📝 git_sim/tag.py (+4 -4)
📝 setup.py (+1 -0)

📄 Description

Pydantic's BaseSettings give us automatic parsing of env vars for all defined settings for free.

Git-sim will use the default values specified in the Settings class if neither the corresponding flag nor env var is set.

If an env var is set, it will be used instead of the default.

If a flag is set, that will always be used, overriding an env var (if present).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/initialcommit-com/git-sim/pull/52 **Author:** [@paketb0te](https://github.com/paketb0te) **Created:** 2/10/2023 **Status:** ✅ Merged **Merged:** 2/10/2023 **Merged by:** [@initialcommit-io](https://github.com/initialcommit-io) **Base:** `main` ← **Head:** `use_pydantic_settings` --- ### 📝 Commits (2) - [`f90e126`](https://github.com/initialcommit-com/git-sim/commit/f90e126b2bc0453e7af6c2b6c9aa4b2e57fd77e9) use pydantic BaseSettings - [`5609ab1`](https://github.com/initialcommit-com/git-sim/commit/5609ab15df78599c373ce723cea780d5fb0ce80a) remove obsolete env var handling ### 📊 Changes **18 files changed** (+170 additions, -173 deletions) <details> <summary>View changed files</summary> 📝 `git_sim/__main__.py` (+35 -35) 📝 `git_sim/add.py` (+2 -2) 📝 `git_sim/animations.py` (+9 -17) 📝 `git_sim/branch.py` (+4 -4) 📝 `git_sim/cherrypick.py` (+2 -2) 📝 `git_sim/commit.py` (+3 -3) 📝 `git_sim/git_sim_base_command.py` (+56 -56) 📝 `git_sim/log.py` (+3 -3) 📝 `git_sim/merge.py` (+2 -2) 📝 `git_sim/rebase.py` (+7 -7) 📝 `git_sim/reset.py` (+2 -2) 📝 `git_sim/restore.py` (+2 -2) 📝 `git_sim/revert.py` (+7 -7) 📝 `git_sim/settings.py` (+25 -21) 📝 `git_sim/stash.py` (+2 -2) 📝 `git_sim/status.py` (+4 -4) 📝 `git_sim/tag.py` (+4 -4) 📝 `setup.py` (+1 -0) </details> ### 📄 Description Pydantic's BaseSettings give us automatic parsing of env vars for all defined settings for free. Git-sim will use the default values specified in the `Settings` class if neither the corresponding flag nor env var is set. If an env var is set, it will be used instead of the default. If a flag is set, that will always be used, overriding an env var (if present). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 16:48:05 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/git-sim#80
No description provided.