andim / pyrepseq

Python library for immune repertoire analysis
MIT License
15 stars 4 forks source link

setuptools is somehow a hidden dependency? #19

Closed yutanagano closed 7 months ago

yutanagano commented 7 months ago

I just tried to install pyrepseq in a fresh new python environment, and it all installed without a hitch, except for that when I first tried to import pyrepseq in a python interpreter somehow a line of code was run which attempts to import from setuptools, and it complained that I didn't have setuptools installed.

This is currently a hidden dependency- it is not listed as a dependency yet it is run because of line 1 in version.py, according to my error stack.

>>> import pyrepseq
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/yutanagano/.test/lib64/python3.12/site-packages/pyrepseq/__init__.py", line 6, in <module>
    from .version import __version__
  File "/home/yutanagano/.test/lib64/python3.12/site-packages/pyrepseq/version.py", line 1, in <module>
    from setuptools import find_packages
ModuleNotFoundError: No module named 'setuptools'

I haven't fully looked into why version.py is run and what it's supposed to be doing, but we either:

  1. Add setuptools as a dependency
  2. Decide we don't want/need to depend on it and make sure version.py is either not run at import or runs different code
andim commented 7 months ago

Setuptools is used to automatically find all subpackages of the module as described here: https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#packages

We could I suppose move that code up to setup.py to remove the dependency?

andim commented 7 months ago

Solution attempt just pushed in db8c075. Can you test whether this solves it for you? If so I will close this issue - thanks!

yutanagano commented 7 months ago

Yup, the issue is now fixed for me.