2 ms·
What does "requests[security]" do? I don't remember ever using the bracket syntax.
by smnrchrds 11y ago
What does "requests[security]" do? I don't remember ever using the bracket syntax.
- krallin 11y agoThis 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/46184236dc177fb68c7863445609149d0ac243ea/setup.py#L94-L96 https://github.com/kennethreitz/requests/blob/46184236dc177f...
- antonagestam 11y agoFrom 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.
- luhn 11y agoBrackets are used to install recommended dependencies. See http://pythonhosted.org/setuptools/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies 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-requestssecurity-vs-pip-install-requests-difference http://stackoverflow.com/questions/31811949/pip-install-requ...
- deleted 11y ago[deleted]
- amiraliakbari 11y agoPractically, it is used to prevent newer versions of pip from complaining about "insecure platform" and have cleaner CI build logs.