tanghaibao / goatools

Python library to handle Gene Ontology (GO) terms
BSD 2-Clause "Simplified" License
745 stars 212 forks source link

setuptools required #298

Closed iosonofabio closed 1 month ago

iosonofabio commented 1 month ago

hi there,

thank you for maintaining this awesome package!

I just installed it in a clean Python 3.12 environment and although the installation did not raise any errors, the package could not be imported afterwards because of missing pkg_resources. The solution is to include setuptools in your list of requirements/dependencies at installation time.

Would be great if you could make the small change adding setuptools to the reqs so that people can enjoy goatools smoothly.

Thanks!

tanghaibao commented 1 month ago

@iosonofabio

Thanks for reporting this. What was the command you used to install the package?

Technically, this build dependency was already spelled out in the pyproject.toml: https://github.com/tanghaibao/goatools/blob/01144a31a173c357a6b0e18df805de03e32c031e/pyproject.toml#L1-L7

iosonofabio commented 1 month ago

Here the installation commands:

python -m venv .venv
.venv/bin/pip install goatools
.venv/bin/python -c 'import goatools'

results in:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/fabio/Desktop/tes/.venv/lib/python3.12/site-packages/goatools/__init__.py", line 2, in <module>
    from pkg_resources import get_distribution, DistributionNotFound
ModuleNotFoundError: No module named 'pkg_resources'

Indeed, when I run the pip install, it does not seem to install setuptools. Could it be that I have setuptools on my global python (1:69.0.3) and it's too old? No minimal version is speficied in pyproject.toml so perhaps that's what's going on?

tanghaibao commented 1 month ago

I think you are right. I am not sure what the minimum version should be. Is 1:69.0.3 the setuptools version on your computer? I have:

python -c "import setuptools; print(setuptools.__version__)"
57.5.0
iosonofabio commented 1 month ago
python -c "import setuptools; print(setuptools.__version__)"
69.0.3

... ah gotcha, see #299