-
Notifications
You must be signed in to change notification settings - Fork 297
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
[pytx] CLI separation: move config and state classes out of cli module #1294
Conversation
3fda1f8
to
751d8a1
Compare
751d8a1
to
83c3d38
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be better at this exact time to just import the CLI libraries as they are named - this is something that is easy for us to do after the hackathon, but may be disruptive during the hackathon.
That, plus the other considerations on whether we want to promote these interfaces fully make this not clear cut to me.
Is there anything being blocked by these changes that requires them?
f"Failed to read state for {collab_name}. " | ||
"You might have to delete it with `threatexchange fetch --clear`" | ||
) | ||
) from exc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is captured by default in modern python, and might explicitly hint you don't want the full stack printed (or maybe that's from None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok, I was following a linter recommendation but it may have been an out of date rule
@@ -32,9 +31,15 @@ | |||
from threatexchange.signal_type import index | |||
|
|||
|
|||
class CliIndexStore: | |||
class TXStateException(Exception): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to collide with Nikolay's changes if he has any in flight,
No prob. I'll close this. |
Summary
The library's core functionality and the CLI are separate concerns, so code which doesn't concern the CLI, shouldn't have the appearance of doing so. Move and rename the config and state management classes to reflect this. This will be fundamental to making the API parts make sense.
Test Plan
See what GH CI says...