-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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
refactor: entrypoint of script #2143
base: master
Are you sure you want to change the base?
Conversation
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.
Hm.
4/9 of the original unit tests seem to fail. Upon further investigation, this is what I've come away with --
Unit tests ran with:
cd sherlock
python -m unittest tests.all --verbose
As a standalone script...
python3 sherlock xyz
works as before Sherlock was packaged (this is a +), but this (on its own) is also not hugely beneficial for Sherlock's inclusion in other scripts as a module or package, only really as an included file.
Now the various installed-package forms...
pip install .
sherlock test123
Install works fine. Manual test however fails with infinite recursion.
Note that sherlock --version
seems to work, just not beginning any scans.
And when testing the now-installed package within Python...
import sherlock
sherlock({anything})
Returns that sherlock is not a callable module.
I'm not seeing any part of entrypoint main() that accepts passed (python) args, only the original cli parser args. It seems that sherlock() was given extra arguments (with defaults), but this is not the package entrypoint as defined by pyproject.
Could you send me any resources for testing this project? |
@a-wallen Somehow missed your reply I have Sherlock integrated over here if you're looking for a known-good and functional example of scripted use The crux of the entire integration came down to this: from sherlock_project.sherlock import sherlock
from sherlock_project.sites import SitesInformation
from sherlock_project.notify import QueryNotify
sites = SitesInformation()
sites_data = { site.name: site.information for site in sites }
results:List[Dict] = sherlock(
username=query,
site_data=sites_data,
query_notify=QueryNotify(),
timeout=timeout,
) where the rest is just working the returned results. After working a proper integration, I'm not too sure what specifically needs improvement other than proper type setting and docstrings (open to suggestions) |
Parse the system args in
main()
for command line use.For people using this in their python script they should be able to supply the same arguments in the function.