Repository: urllib3/urllib3

Issue:
urllib3 1.11 does not provide the extra 'secure'
I tried with Python 2.7 and 2.6 inside different virtualenv.

``` bash
pip install 'urllib3[secure]'
```



Discussion:
@sigmavirus24 maow?

Looks like the fancy-pants versioning doesn't always work. What version of setuptools is being used here?

I'm getting the same thing with pip 7.1 and setuptools 18.0.1: `urllib3 1.11 does not provide the extra 'secure'`

```
pip 7.1.0
setuptools 18.0.1
```

@Lukasa I agree with you, `requests` doesn't use the versioning and it is working fine
https://github.com/kennethreitz/requests/blob/master/setup.py#L71-L73

Let's put up the @dstufft signal!

✳️ 🚨✳️

@dethi did you try `urllib3[security]`? You're examples say `secure` which is not the name of the extra.

Ah nevermind. Looked at the wrong link. secure is right.

This appears to be a setuptools bug, the `pkg_resources.Distribution` and `pkg_resources.DistInfoDistribution` are saying that there is an extra named `secure_python_version_2.7_`. This is affecting both the sdist and it's been "baked" in to produce a broken wheel as well. It's also producing a wheel that thinks the extra name is `secure;python_version<="2.7"`.

So I would suggest either ditching the conditional extra stuff or contacting setuptools to see about making it work.

I figured it out. This is because I used `"` in the environment marker instead of `'`. >_<

Pull Request on the way

Or at least the wheel metadata is different. Still not able to do `pip install -e .[secure]`

After doing `python setup.py bdist_wheel` and unpacking the wheel, it looks like:

```
    "run_requires": [
        {
            "environment": "extra == \"secure; python_version<='2.7'\"",
            "requires": [
                "pyOpenSSL",
                "ndg-httpsclient",
                "pyasn1",
                "certifi"
            ]
        },
        {
            "environment": "extra == \"secure; python_version>'2.7'\"",
            "requires": [
                "certifi"
            ]
        }
    ],
```

Still isn't exactly correct in the `metadata.json` file in the wheel.

Any idea if this is fixable, or should we remove the extra tag?

Have you try like this?

```
extras_require={
          'secure': [
              'pyOpenSSL;python_version<="2.7"',
              'ndg-httpsclient;python_version<="2.7"',
              'pyasn1;python_version<="2.7"',
              'certifi',
          ],
      },
```

That does not work. Since this is a bug we will have to provide one extra that installs everything even when it's unnecessary.

On August 7, 2015 4:21:53 AM CDT, Thibault Deutsch notifications@github.com wrote:

> Have you try like this?
> 
> ```
> extras_require={
>          'secure': [
>              'pyOpenSSL;python_version<="2.7"',
>              'ndg-httpsclient;python_version<="2.7"',
>              'pyasn1;python_version<="2.7"',
>              'certifi',
>          ],
>      },
> ```
> 
> ---
> 
> Reply to this email directly or view it on GitHub:
> https://github.com/shazow/urllib3/issues/684#issuecomment-128650830

## 

Sent from my Android device with K-9 Mail. Please excuse my brevity.

@shazow alternative: What if we provide `urllib3[sni]` which we document as only for people using `urllib3` on Python 2.7.8 or lower. Then we provide another for certifi. I'm not sure what to name the second one though.


Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -55,14 +55,11 @@
       ],
       test_suite='test',
       extras_require={
-          'secure;python_version<="2.7"': [
+          'secure': [
               'pyOpenSSL',
               'ndg-httpsclient',
               'pyasn1',
               'certifi',
           ],
-          'secure;python_version>"2.7"': [
-              'certifi',
-          ],
       },
       )


Test patch: