Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There are too many dependencies to install, it's easy to get stuck with a big tail. #4462

Open
allrobot opened this issue May 12, 2024 · 6 comments
Assignees
Labels
question Further information is requested

Comments

@allrobot
Copy link

As a third-party library, it is not recommended to have too many dependencies. If possible, try to use Python's built-in libraries to enhance robustness.

Writing a tool with a download function like this can reduce the size of the program and improve compatibility with other third-party libraries. Some third-party libraries may require specific versions of dependency packages, which can make maintenance inconvenient if dependency conflicts arise.

@allrobot allrobot added the question Further information is requested label May 12, 2024
@GammaC0de
Copy link
Member

If you are referring to pycurl then look at this: https://github.com/svanoort/python-client-benchmarks?tab=readme-ov-file#short-summary-of-results

@allrobot
Copy link
Author

If you are referring to pycurl then look at this: https://github.com/svanoort/python-client-benchmarks?tab=readme-ov-file#short-summary-of-results

many dependencies Downloading https://pypi.tuna.tsinghua.edu.cn/packages/22/de/4157a7695e2e1c8e58999d0a492730e7356a7d56e3be374cdb22c99053c6/pyload_ng-0.5.0b3.dev85-py3-none-any.whl (1.6 MB) ---------------------------------------- 1.6/1.6 MB 6.9 MB/s eta 0:00:00 Collecting Cheroot~=8.4 (from pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d3/87/8c5a471a82dfd1c82b4cb6605fcad90e1f0e938b14c0516da3504701a2b4/cheroot-8.6.0-py2.py3-none-any.whl (104 kB) ---------------------------------------- 104.7/104.7 kB ? eta 0:00:00 Collecting Flask (from pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/61/80/ffe1da13ad9300f87c93af113edd0638c75138c42a0994becfacac078c06/flask-3.0.3-py3-none-any.whl (101 kB) ---------------------------------------- 101.7/101.7 kB ? eta 0:00:00 Collecting Flask-Babel~=1.0 (from pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/76/a4/0115c7c520125853037fc1d6b3da132a526949640e27a699a13e05ec7593/Flask_Babel-1.0.0-py3-none-any.whl (9.5 kB) Collecting Flask-Caching~=1.9 (from pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/7c/71/c0e8279de363b193c3538e9cee772fd50c671c9c98e76f21ebb378b5a734/Flask_Caching-1.11.1-py3-none-any.whl (29 kB) Collecting Flask-Compress~=1.8 (from pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/27/c8/1efd52b8f6b6b9372515c1b33c5609d9188c4326ad7fa28f2663601eb2ae/Flask_Compress-1.15-py3-none-any.whl (8.6 kB) Collecting Flask-Themes2~=1.0 (from pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/a9/51/5cbc31456eb182d507476331c66ddf866eea412baa2ea527991bd008c2eb/Flask-Themes2-1.0.1.tar.gz (12 kB) Preparing metadata (setup.py) ... done Collecting bitmath~=1.3 (from pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ec/ec/808245570e00df2e1fe8252903da309f18eb58768f44fecc0215dafbc386/bitmath-1.3.3.1.tar.gz (88 kB) ---------------------------------------- 88.5/88.5 kB ? eta 0:00:00 Preparing metadata (setup.py) ... done Collecting filetype~=1.0 (from pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/18/79/1b8fa1bb3568781e84c9200f951c735f3f157429f44be0495da55894d620/filetype-1.2.0-py2.py3-none-any.whl (19 kB) Collecting pycurl~=7.43 (from pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/6f/55/691f9f025017b9c7efe2bd0b3e3a9eeb9bcb38ddc58a63b132e574742860/pycurl-7.45.3-cp311-cp311-win_amd64.whl (475 kB) ---------------------------------------- 475.6/475.6 kB 9.9 MB/s eta 0:00:00 Requirement already satisfied: certifi in c:\programdata\anaconda3\envs\python311\lib\site-packages (from pyload-ng[all]) (2024.2.2) Collecting semver~=2.10 (from pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/0b/70/b84f9944a03964a88031ef6ac219b6c91e8ba2f373362329d8770ef36f02/semver-2.13.0-py2.py3-none-any.whl (12 kB) Requirement already satisfied: setuptools>=38.3 in c:\programdata\anaconda3\envs\python311\lib\site-packages (from pyload-ng[all]) (68.2.2) Requirement already satisfied: cryptography>=35.0.0 in c:\programdata\anaconda3\envs\python311\lib\site-packages (from pyload-ng[all]) (42.0.7) Collecting Js2Py~=0.7 (from pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/88/58/2feb430d47c9f18f331494b429697342722b51f28dad8ad92a511c0f6fc8/Js2Py-0.74-py3-none-any.whl (1.0 MB) ---------------------------------------- 1.0/1.0 MB 11.0 MB/s eta 0:00:00 Collecting Flask-Session (from pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/67/1b/f085ceebb825d1cfaf078852b67cd248a33af2905f40ba9860cc006d966b/flask_session-0.8.0-py3-none-any.whl (24 kB) Requirement already satisfied: beautifulsoup4 in c:\programdata\anaconda3\envs\python311\lib\site-packages (from pyload-ng[all]) (4.12.2) Collecting colorlog (from pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/f3/18/3e867ab37a24fdf073c1617b9c7830e06ec270b1ea4694a624038fc40a03/colorlog-6.8.2-py3-none-any.whl (11 kB) Requirement already satisfied: Pillow in c:\programdata\anaconda3\envs\python311\lib\site-packages (from pyload-ng[all]) (10.2.0) Collecting pyOpenSSL (from pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/54/a7/2104f674a5a6845b04c8ff01659becc6b8978ca410b82b94287e0b1e018b/pyOpenSSL-24.1.0-py3-none-any.whl (56 kB) ---------------------------------------- 56.9/56.9 kB ? eta 0:00:00 Collecting slixmpp (from pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d7/fa/90ab79fd2fffcee8558cd8daa69543486d3f89b25b84890011ff1a6b378f/slixmpp-1.8.5.tar.gz (574 kB) ---------------------------------------- 574.6/574.6 kB 17.6 MB/s eta 0:00:00 Preparing metadata (setup.py) ... done Requirement already satisfied: Send2Trash in c:\programdata\anaconda3\envs\python311\lib\site-packages (from pyload-ng[all]) (1.8.3) Collecting Babel (from pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/27/45/377f7e32a5c93d94cd56542349b34efab5ca3f9e2fd5a68c5e93169aa32d/Babel-2.15.0-py3-none-any.whl (9.6 MB) ---------------------------------------- 9.6/9.6 MB 11.6 MB/s eta 0:00:00 Requirement already satisfied: Jinja2 in c:\programdata\anaconda3\envs\python311\lib\site-packages (from pyload-ng[all]) (3.1.4) Requirement already satisfied: six>=1.11.0 in c:\programdata\anaconda3\envs\python311\lib\site-packages (from Cheroot~=8.4->pyload-ng[all]) (1.16.0) Requirement already satisfied: jaraco.functools in c:\programdata\anaconda3\envs\python311\lib\site-packages (from Cheroot~=8.4->pyload-ng[all]) (4.0.1) Requirement already satisfied: more-itertools>=2.6 in c:\programdata\anaconda3\envs\python311\lib\site-packages (from Cheroot~=8.4->pyload-ng[all]) (10.2.0) Requirement already satisfied: cffi>=1.12 in c:\programdata\anaconda3\envs\python311\lib\site-packages (from cryptography>=35.0.0->pyload-ng[all]) (1.16.0) Requirement already satisfied: pytz in c:\programdata\anaconda3\envs\python311\lib\site-packages (from Flask-Babel~=1.0->pyload-ng[all]) (2024.1) Collecting cachelib (from Flask-Caching~=1.9->pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/9b/42/960fc9896ddeb301716fdd554bab7941c35fb90a1dc7260b77df3366f87f/cachelib-0.13.0-py3-none-any.whl (20 kB) Requirement already satisfied: brotli in c:\programdata\anaconda3\envs\python311\lib\site-packages (from Flask-Compress~=1.8->pyload-ng[all]) (1.1.0) Collecting zstandard (from Flask-Compress~=1.8->pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/8a/bc/878a5b8f413d5fe902842fde08ecf317d3979c9728135034a519c409ce3f/zstandard-0.22.0-cp311-cp311-win_amd64.whl (511 kB) ---------------------------------------- 511.6/511.6 kB 16.2 MB/s eta 0:00:00 Collecting Werkzeug>=3.0.0 (from Flask->pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/9d/6e/e792999e816d19d7fcbfa94c730936750036d65656a76a5a688b57a656c4/werkzeug-3.0.3-py3-none-any.whl (227 kB) ---------------------------------------- 227.3/227.3 kB 13.6 MB/s eta 0:00:00 Collecting itsdangerous>=2.1.2 (from Flask->pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/04/96/92447566d16df59b2a776c0fb82dbc4d9e07cd95062562af01e408583fc4/itsdangerous-2.2.0-py3-none-any.whl (16 kB) Requirement already satisfied: click>=8.1.3 in c:\programdata\anaconda3\envs\python311\lib\site-packages (from Flask->pyload-ng[all]) (8.1.7) Collecting blinker>=1.6.2 (from Flask->pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/bb/2a/10164ed1f31196a2f7f3799368a821765c62851ead0e630ab52b8e14b4d0/blinker-1.8.2-py3-none-any.whl (9.5 kB) Requirement already satisfied: MarkupSafe>=2.0 in c:\programdata\anaconda3\envs\python311\lib\site-packages (from Jinja2->pyload-ng[all]) (2.1.5) Collecting tzlocal>=1.2 (from Js2Py~=0.7->pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/97/3f/c4c51c55ff8487f2e6d0e618dba917e3c3ee2caae6cf0fbb59c9b1876f2e/tzlocal-5.2-py3-none-any.whl (17 kB) Collecting pyjsparser>=2.5.1 (from Js2Py~=0.7->pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/48/ef/c72abcfa2c6accd03e7c89c400790fc3d908c5804d50a7c4e9ceabd74d23/pyjsparser-2.7.1.tar.gz (24 kB) Preparing metadata (setup.py) ... done Requirement already satisfied: soupsieve>1.2 in c:\programdata\anaconda3\envs\python311\lib\site-packages (from beautifulsoup4->pyload-ng[all]) (2.5) Requirement already satisfied: colorama in c:\programdata\anaconda3\envs\python311\lib\site-packages (from colorlog->pyload-ng[all]) (0.4.6) Collecting msgspec>=0.18.6 (from Flask-Session->pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/51/c6/0a8ae23c91ba1e6d58ddb089bba4ce8dad5815411b4a2bb40a5f15d2ab73/msgspec-0.18.6-cp311-cp311-win_amd64.whl (185 kB) ---------------------------------------- 185.9/185.9 kB ? eta 0:00:00 Requirement already satisfied: aiodns>=1.0 in c:\programdata\anaconda3\envs\python311\lib\site-packages (from slixmpp->pyload-ng[all]) (3.2.0) Collecting pyasn1 (from slixmpp->pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/23/7e/5f50d07d5e70a2addbccd90ac2950f81d1edd0783630651d9268d7f1db49/pyasn1-0.6.0-py2.py3-none-any.whl (85 kB) ---------------------------------------- 85.3/85.3 kB 4.7 MB/s eta 0:00:00 Collecting pyasn1_modules (from slixmpp->pyload-ng[all]) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/13/68/8906226b15ef38e71dc926c321d2fe99de8048e9098b5dfd38343011c886/pyasn1_modules-0.4.0-py3-none-any.whl (181 kB) ---------------------------------------- 181.2/181.2 kB 10.7 MB/s eta 0:00:00 Requirement already satisfied: pycares>=4.0.0 in c:\programdata\anaconda3\envs\python311\lib\site-packages (from aiodns>=1.0->slixmpp->pyload-ng[all]) (4.4.0) Requirement already satisfied: pycparser in c:\programdata\anaconda3\envs\python311\lib\site-packages (from cffi>=1.12->cryptography>=35.0.0->pyload-ng[all]) (2.22) Requirement already satisfied: tzdata in c:\programdata\anaconda3\envs\python311\lib\site-packages (from tzlocal>=1.2->Js2Py~=0.7->pyload-ng[all]) (2024.1) Building wheels for collected packages: bitmath, Flask-Themes2, slixmpp, pyjsparser Building wheel for bitmath (setup.py) ... done Created wheel for bitmath: filename=bitmath-1.3.3.1-py3-none-any.whl size=24037 sha256=d971286a48de38172a18cf5b904437db084bd3bb21e82e9b513894d324ad392d Stored in directory: c:\users\administrator\appdata\local\pip\cache\wheels\65\dc\70\277689b66a9d16534453567e1d0e9dcc66d425ce12242268b3 Building wheel for Flask-Themes2 (setup.py) ... done Created wheel for Flask-Themes2: filename=Flask_Themes2-1.0.1-py3-none-any.whl size=8121 sha256=dc8513cf91f938310910026eba24c67d8e4125b383aca3dde20b16ce59eb5224 Stored in directory: c:\users\administrator\appdata\local\pip\cache\wheels\9b\ad\e4\4b71fbcef2b21c21ec1987e645ff949fa0fcbd1c90d8ca4f21 Building wheel for slixmpp (setup.py) ... done Created wheel for slixmpp: filename=slixmpp-1.8.5-py3-none-any.whl size=511645 sha256=6effa6284651b30de122df10b541d31d6d9ee96b4aac6d15fe2236cd326fc23c Stored in directory: c:\users\administrator\appdata\local\pip\cache\wheels\2f\03\af\4722edc630b826a76c6118e2fd7960f4a6eff3b108ce5a2ec4 Building wheel for pyjsparser (setup.py) ... done Created wheel for pyjsparser: filename=pyjsparser-2.7.1-py3-none-any.whl size=25988 sha256=e43555ade55919817317adac724200ef0db0e857b216027dbe30fc303f307c15 Stored in directory: c:\users\administrator\appdata\local\pip\cache\wheels\4b\0f\97\3303e16487db27cc331cdd10180797ceb70cba41dbbfc7ed48 Successfully built bitmath Flask-Themes2 slixmpp pyjsparser Installing collected packages: pyjsparser, filetype, bitmath, zstandard, Werkzeug, tzlocal, semver, pycurl, pyasn1, msgspec, itsdangerous, colorlog, cachelib, blinker, Babel, pyasn1_modules, Js2Py, Flask, Cheroot, pyOpenSSL, Flask-Themes2, Flask-Session, Flask-Compress, Flask-Caching, Flask-Babel, slixmpp, pyload-ng Successfully installed Babel-2.15.0 Cheroot-8.6.0 Flask-3.0.3 Flask-Babel-1.0.0 Flask-Caching-1.11.1 Flask-Compress-1.15 Flask-Session-0.8.0 Flask-Themes2-1.0.1 Js2Py-0.74 Werkzeug-3.0.3 bitmath-1.3.3.1 blinker-1.8.2 cachelib-0.13.0 colorlog-6.8.2 filetype-1.2.0 itsdangerous-2.2.0 msgspec-0.18.6 pyOpenSSL-24.1.0 pyasn1-0.6.0 pyasn1_modules-0.4.0 pycurl-7.45.3 pyjsparser-2.7.1 pyload-ng-0.5.0b3.dev85 semver-2.13.0 slixmpp-1.8.5 tzlocal-5.2 zstandard-0.22.0

example: flask,semver,bitmath etc...

I see it from a personal maintenance perspective, the less dependencies the better, as it makes it easier to locate the source of errors.

If pyload is not considering reducing dependencies, the issue can be closed.

@vuolter
Copy link
Contributor

vuolter commented May 13, 2024

Generally speaking we could (and we should) reduce 3rd-party libs, especially on flask side. Code maintainabiliy suffers also due inner dependencies as you can see, that's true, so why we've chosen this way? Simple: time. We use well-know libs to deliver features we can't maintain at the moment, it's a compromise, but we can improve. Let's keep open this issue or move to a discussion to find out what we can do to mitigate this problem (as @GammaC0de said, removing things like pycurl, right now, is very unlikely to be done).

@7x11x13
Copy link

7x11x13 commented May 20, 2024

It would be nice if there was some way to install this package without Flask etc. (and make these dependencies optional). IMO the whole web interface part of this project should be an optional addon. The library should not come with a UI by default so people can use it in other Python projects without needing to install so many dependencies.

I made this (very hacky) project https://github.com/7x11x13/ez-pyload which disables the Flask server and is still able to download files, however since it depends on pyLoad a bunch of unnecessary dependencies are also downloaded when it is installed. I wish pyLoad came with this functionality by default so my project would not be necessary.

@vuolter
Copy link
Contributor

vuolter commented May 22, 2024

It would be nice if there was some way to install this package without Flask etc. (and make these dependencies optional).

We tried in the past (https://github.com/pyload/pyload-webui), but it didn't go so well: people kept opening issues in the main repo and the code was even more fragmented... maybe we could try it now with a monorepo (or just adding a flag to exclude webui as an install option, idk).

@7x11x13
Copy link

7x11x13 commented May 22, 2024

Maybe release a separate package (e.g. "pyload-core") which pyload-ng depends on? Then "normal" users wouldn't accidentally download the non-GUI version and developers would be able to use that library in their projects. I think a monorepo would make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Development

No branches or pull requests

4 participants