kivy / kivy-ios

Toolchain for compiling Python / Kivy / other libraries for iOS
https://kivy.org/docs/guide/packaging-ios.html
MIT License
758 stars 237 forks source link

Remove Unused Dependency: `requests` #840

Closed gdrosos closed 10 months ago

gdrosos commented 10 months ago

Summary

This pull request removes the unused dependency requests from the setup.cfg and requirements.txt configuration files as well as from thepython_depends list within the KivyRecipe class. The detection and removal of this dependency is a finding from ongoing research aimed at identifying and eliminating code bloat within software projects.

Rationale

The requests dependency was initially introduced in this pull request to support Python 2. However, the related Python 2 logic was removed in this pull request, rendering the dependency unnecessary. Despite its removal from the source code, requests remained listed as a requirement in the project's dependency files. By eliminating this unused dependency, the overall footprint of the application is reduced, mitigating potential security risks and simplifying the dependency management process.

Changes

Impact

gdrosos commented 10 months ago

Hi @gdrosos !

It actually makes sense to remove requests from setup.cfg and requirements.txt, but absolutely not from KivyRecipe, as requests is required by kivy during execution.

Can you fix it accordingly?

Hi @misl6, thanks for the response!

I reverted the commit modifying the KivyRecipe. Therefore, now the requests requirement is removed only from the setup.cfg and requirements.txt configuration files.

NomadDemon commented 10 months ago

Requests is required for new implementation of netrorking layer. Its not default yet, it have to be explicitly enabled in config.

It is more testable than old networking, and more reliable. Dunno when it will be default.

NomadDemon commented 10 months ago

I just read rationale, its not 100% than. One year ago i rewrote networking to requests to make it able to run tests in proper way (requests is mockable easy way, urllib tests was using real network and real pings to outside servers. Not cool), and handle more stuff. Requests should not be removed imho.

misl6 commented 10 months ago

Hi @NomadDemon !

This is kivy/kivy-ios repo, not kivy/kivy, requests can be safely removed from setup.cfg and requirements.txt, but not from KivyRecipe python_depends, as I suggested (as otherwise it will break your implementation)

NomadDemon commented 10 months ago

Ah my bad. Using discord and github on phone is not good idea :p (didnt saw url) ok, false alarm :)