pypa/flit

Suggestion: Remove dependency on the requests lib

taleinat opened this issue · 2 comments

As far as I can tell, requests is only used in one place, to make a simple HTTP GET request:

flit/flit/validate.py

Lines 55 to 57 in ec6e6b7

resp = requests.get(
'https://pypi.org/pypi?%3Aaction=list_classifiers')
resp.raise_for_status()

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

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.

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!