Skip to content

Redefine extra dependency groups #389

Closed

Description

@jsstevenson

I'm not sure if a firm decision has been made on this but I've heard a few thoughts expressed on the matter:

  • Rename "extras" to something more expressive ("tools" or something?)
  • Merge the extra dependencies into the main dependencies
  • Separate the models/serialization business and the extra tooling into separately installable packages ("core" vs "tools" ?)

edit: had another thought to toss out: move extras to a different module level, a la

src
└── ga4gh
    ├── core
    ├── vrs    
    └── extras. # or "tools" or w/e
        ├── __init__.py
        ├── decorators.py
        ├── object_store.py
        ├── translator.py
        └── vcf_annotation.py
        └── utils
            └── hgvs_tools.py

Activity

  1. added
    2.0-alphaIssues related to VRS 2.0-alpha branch
    technical debtA feature/requirement implemented in a sub-optimal way & must be re-written. Contrast to "cleanup"
    on Apr 10, 2024
  2. korikuzma commented on Apr 10, 2024

    @korikuzma
    Contributor

    @ga4gh/vrs-python-maintainers @ga4gh/vr-maintainers should provide thoughts

  3. korikuzma commented on Apr 10, 2024

    @korikuzma
    Contributor
    • Rename "extras" to something more expressive ("tools" or something?)

    I am pro more meaningful name. Tools is fine to me

    • Merge the extra dependencies into the main dependencies
    • Separate the models/serialization business and the extra tooling into separately installable packages ("core" vs "tools" ?)

    I would prefer to keep them separate since in gene-normalizer, we only use the Pydantic models and would like to keep deps lightweight

  4. jsstevenson commented on Apr 10, 2024

    @jsstevenson
    ContributorAuthor

    I would prefer to keep them separate since in gene-normalizer, we only use the Pydantic models and would like to keep deps lightweight

    Yeah I agree that simply merging the dependencies would cause some unnecessary difficulties for some niche but not infrequent use cases. I guess the question is

    1. if we keep in same installable, is it weird to have the requirements for the most common use cases live under an optional dependency group?

    2. if we separate out into different packages, will it suck to maintain a models/core/serialization package separately from a tools (translator, annotator) package?

    final note: I noticed a few days ago that NetworkX is doing something like this -- you can theoretically install it without Numpy, etc but will hit import errors very quickly, so they recommend you just install with the optional [default] dependency group: https://networkx.org/documentation/stable/install.html#install-the-released-version

  5. theferrit32 commented on Apr 11, 2024

    @theferrit32
    Contributor

    I think it's okay to have a frequently used optional dependencies target. The core library functionality of the models and serialization stuff should be usable without those. Not being able to normalize alleles without it is a bit of a limitation.

    If there wasn't such a size difference in the installed size between them I'd say it wouldn't be that big of a deal to merge them. Adding the extras adds a lot (though I would expect most users to add them).

    docker run -it --rm python:3.11 bash -c 'du -hs /usr/local/lib/python3.11/site-packages'
    
    13M	/usr/local/lib/python3.11/site-packages
    
    
    docker run -it --rm python:3.11 bash -c 'pip install "ga4gh.vrs @ git+https://github.com/ga4gh/vrs-python" && du -hs /usr/local/lib/python3.11/site-packages'
    
    34M	/usr/local/lib/python3.11/site-packages
    
    
    docker run -it --rm python:3.11 bash -c 'pip install "ga4gh.vrs[extras] @ git+https://github.com/ga4gh/vrs-python" && du -hs /usr/local/lib/python3.11/site-packages'
    
    182M	/usr/local/lib/python3.11/site-packages
    
  6. jsstevenson commented on May 10, 2024

    @jsstevenson
    ContributorAuthor

    @theferrit32 ~40MB of that is PySam (by way of HGVS -> SeqRepo -> PySam), which maybe explains why the DataProxy stuff is reimplemented here instead of being imported from SeqRepo...

  7. changed the title [-]Eliminate "extra" dependencies[/-] [+]Redefine extra dependency groups[/+] on Mar 31, 2025
  8. jsstevenson commented on Mar 31, 2025

    @jsstevenson
    ContributorAuthor

    Ok, I'm going to sum up a few ideas that I've had or seen in various places -- some mutually exclusive, some not

    • Rename the 'extras' dependency group
    • Break the 'extras' dependency group down further
    • Rename or move the 'extras' subpackage
  9. marked Split out extras #528 as a duplicate of this issue on Mar 31, 2026
  10. theferrit32 commented on Oct 19, 2026

    @theferrit32
    Contributor

    Resolved in v3 branch in #619

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    2.0-alphaIssues related to VRS 2.0-alpha branchtechnical debtA feature/requirement implemented in a sub-optimal way & must be re-written. Contrast to "cleanup"

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions