HumanCellAtlas / dcp-cli

DEPRECATED - HCA Data Coordination Platform Command Line Interface
https://hca.readthedocs.io/
MIT License
6 stars 8 forks source link

Fix import dependencies. #482

Closed DailyDreaming closed 4 years ago

DailyDreaming commented 4 years ago

The CLI can't be installed via normal methods anymore since it's importing dependencies when fetching the version. This should fix: https://allspark.dev.data.humancellatlas.org/HumanCellAtlas/data-store/-/jobs/54102

DailyDreaming commented 4 years ago

@amarjandu It removes it. I realized that removing that import won't work and am fixing it now with a different solution.

DailyDreaming commented 4 years ago

@amarjandu Changed.

DailyDreaming commented 4 years ago

@amarjandu If you run setup.py (like we do in smoketest) before you install dependencies (setup.py is intended to be run before dependencies so this is unexpected) it will import __version__ from version.py which also imports __init__.py implicitly and pulls in the tqdm dependency.

This is why it's always good to have blank __init__.py files. I don't think it's a good idea to change now because this would create breaking changes (users could no call hca.get_config()) if we completely blanked __init__.py.

So the solution is either putting the tqdm import in the function or importing the version in a way that doesn't import hca.__init__.py (storing it somewhere else or hard-coding the version in setup.py rather than importing version.py). It was hard-coded before, which is why it didn't break.