File: //lib/python2.7/site-packages/setuptools/build_meta.pyc
ó
Àfc @ sö d Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d e f d „ ƒ YZ d e j
j f d „ ƒ YZ d d „ Z d „ Z
d
„ Z d „ Z d d „ Z d d
„ Z d d „ Z d d d „ Z d d „ Z d S( s- A PEP 517 interface to setuptools
Previously, when a user or a command line tool (let's call it a "frontend")
needed to make a request of setuptools to take a certain action, for
example, generating a list of installation requirements, the frontend would
would call "setup.py egg_info" or "setup.py bdist_wheel" on the command line.
PEP 517 defines a different method of interfacing with setuptools. Rather
than calling "setup.py" directly, the frontend should:
1. Set the current directory to the directory with a setup.py file
2. Import this module into a safe python interpreter (one in which
setuptools can potentially set global variables or crash hard).
3. Call one of the functions defined in PEP 517.
What each function does is defined in PEP 517. However, here is a "casual"
definition of the functions (this definition should not be relied on for
bug reports or API stability):
- `build_wheel`: build a wheel in the folder and return the basename
- `get_requires_for_build_wheel`: get the `setup_requires` to build
- `prepare_metadata_for_build_wheel`: get the `install_requires`
- `build_sdist`: build an sdist in the folder and return the basename
- `get_requires_for_build_sdist`: get the `setup_requires` to build
Again, this is not a formal definition! Just a "taste" of the module.
iÿÿÿÿNt SetupRequirementsErrorc B s e Z d „ Z RS( c C s
| | _ d S( N( t
specifiers( t selfR ( ( s9 /usr/lib/python2.7/site-packages/setuptools/build_meta.pyt __init__( s ( t __name__t
__module__R ( ( ( s9 /usr/lib/python2.7/site-packages/setuptools/build_meta.pyR ' s t Distributionc B s) e Z d „ Z e e j d „ ƒ ƒ Z RS( c C s t | ƒ ‚ d S( N( R ( R R ( ( s9 /usr/lib/python2.7/site-packages/setuptools/build_meta.pyt fetch_build_eggs- s c c s5 t j j } | t j _ z d VWd | t j _ Xd S( sw
Replace
distutils.dist.Distribution with this class
for the duration of this context.
N( t distutilst coreR ( t clst orig( ( s9 /usr/lib/python2.7/site-packages/setuptools/build_meta.pyt patch0 s
( R R R t classmethodt
contextlibt contextmanagerR ( ( ( s9 /usr/lib/python2.7/site-packages/setuptools/build_meta.pyR , s s setup.pyc B sa | } d } e e d e ƒ | ƒ } | j ƒ j d d ƒ } | j ƒ e | | d ƒ e ƒ Ud S( Nt __main__t opens \r\ns \nt exec( t getattrt tokenizeR t readt replacet closet compilet locals( t setup_scriptt __file__R t ft code( ( s9 /usr/lib/python2.7/site-packages/setuptools/build_meta.pyt
_run_setup@ s
c C s | p i } | j d g ƒ | S( Ns --global-option( t
setdefault( t config_settings( ( s9 /usr/lib/python2.7/site-packages/setuptools/build_meta.pyt _fix_configK s c C s| t | ƒ } d d g } t j d d g | d t _ y t j ƒ t ƒ Wd QXWn t k
rw } | | j 7} n X| S( Nt
setuptoolst wheeli t egg_infos --global-option( R! t syst argvR R R R R ( R t requirementst e( ( s9 /usr/lib/python2.7/site-packages/setuptools/build_meta.pyt _get_build_requiresQ s
c C sA g t j | ƒ D]- } t j j t j j | | ƒ ƒ r | ^ q S( N( t ost listdirt patht isdirt join( t a_dirt name( ( s9 /usr/lib/python2.7/site-packages/setuptools/build_meta.pyt _get_immediate_subdirectories` s c C s t | ƒ } t | ƒ S( N( R! R) ( R ( ( s9 /usr/lib/python2.7/site-packages/setuptools/build_meta.pyt get_requires_for_build_wheele s c C s t | ƒ } t | ƒ S( N( R! R) ( R ( ( s9 /usr/lib/python2.7/site-packages/setuptools/build_meta.pyt get_requires_for_build_sdistj s c C s t j d d d | g t _ t ƒ | } x¦ t rÒ g t j | ƒ D] } | j d ƒ rC | ^ qC } t | ƒ d k r¶ t t | ƒ ƒ d k r¶ t j j
| t j | ƒ d ƒ } q- n t | ƒ d k sÎ t ‚ Pq- W| | k rt j
t j j
| | d ƒ | ƒ t j | d t ƒn | d S( Ni t dist_infos
--egg-bases
.dist-infoi t
ignore_errors( R% R&