Closed dhimmel closed 2 years ago
I just made a note in https://github.com/related-sciences/ensembl-genes/issues/1#issuecomment-940494237 on how to do this by directly getting some JSON. The format is stable so I'd say you can depend on it looking like this. Maybe I will add an additional metadata field or two from the bioregistry for convenience in the future, but that wouldn't break anything.
I guess it's the case that there are a lot of dependencies, but most of them are small utilities that I'd expect most environments to have if they're installing any other common stuff. For things like pystow and the bioregistry, I have been careful to keep them as lean as possible so they don't install a lot of transitive dependencies. I would be hesitant to remove some of the dependencies like pyyaml
, lxml
, beautifulsoup4
, requests_ftp
because most users won't/shouldn't have to know which ones will be used by each getter. I think it would be pretty confusing to have a lean version of bioversions
that just supports looking stuff up in the JSON when most usage of this package directly is to interact with the sites on demand.
most usage of this package directly is to interact with the sites on demand
I see. I like having your CI do the interaction and for us to consume the output.
The JSON approach is simple enough for us:
import requests
url = "https://raw.githubusercontent.com/biopragmatics/bioversions/main/src/bioversions/resources/versions.json"
res_json = requests.get(url).json()
versions = {
entry["prefix"]: entry["releases"][-1]["version"]
for entry in res_json["database"]
if "prefix" in entry
}
ensembl_version = versions["ensembl"]
I'd expect most environments to have if they're installing any other common stuff
I noticed because lot's of packages were added to poetry.lock
in https://github.com/related-sciences/ensembl-genes/pull/3/commits/8f3ac75ec381bd397445dc913170a00f6d9b6981.
The dependencies are a bit heavy:
https://github.com/biopragmatics/bioversions/blob/5440e5aecad7d1c72e905c07a140389967c4ff9e/setup.cfg#L45-L60
I imagine this is because these dependencies are required to generate
docs/_data/versions.yml
.For https://github.com/related-sciences/ensembl-genes/issues/1, I just want to get the latest version of a resource like:
Would it make sense to have a dependency set that just supports reading versions that have already been aggregated into
versions.yml
?Users can just get this by URL, but is the format stable? Is there also a JSON version that would avoid having to install a yaml parser?