huangnengCSU / compleasm

A genome completeness evaluation tool based on miniprot
Apache License 2.0
178 stars 18 forks source link

incorrect packaging in `setup.py` #41

Open boegel opened 4 days ago

boegel commented 4 days ago

It seems like the setup.py is not done correctly, it results in a broken installation when using python setup.py install or pip install . (at least when using Python 3.11):

Although the installation itself works, using the installation doesn't: running compleasm run -h results in an error like:

Traceback (most recent call last):
  File "/software/compleasm/0.2.6-foss-2023a/bin/compleasm", line 5, in <module>
    from compleasm import main
  File "/software/compleasm/0.2.6-foss-2023a/bin/compleasm.py", line 5, in <module>
    from compleasm import main
ImportError: cannot import name 'main' from partially initialized module 'compleasm' (most likely due to a circular import) (/software/compleasm/0.2.6-foss-2023a/bin/compleasm.py)

The problem here is that compleasm.py imports from the compleasm namespace, which fails because the import is being done from the compleasm.py script (and not from the compleasm Python package that gets installed in /software/compleasm/0.2.6-foss-2023a/lib/python3.11/site-packages).

huangnengCSU commented 3 days ago

Hi @boegel,

Compleasm does not require installation via setup.py. It is just a script that you can copy to any directory you want to run. But in this way, you have to make sure that miniprot, hmmer and sepp already be installed. You can follow Manual Installation in README. Another way to install compleasm and its dependencies is installing by conda via mamba create --name myenvname compleasm or conda create -n <your_env_name> -c conda-forge -c bioconda compleasm