Closed iluminite closed 10 years ago
Hello and thanks for the feedback! I'm using Argh with entry points in some of my apps:
(See also the code above the suggested lines for hints on support for bash completion.)
If you experience problems with porting this to your apps, please provide an example so we could indeed come up with some documentation for the benefit of the community.
(By the way, offtopic: your py-app-config seems to share the goals with my confu, perhaps we could discuss a common specification? The core of confu is in fact a very small class, almost like ConfigBase
from py-app-config, and it seems to be enough, LOL.)
@neithere,
Thanks for the references, the setup.py in timetra-diary made things more clear for me. There are so many ways to use argh (thankfully!) how to do this with entry points is a bit unclear. I guess it is not very different from what you normally do, but there are a few gotchas (namely that you cannot try to load a command directly as an entry point).
I've posted a new repo to github with what I've come up with, and it works well (see argh-examples). The question I have now: would you like any improvements to the docs on this topic? I could whip something up if it would be helpful to you. Feel free to use any of the code/docs I've published in argh-examples if you would prefer to write the docs.
On the config topic, there is a bunch more to the ConfigBase class than what is in master - I've pushed out the Work-in-Progress branch I have (WIP) so you can review that if you are interested. The idea is to create a glorified dictionary with the ability to load defaults, options, and environment variables in sensible ways, as well as either YAML/JSON files. This implementation uses the Parameters() class from reclass.datatypes to do deep-dictionary merging and to provide the option for interpolation within the config.
I had not seen confu before, despite looking for alternatives. I like what you're doing there, though I am not sure if I want to get into validation (which you have). I'm open to contributing to confu, but am not sure how/what I would provide at this moment. The appconfig I've got so far is a WIP and a test to see what this is all like. It needs feedback, improvements, and some sort of desire for long-term support. I don't mind continuing with the project if it serves us well.
Thanks a lot for argh-examples
, I've added a link to your repository in the tutorial along with an over-simplified example. If you could write a brief dedicated chapter with advanced examples based on that repo, I'd certainly add it to the docs.
@neithere, the docs look great, if even basic. I will certainly let you know if I put a more detailed doc together on advanced usage.
Hi,
I've been using argh in a few ways, but I've been unable to figure out how to properly use argh with python's entry_points (provided by setuptools). EG, something like:
Is argh compatible with python's entry points? Am I making a mistake in trying to use these two together? Thanks for a great library!