pypa / flit

Simplified packaging of Python modules
https://flit.pypa.io/
BSD 3-Clause "New" or "Revised" License
2.14k stars 130 forks source link

Suggestion: Remove dependency on the requests lib #638

Closed taleinat closed 1 year ago

taleinat commented 1 year ago

As far as I can tell, requests is only used in one place, to make a simple HTTP GET request: https://github.com/pypa/flit/blob/ec6e6b7c8994d5e79d0fd951d9e4c26a7c5d9977/flit/validate.py#L55-L57

I suggest replacing that with slightly more complex code using urllib.request(), to remove the dependency (and its sub-dependencies).

takluyver commented 1 year ago

Is there a particular issue with the dependency? For flit_core I try to minimise dependencies because it's needed for bootstrapping a lot of the packaging ecosystem, but the flit command line tool is a normal package, and can have dependencies. requests is a very common package that lots of Python software uses.

Requests is also used in the upload module.

taleinat commented 1 year ago

There is no particular issue, just seemed like flit should minimize dependencies. I didn't well enough understand the separation of flit_core, and that does make sense.

Since requests also used for a non-trivial POST request in the upload module, it's probably a good call to continue using requests here.

Thanks for the clarification!