~ibmcharmers/charms/xenial/ibm-cinder-storwize-svc/trunk

« back to all changes in this revision

Viewing changes to .tox/py35/lib/python3.5/site-packages/wheel/paths.py

  • Committer: Ankammarao
  • Date: 2017-03-06 05:11:42 UTC
  • Revision ID: achittet@in.ibm.com-20170306051142-dpg27z4es1k56hfn
Marked tests folder executable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""
 
2
Installation paths.
 
3
 
 
4
Map the .data/ subdirectory names to install paths.
 
5
"""
 
6
 
 
7
import os.path
 
8
import sys
 
9
import distutils.dist as dist
 
10
import distutils.command.install as install
 
11
 
 
12
def get_install_command(name):
 
13
    # late binding due to potential monkeypatching
 
14
    d = dist.Distribution({'name':name})
 
15
    i = install.install(d)
 
16
    i.finalize_options()
 
17
    return i
 
18
 
 
19
def get_install_paths(name):
 
20
    """
 
21
    Return the (distutils) install paths for the named dist.
 
22
    
 
23
    A dict with ('purelib', 'platlib', 'headers', 'scripts', 'data') keys.
 
24
    """
 
25
    paths = {}
 
26
 
 
27
    i = get_install_command(name)
 
28
 
 
29
    for key in install.SCHEME_KEYS:
 
30
        paths[key] = getattr(i, 'install_' + key)
 
31
 
 
32
    # pip uses a similar path as an alternative to the system's (read-only)
 
33
    # include directory:
 
34
    if hasattr(sys, 'real_prefix'):  # virtualenv
 
35
        paths['headers'] = os.path.join(sys.prefix,
 
36
                                        'include',
 
37
                                        'site',
 
38
                                        'python' + sys.version[:3],
 
39
                                        name)
 
40
 
 
41
    return paths