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

Remove typer as a dependency and streamline accordingly #266

Merged
merged 4 commits into from
Aug 29, 2022
Merged

Remove typer as a dependency and streamline accordingly #266

merged 4 commits into from
Aug 29, 2022

Conversation

bachya
Copy link
Owner

@bachya bachya commented Aug 29, 2022

Describe what the PR does:

typer is a wonderful library, but after much consideration, it isn't the greatest fit here:

  1. It can't do the complex config validation we need without lots of custom code.
  2. We aren't making use of any features that elevate it above, say, argparse.
  3. It comes with several sub-dependencies that we don't use.

So, this (unfortunately large) PR does the following:

  1. Removes typer (and most of its subdependencies) from our graph
  2. Retains (and explicitly uses) voluptuous for config validation and coercion (allowing us to replace a lot of custom logic)
  3. Uses plain ol' argparse for CLI parsing
  4. Retains colorlog so we can still get nicely colored log messages

Does this fix a specific issue?

N/A

Checklist:

  • Confirm that one or more new tests are written for the new functionality.
  • Run tests and ensure everything passes (with 100% test coverage).
  • Update README.md with any new documentation.
  • Add yourself to AUTHORS.md.

@bachya bachya added the maintenance Generic library tasks label Aug 29, 2022
@bachya bachya self-assigned this Aug 29, 2022
@bachya bachya changed the title Vol Remove typer as a dependency and streamline accordingly Aug 29, 2022
@codecov
Copy link

codecov bot commented Aug 29, 2022

Codecov Report

Merging #266 (2761304) into dev (3bc325f) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 2761304 differs from pull request most recent head 6c24ca6. Consider uploading reports for the commit 6c24ca6 to get more accurate results

@@            Coverage Diff            @@
##               dev      #266   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        22    +1     
  Lines         1018      1081   +63     
=========================================
+ Hits          1018      1081   +63     
Impacted Files Coverage Δ
ecowitt2mqtt/__main__.py 100.00% <100.00%> (ø)
ecowitt2mqtt/config.py 100.00% <100.00%> (ø)
ecowitt2mqtt/const.py 100.00% <100.00%> (ø)
ecowitt2mqtt/core.py 100.00% <100.00%> (ø)
ecowitt2mqtt/helpers/config_validation.py 100.00% <100.00%> (ø)
ecowitt2mqtt/runtime.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@bachya bachya merged commit e727025 into dev Aug 29, 2022
@bachya bachya deleted the vol branch August 29, 2022 16:45
@github-actions github-actions bot locked and limited conversation to collaborators Nov 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
maintenance Generic library tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant