Skip to content

Conversation

@david4096
Copy link
Member

Was working on the annotator and these dependencies were missing. uv sync --extra extras

@david4096 david4096 requested review from a team as code owners March 31, 2025 20:45
Copy link
Contributor

@jsstevenson jsstevenson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently squinting at the commit history trying to understand why we would've pulled that pysam dependency in the first place...

@david4096 could you add a comment explaining the need for pinning setuptools/that specific version?

@david4096
Copy link
Member Author

david4096 commented Apr 1, 2025

  1. Oh I wouldn't know!

  2. uv sync fails without it. A different version would probably work. The error is not having pkg_resources

https://stackoverflow.com/questions/7446187/no-module-named-pkg-resources

@jsstevenson
Copy link
Contributor

Thanks! I'm not sure I'm precisely replicating your error (uv sync --extra extras works for me on python 3.10, 11, 12, and 13) but I do see a pkg_resources import during pytest setup:

________________________________________ ERROR collecting tests/extras/test_allele_translator.py ________________________________________         
ImportError while importing test module '/Users/jss009/code/vrs-python/tests/extras/test_allele_translator.py'.                                   
Hint: make sure your test modules/packages have valid Python names.      
Traceback:                                                               
../../.local/share/uv/python/cpython-3.11.11-macos-aarch64-none/lib/python3.11/importlib/__init__.py:126: in import_module                        
    return _bootstrap._gcd_import(name[level:], package, level)          
tests/extras/test_allele_translator.py:5: in <module>                    
    from ga4gh.vrs.extras.translator import AlleleTranslator             
src/ga4gh/vrs/extras/translator.py:17: in <module>                       
    from ga4gh.vrs.utils.hgvs_tools import HgvsTools                     
src/ga4gh/vrs/utils/hgvs_tools.py:6: in <module>                         
    import hgvs                                                          
.venv/lib/python3.11/site-packages/hgvs/__init__.py:60: in <module>      
    import pkg_resources                                                 
E   ModuleNotFoundError: No module named 'pkg_resources'                 
__________________________________________ ERROR collecting tests/extras/test_annotate_vcf.py ___________________________________________         
ImportError while importing test module '/Users/jss009/code/vrs-python/tests/extras/test_annotate_vcf.py'.                                        
Hint: make sure your test modules/packages have valid Python names.      
Traceback:                                                               
../../.local/share/uv/python/cpython-3.11.11-macos-aarch64-none/lib/python3.11/importlib/__init__.py:126: in import_module                        
    return _bootstrap._gcd_import(name[level:], package, level)          
tests/extras/test_annotate_vcf.py:12: in <module>                        
    from ga4gh.vrs.extras.annotator.vcf import VcfAnnotator, VcfAnnotatorError                                                                    
src/ga4gh/vrs/extras/annotator/vcf.py:17: in <module>                    
    from ga4gh.vrs.extras.translator import AlleleTranslator             
src/ga4gh/vrs/extras/translator.py:17: in <module>                       
    from ga4gh.vrs.utils.hgvs_tools import HgvsTools                     
src/ga4gh/vrs/utils/hgvs_tools.py:6: in <module>                         
    import hgvs                                                          
.venv/lib/python3.11/site-packages/hgvs/__init__.py:60: in <module>      
    import pkg_resources                                                 
E   ModuleNotFoundError: No module named 'pkg_resources'                 
_________________________________________ ERROR collecting tests/extras/test_cnv_translator.py __________________________________________         
ImportError while importing test module '/Users/jss009/code/vrs-python/tests/extras/test_cnv_translator.py'.                                      
Hint: make sure your test modules/packages have valid Python names.      
Traceback:                                                               
../../.local/share/uv/python/cpython-3.11.11-macos-aarch64-none/lib/python3.11/importlib/__init__.py:126: in import_module                        
    return _bootstrap._gcd_import(name[level:], package, level)          
tests/extras/test_cnv_translator.py:4: in <module>                                                                                                
    from ga4gh.vrs.extras.translator import CnvTranslator                
src/ga4gh/vrs/extras/translator.py:17: in <module>                       
    from ga4gh.vrs.utils.hgvs_tools import HgvsTools                     
src/ga4gh/vrs/utils/hgvs_tools.py:6: in <module>                         
    import hgvs                                                          
.venv/lib/python3.11/site-packages/hgvs/__init__.py:60: in <module>                                                                               
    import pkg_resources                                                 
E   ModuleNotFoundError: No module named 'pkg_resources'

It looks like the most proximal issue -- at least on my end -- is a needed fix in hgvs. Could you add a comment in pyproject.toml that this pin is temporary pending a fix there? Just want to make sure we have a sense of when we can unwind this in the future.

@jsstevenson
Copy link
Contributor

jsstevenson commented Apr 1, 2025

The other thing, which doesn't need to happen in this PR -- our CI/CD workflow installs setuptools upfront, which misses the proximal cause of this issue. I wonder if we should pull that step out so that we have more of a warning that this could be happening. @korikuzma

@david4096
Copy link
Member Author

@jsstevenson done

@david4096 david4096 requested a review from jsstevenson April 1, 2025 20:33
@korikuzma
Copy link
Contributor

Can we merge this?

@jsstevenson jsstevenson merged commit 27567b6 into ga4gh:main Apr 3, 2025
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.

3 participants