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

Enable use of enviornmental variable version pin dictionary #189

Merged
merged 7 commits into from
Aug 13, 2024

Conversation

nanglo123
Copy link
Contributor

This draft PR enables users to define a prefix to version mapping stored in an environmental variable: VERSION_PINS which will allow users to define the configured version they would like to use for a resource to avoid downloading new versions of the resource. The problem with the current argument-based approach is that in many settings PyOBO is being accessed indirectly so it would be very inconvenient to control versions via function arguments.

Places in the code where bioversions.get_versions is used has been replaced by pyobo.api.utils.get_version as we call bioversions.get_versions in pyobo.api.utils.get_version. Please let me know if this change is not needed.

@nanglo123 nanglo123 marked this pull request as ready for review August 7, 2024 16:51
src/pyobo/constants.py Outdated Show resolved Hide resolved
src/pyobo/constants.py Outdated Show resolved Hide resolved
@bgyori
Copy link
Contributor

bgyori commented Aug 13, 2024

The linter complains about the following:

mypy: commands[0]> mypy --install-types --non-interactive --ignore-missing-imports src/pyobo/
src/pyobo/sources/biogrid.py:68: error: Argument "version" to "prefix_directory_join" has incompatible type "partial[str | None]"; expected "str | Callable[[], str] | None"  [arg-type]
Found 5 errors in 4 files (checked 149 source files)
src/pyobo/sources/mesh.py:336: error: Argument "version" to "get_tree_to_mesh_id" has incompatible type "str | None"; expected "str"  [arg-type]
src/pyobo/xrefdb/sources/pubchem.py:26: error: Argument "version" to "get_pubchem_id_to_mesh_id" has incompatible type "str | None"; expected "str"  [arg-type]
src/pyobo/cli/lookup.py:285: error: Too many positional arguments for "get_name_by_curie"  [misc]
src/pyobo/cli/lookup.py:298: error: Too many positional arguments for "get_name_by_curie"  [misc]

@bgyori bgyori merged commit 67f4da3 into biopragmatics:main Aug 13, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants