Conversation
- Separation of concerns - actions are now separated from CLI interface - Models are separated from 'internals' - May want to think about what to do with internals to organize them a bit? - Introduced `models` for most of the Object Oriented stuff - Introduced `options` as a central aggregation of options and argument groups - this has 2 classes: `Option` and `ArgumentGroup`, each with the method `add_to_parser` for ease of use - Command subclasses now simply take a list of options or argument groups and have a defined method to override called `run(self, options)` -- this way we can pass parameters to the corresponding `actions` rather than just blanketing the options in Signed-off-by: Dan Ryan <dan@danryan.co>
- Also move `projects` and fix imports Signed-off-by: Dan Ryan <dan@danryan.co>
Signed-off-by: Dan Ryan <dan@danryan.co>
Signed-off-by: Dan Ryan <dan@danryan.co>
|
FYI I am going to add some tests on top of this and merge it if you don't have any issues, since this makes it a lot easier to test as i mentioned somewhere else |
- A few minor fixes with the restructure Signed-off-by: Dan Ryan <dan@danryan.co>
Signed-off-by: Dan Ryan <dan@danryan.co>
42223db to
ec156a5
Compare
|
Sure, I probably won’t have much time working on this for the next week, and if I find some I’ll work on creating a better mock PyPI server first. |
|
No worries I don’t think I changed any functionality just moved stuff around. But if you want to release a patch release of master (or I can if you’re ok with it) I can bundle that as the.backup resolver and cut a release of pipenv |
Signed-off-by: Dan Ryan <dan@danryan.co>
Signed-off-by: Dan Ryan <dan@danryan.co>
src/passa/models/synchronizers.py
Outdated
| """Helper class to clean packages not in a project's lock file. | ||
| """ | ||
| def __init__(self, project, default, develop): | ||
| def __init__(self, project, default, develop, sync=True): |
There was a problem hiding this comment.
What does sync do? I am not sure Cleaner needs to be aware of Synchronizer.
There was a problem hiding this comment.
I added it for the moment to see how the CLI feels with it (think of it like a --[no-]dry-run option... The actual reason related to a need to short-circuit the test environment's cleaning functionality, so don't take this as me thinking it should stay... just as a kind of 'does this seem like a good idea?' check
There was a problem hiding this comment.
If it’s a dry run flag, I’d be more inclined to give it a different name, or (better IMO) to have a DryRunCleaner to do that.
There was a problem hiding this comment.
seems like a good plan, haven't revisited it yet
There was a problem hiding this comment.
hmmm looking at the code I'm not sure about this actually, I don't see a reason to reimplement the exact same functionality and print the same result just skip one line of activity... this isn't a java project...
Signed-off-by: Dan Ryan <dan@danryan.co>
Signed-off-by: Dan Ryan <dan@danryan.co>
Signed-off-by: Dan Ryan <dan@danryan.co>
Signed-off-by: Dan Ryan <dan@danryan.co>
a bit?
modelsfor most of the Object Oriented stuffoptionsas a central aggregation of options andargument groups - this has 2 classes:
OptionandArgumentGroup,each with the method
add_to_parserfor ease of usegroups and have a defined method to override called
run(self, options)-- this way we can pass parameters to the correspondingactionsrather than just blanketing the options in
Let me know if you have questions or want to change anything here. I tested a bunch of stuff and it seems to work, and (for me anyway) this is starting to make a lot of sense. Happy to work with you to make it clearer, but it's actually a lot easier for me to follow so if it's not too bad for you it'd be super helpful
Here is an example of
cli.add:and the corresponding
actions.addThis way our core logic isn't tied exclusively to the CLI (and might be accessed by say, pipenv internals someday as a side-benefit)
Here is a new option (from
cli.options):