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

[pytx] CLI separation: move config and state classes out of cli module #1294

Closed
wants to merge 1 commit into from

Conversation

dougneal
Copy link
Contributor

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...

@dougneal dougneal requested a review from Dcallies as a code owner March 28, 2023 20:40
@github-actions github-actions bot added the python-threatexchange Items related to the threatexchange python tool / library label Mar 28, 2023
Copy link
Contributor

@Dcallies Dcallies left a 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
Copy link
Contributor

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

Copy link
Contributor Author

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):
Copy link
Contributor

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,

@dougneal
Copy link
Contributor Author

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?

No prob. I'll close this.

@dougneal dougneal closed this Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed python-threatexchange Items related to the threatexchange python tool / library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants