Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What does "requests[security]" do? I don't remember ever using the bracket syntax.


Brackets are used to install recommended dependencies. See http://pythonhosted.org/setuptools/setuptools.html#declaring...

In the case of requests[security], it installs some extra packages that allow for more secure SSL. http://stackoverflow.com/questions/31811949/pip-install-requ...


This means "install the `requests` package with the `security` extras.

In this particular case, this installs 'pyOpenSSL>=0.13', 'ndg-httpsclient', 'pyasn1'. See: https://github.com/kennethreitz/requests/blob/46184236dc177f...


From the docs: extras_require A dictionary mapping names of “extras” (optional features of your project) to strings or lists of strings specifying what other distributions must be installed to support those features. See the section below on Declaring Dependencies for details and examples of the format of this argument.


Practically, it is used to prevent newer versions of pip from complaining about "insecure platform" and have cleaner CI build logs.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: