-
Notifications
You must be signed in to change notification settings - Fork 0
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 method to get the latest version of a extension #41
Comments
What's the context for this need? |
I'm using the library to get the list of all the latest versions of core extensions to include them in the mapping template. But I'm using |
Do you want the latest tagged version (if the extension has tags) or just the latest version? Because the latest version is always the one without a date (until we start having both 1.1 and 1.2 extensions in the registry). |
Well, I want the ones that should be in the field-level mapping template, so I guess the latest tagged version (e.g. not the one in the master branch) |
For now you can just hardcode these to use v1.1.5. Rest use the one with no date. bids |
I'm doing base_url = 'https://raw.githubusercontent.com/open-contracting/extension_registry/main'
registry = ExtensionRegistry(f'{base_url}/extension_versions.csv',
f'{base_url}/extensions.csv')
core_extensions = set([registry.get(id=extension.id,
version=max([version.version for version in registry.__iter__()])).base_url
for extension in registry.filter(core=True)]) With this as the result:
|
That works, though Also, calling iter multiple times is slow. Can cache it with |
Oh, probably more correct to change to |
Similar to
ExtensionRegistry.get()
method but for the latest version, not the first one (or add a parameter to this method)The text was updated successfully, but these errors were encountered: