AlexAplin / nndownload

Download and process links from Niconico (nicovideo.jp)
MIT License
223 stars 29 forks source link

`setup.py` version fetching causes extra dependencies in `pip install` #90

Closed myl7 closed 3 years ago

myl7 commented 3 years ago

Reproduction

$ pip install nndownload
...
ModuleNotFoundError: No module named 'aiohttp'
...

Or

$ git clone git@github.com:AlexAplin/nndownload.git && cd nndownload
$ pip install .
...
ModuleNotFoundError: No module named 'aiohttp'
...

Cause

In setup.py file, to fetch version:

main_ns = {}
ver_path = convert_path("nndownload/nndownload.py")
with open(ver_path, encoding="utf8") as ver_file:
    exec(ver_file.read(), main_ns)

It executes nndownload.py, which requires extra dependecies. However, setup.py is executed in installing phase, when it can not ensure any extra packages have been installed.

Suggestion

See #89