mirror of
https://github.com/Glitchy-Sheep/boosty-downloader.git
synced 2026-10-14 21:33:23 +00:00
[PR #198] [MERGED] [cli] Add --config to point at a config file #197
Labels
No labels
api-drift
bug
ci
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Glitchy-Sheep/boosty-downloader#197
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Glitchy-Sheep/boosty-downloader/pull/198
Author: @Glitchy-Sheep
Created: 9/21/2026
Status: ✅ Merged
Merged: 9/21/2026
Merged by: @Glitchy-Sheep
Base:
main← Head:feat/config-path-flag📝 Commits (3)
56c16e5[config] Take the config path as a parameterd35a9b1[cli] Add --config to point at a config filef8fdc8b[docs] Describe --config and BOOSTY_DOWNLOADER_CONFIG📊 Changes
10 files changed (+290 additions, -84 deletions)
View changed files
📝
CHANGELOG.md(+4 -0)📝
boosty_downloader/cli/cli_options.py(+28 -0)📝
boosty_downloader/cli/commands/check.py(+14 -9)📝
boosty_downloader/cli/commands/clean_cache.py(+11 -5)📝
boosty_downloader/cli/commands/download.py(+14 -9)📝
boosty_downloader/cli/composition_root.py(+7 -3)📝
boosty_downloader/infrastructure/yaml_configuration/config.py(+53 -26)📝
boosty_downloader/main.py(+9 -2)📝
test/unit/cli/cli_smoke_test.py(+99 -4)📝
test/unit/configuration/init_config_test.py(+51 -26)📄 Description
📝 Summary
The config file can now be chosen. Before, it could only be
config.yamlin the folder the app runs from.🔧 What changes
boosty-downloader --config PATH <command>reads that file.BOOSTY_DOWNLOADER_CONFIGdoes the same for every command in a shell; the flag wins when both are given.config.yamlnext to the working directory, the sample created there on the first run, the same messages.🧩 How
init_config(config_path)andload_settings(..., config_path)take the path. pydantic-settings binds the yaml file to the settings class, so_read_configbuilds a subclass per path. The app callback puts the path intoctx.objasGlobalOptions; the three commands takectx: typer.Contextand pass it on. No module state.check.pyandclean_cache.pyimporttyperat runtime now: typer resolves theContextannotation when it registers the command.🚫 Not changed on purpose
platformdirs): nobody asked for it, and the current default works for the common one-folder setup.target_directory: ./boosty-downloads) are still resolved from the working directory, not from the config's folder.🧪 Tests
config.yamlin the cwd.--configwith a file in another folder (no sample in the cwd), the env var, the flag over the env var, the sample at the flag path, the root help names the env var.task cigreen locally: ruff, pyright strict, import-linter, 315 tests + e2e.--configto a real config runscheck; without the flag a sample appears there as before; the env var works;--config /nope/x.yamlgives one clear error line.✅ Checklist
--helpand README if neededdocs/if the download flow or dev process changed## Unreleasedin CHANGELOG.md (or theci/skip-changeloglabel if not user-facing)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.