2
0
Fork 0
Commit graph

30 commits

Author SHA1 Message Date
Lance Edgar a76cbf29e9 feat: remove legacy command system
typer is the recommended approach, but any could be used.  we have
nothing significant to offer so better to just not.
2024-07-04 14:35:29 -05:00
Lance Edgar fd76766f56 fix: use more explicit import in config constructor 2024-07-04 11:37:37 -05:00
Lance Edgar f5825e964c test: add 'nodb' test runner
ensure things work as expected if sqlalchemy is not installed
2024-07-04 08:00:42 -05:00
Lance Edgar a25712ef54 fix: let config class specify default app handler, engine maker
this avoids the need for a config subclass to use `setdefault()` hacks
to specify default app handler for instance, since that approach must
compete with config extensions who also may wish to do that.

similar concept for the engine maker; notably the rattail project
needs to override this function somewhat and we need a way to allow
for that without (re-)introducing the app handler here.
2024-07-04 07:24:07 -05:00
Lance Edgar c3efbfbf7b fix: ensure config has no app when constructor finishes
had to move `make_engine_from_config()` out of app handler and define
as a separate function, so that `get_engines()` did not need to
instantiate the app handler.  because if it did, then config
extensions would lose the ability to set a default app handler - er,
they could do it but it would be ignored
2024-07-04 06:21:38 -05:00
Lance Edgar f654906029 fix: fallback to importlib_metadata when loading entry points
since `pkg_resources` is deprecated for this purpose, per
https://setuptools.pypa.io/en/latest/pkg_resources.html
2024-06-14 17:27:22 -05:00
Lance Edgar 6777f02e06 Fix bug when default config paths do not exist
when fetching initial path listing, to create config object.  should
only affect situations where default file paths are needed, i.e. when
caller does not specify
2024-05-28 22:57:19 -05:00
Lance Edgar a552e6c471 Raise AttributeError if no app provider has it
whoops, super().__getattr__() is not really defined
2024-05-15 14:22:45 -05:00
Lance Edgar 24a86ffeb4 Make WuttaConfig.get_list() return None by default
instead of empty list `[]`
2024-04-14 14:59:32 -05:00
Lance Edgar 49edece2f2 Fix test if local config file exists 2023-11-25 18:05:52 -06:00
Lance Edgar d73ff274df Add generic handler base class, tests, docs 2023-11-25 16:28:37 -06:00
Lance Edgar 3a8bd1fce9 Add app providers, tests, docs 2023-11-24 23:11:26 -06:00
Lance Edgar b59e83907c Add config extension class, tests, docs 2023-11-24 18:45:10 -06:00
Lance Edgar af4c28b286 Add a large chunk of the docs for command line interface
will have to finish subcommands later
2023-11-22 21:40:26 -06:00
Lance Edgar e2963403fe Add date-organize subcommand 2023-11-22 12:26:27 -06:00
Lance Edgar c3914738d5 Move cli framework to wuttjamaican.cmd subpackage
deprecate `wuttjamaican.commands`
2023-11-22 11:13:39 -06:00
Lance Edgar 5c4dcb09f3 Add --stdout and --stderr args for base Command class
also refactor its `run()` method to allow more customizing ability
2023-11-22 09:11:36 -06:00
Lance Edgar 13472a5ab5 Add wutta make-appdir subcommand 2023-11-22 00:10:40 -06:00
Lance Edgar 1431555605 Allow factory override in make_config()
also add `winsvc` param for `get_config_paths()` to support
RattailFileMonitor service on windows
2023-11-21 22:25:45 -06:00
Lance Edgar ed6a5db452 Add Subcommand.make_arg_parser() method
split that out for clarity
2023-11-21 20:48:44 -06:00
Lance Edgar ea9a9ade57 Change entry point group naming for subcommands
and use fallback to find subcommands registered via legacy naming
2023-11-21 14:08:26 -06:00
Lance Edgar d8252f029d Allow specifying config object for Command constructor
might as well re-use config if available..not sure how often this will
happen in practice
2023-11-20 23:13:59 -06:00
Lance Edgar a0186b346e Add common FileConfigTestCase class, in new testing module
hoping i do not regret this decision..  since the tests do not live in
a "real" package i think the only way to share code is to add some
things to the main package
2023-11-20 16:19:22 -06:00
Lance Edgar 427afc27fc Add test to ensure we get correct app handler by default 2023-11-20 09:57:38 -06:00
Lance Edgar b458272207 Add make_engine_from_config() method for AppHandler
and other misc. tweaks needed to get this incorporated into Rattail
2023-11-19 20:36:51 -06:00
Lance Edgar 068d8f29b5 Fix errors for tox runs 2023-11-19 15:21:17 -06:00
Lance Edgar 005f43d14e Add basic command line framework
`wutta setup` is the only real sub/command yet, and it does nothing
2023-11-19 14:22:25 -06:00
Lance Edgar c45aea71df Fix tox tests for python3.6 2023-10-29 23:32:11 -05:00
Lance Edgar cd2d16e6ac Log warning if ambiguous config key detected 2023-10-29 22:41:33 -05:00
Lance Edgar 5c3c42d6b3 First commit, basic config (with db) and app handler
this has 100% test coverage and i intend to keep it that way.  api
docs have a good start but still need narrative.  several more things
must be added before i can seriously consider incorporating into
rattail but this seemed a good save point
2023-10-28 17:50:13 -05:00