-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add --version to every entry point #456
base: main
Are you sure you want to change the base?
Conversation
why not a single entry point instead? |
I felt this was more the standard approach for every tool we use, even for tool suites such as It is also only adding two lines of code, and we could even reduce it to one if we move the logic into |
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.
Looks good to me, thanks Jorge. Tested some entry points too and looks fine !
Side note, is there currently way quick way to list or find all genomio entry points available ? Would it be useful to add such a functionality and a single entry point cmd to list all (+ maybe add current library version as well) ? |
The only way I can think of is looking at from importlib.metadata import entry_points
genomio_scripts = [
script.name for script in entry_points(group='console_scripts') if script.module.startswith("ensembl.io.genomio")
]
print("\n".join(genomio_scripts)) What I have found more frequently is that every entry point has its entry in the documentation. Something we should consider if we want to avoid having the auxiliary script you are mentioning (or have both). |
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.
Looks good, a nice way of using version with the parser
It turns out Python's argument parser has a quick workaround for this, so it was pretty quick to update all our entry points.