pachterlab / kb_python

A wrapper for the kallisto | bustools workflow for single-cell RNA-seq pre-processing
https://www.kallistobus.tools/
BSD 2-Clause "Simplified" License
141 stars 24 forks source link

requirements.txt says pandas>1.0.0 but breaks on pandas 2 #204

Closed yfarjoun closed 12 months ago

yfarjoun commented 1 year ago

Describe the issue A clear and concise description of what the issue is.

in pandas 2.* the index module has been moved to an upper level (from pandas.core.index to pandas.index) and thus, when installing kb-python with the provided requirements.txt one gets an error that there isn't a module pandas.core.index

I'm happy to fix this in one of two ways:

  1. fix the requirements file to state that pandas must be <2.0.0
  2. fix the requirements file to >2.0.0 and fix the imports.

Thoughts?

What is the exact command that was run?

kb 

Command output (with --verbose flag)

 Traceback (most recent call last):
  File "/Users/farjoun/Library/*****/bin/kb", line 7, in <module>
    from kb_python.main import main
  File "/Users/farjoun/Library/*****/lib/python3.10/site-packages/kb_python/main.py", line 26, in <module>
    from .compile import compile
  File "/Users/farjoun/Library/*****/lib/python3.10/site-packages/kb_python/compile.py", line 19, in <module>
    from .utils import download_file, restore_cwd, run_executable
  File "/Users/farjoun/Library/*****/lib/python3.10/site-packages/kb_python/utils.py", line 13, in <module>
    import anndata
  File "/Users/farjoun/Library/*****/lib/python3.10/site-packages/anndata/__init__.py", line 1, in <module>
    from .core.anndata import AnnData, Raw
  File "/Users/farjoun/Library/*****/lib/python3.10/site-packages/anndata/core/anndata.py", line 17, in <module>
    from pandas.core.index import RangeIndex
ModuleNotFoundError: No module named 'pandas.core.index'
yfarjoun commented 1 year ago

sorry for closing, I got confused.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

Yenaled commented 1 year ago

The new version of kb-python is ready to be released. I'm admittedly still undecided of how to deal with this issue.

yfarjoun commented 12 months ago

can I help?

what are you undecided about?

Yenaled commented 12 months ago

I'm undecided whether to require <2.0.0 or >2.0.0. I'm inclined to make it <2.0.0 since that's most python users use but let me know if you think otherwise.

Yenaled commented 12 months ago

In any case, if you think making it <2.0.0 is acceptable, feel free to make a PR in devel branch and I'll merge it into 0.28.0 (the forthcoming release which I haven't officially released yet). Otherwise, I can do it myself.

Yenaled commented 12 months ago

thanks for the pull request; merged into devel branch (which will be updated to master this month).