feat: make pysam an optional dependency #270
Conversation
Users can now install fgpyo without pysam for pure Python utilities: - `pip install fgpyo` - core only - `pip install fgpyo[pysam]` - full functionality Modules that require pysam provide clear error messages guiding users to install the pysam extra.
|
pysam is a lot easier to install these days and is also load-bearing for some important features of fgpyo. I'm 50/50 on if this is still a good idea. |
|
Hey! Noticed this covers the same ground as #238. Were there things about the approach in #238 you wanted to go a different direction on? I'd love to understand your thinking here. Also curious whether it makes sense to consolidate efforts on one PR so we're not duplicating work. Happy to fold anything useful from #238 into this one, or vice versa, just let me know how you'd like to handle it. |
|
Going to close #238 in favor of this approach, pending Clint's question on whether this is still worth doing. If it does move forward, a few things I picked up while working through it on my end:
Happy to open small PRs against this branch with any of these if that's helpful. |
Makes pysam an optional dependency so users who only need pure Python utilities can avoid the heavyweight pysam install.
pip install fgpyo— core modules only (sequence, read_structure, collections, io, util)pip install fgpyo[pysam]— full functionality (sam, vcf, fastx, fasta)Modules that require pysam will raise a clear error message:
ImportError: Missing optional dependency 'pysam'. The sam, vcf, fastx, and fasta modules require pysam. Install with:
pip install fgpyo[pysam]Packaging notes:*
pip install .[pysam]so users get full functionality by default