ó `8(Zc@sddlmZddlmZddljjZddlZddlZddl Z ddl Z ddl Z ddl Z ddlmZddlmZmZmZyddlmZWn$ek ràdd d„ƒYZnXd ejefd „ƒYZdd „Zd „ZdS(iÿÿÿÿ(tglob(t convert_pathN(tsix(tmaptfiltert filterfalse(t Mixin2to3RcBseZed„ZRS(cCsdS(s do nothingN((tselftfilestdoctests((s?/tmp/pip-build-0nEYGB/setuptools/setuptools/command/build_py.pytrun_2to3s(t__name__t __module__tTrueR (((s?/tmp/pip-build-0nEYGB/setuptools/setuptools/command/build_py.pyRstbuild_pycBs›eZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zd„Zed„ƒZRS(sXEnhanced 'build_py' command that includes data files with packages The data files are specified via a 'package_data' argument to 'setup()'. See 'setuptools.dist.Distribution' for more details. Also, this version of the 'build_py' command allows you to specify both 'py_modules' and 'packages' in the same setup operation. cCsftjj|ƒ|jj|_|jjp.i|_d|jkrP|jd=ng|_g|_dS(Nt data_files( torigRtfinalize_optionst distributiont package_datatexclude_package_datat__dict__t_build_py__updated_filest_build_py__doctests_2to3(R((s?/tmp/pip-build-0nEYGB/setuptools/setuptools/command/build_py.pyR!s    cCsª|j r|j rdS|jr.|jƒn|jrN|jƒ|jƒn|j|jtƒ|j|jtƒ|j|j tƒ|j t j j |ddƒƒdS(s?Build modules, packages, and copy data files to build directoryNtinclude_bytecodei(t py_modulestpackagest build_modulestbuild_packagestbuild_package_dataR RtFalseR Rt byte_compileRRt get_outputs(R((s?/tmp/pip-build-0nEYGB/setuptools/setuptools/command/build_py.pytrun+s     cCs5|dkr"|jƒ|_|jStjj||ƒS(slazily compute data filesR(t_get_data_filesRRRt __getattr__(Rtattr((s?/tmp/pip-build-0nEYGB/setuptools/setuptools/command/build_py.pyR#?s cCsqtjr-t|tjƒr-|jdƒ}ntjj||||ƒ\}}|rg|jj |ƒn||fS(Nt.( RtPY2t isinstancet string_typestsplitRRt build_moduleRtappend(Rtmodulet module_filetpackagetoutfiletcopied((s?/tmp/pip-build-0nEYGB/setuptools/setuptools/command/build_py.pyR*FscCs)|jƒtt|j|jp"dƒƒS(s?Generate list of '(package,src_dir,build_dir,filenames)' tuples((tanalyze_manifesttlistRt_get_pkg_data_filesR(R((s?/tmp/pip-build-0nEYGB/setuptools/setuptools/command/build_py.pyR"Ps cCsx|j|ƒ}tjj|jg|jdƒŒ}g|j||ƒD]}tjj||ƒ^qG}||||fS(NR%(tget_package_dirtostpathtjoint build_libR)tfind_data_filestrelpath(RR.tsrc_dirt build_dirtfilet filenames((s?/tmp/pip-build-0nEYGB/setuptools/setuptools/command/build_py.pyR3Us %1cCs‚|j|j||ƒ}tt|ƒ}tjj|ƒ}ttj j |ƒ}tj|j j |gƒ|ƒ}|j |||ƒS(s6Return filenames for package's data files in 'src_dir'(t_get_platform_patternsRRRt itertoolstchaint from_iterableRR5R6tisfiletmanifest_filestgettexclude_data_files(RR.R;tpatternstglobs_expandedt globs_matchest glob_filesR((s?/tmp/pip-build-0nEYGB/setuptools/setuptools/command/build_py.pyR9cs  c CsÍxÆ|jD]»\}}}}x¦|D]ž}tjj||ƒ}|jtjj|ƒƒtjj||ƒ}|j||ƒ\}} tjj|ƒ}| r#||jj kr#|j j |ƒq#q#Wq WdS(s$Copy data files into build directoryN( RR5R6R7tmkpathtdirnamet copy_filetabspathRtconvert_2to3_doctestsRR+( RR.R;R<R>tfilenamettargettsrcfiletoutfR0((s?/tmp/pip-build-0nEYGB/setuptools/setuptools/command/build_py.pyRts c Cs\i|_}|jjsdSi}x0|jp2dD]}||t|j|ƒƒÍsc3s!|]}|ˆkr|VqdS(N((R{tfn(tbad(s?/tmp/pip-build-0nEYGB/setuptools/setuptools/command/build_py.pys Ôs(R2R?RR@RARBtsett_unique_everseen(RR.R;RRGt match_groupstmatchestkeepers((R~Rs?/tmp/pip-build-0nEYGB/setuptools/setuptools/command/build_py.pyRFÄs       cs>tj|jdgƒ|j|gƒƒ}‡fd†|DƒS(sÜ yield platform-specific path patterns (suitable for glob or fn_match) from a glob-based spec (such as self.package_data or self.exclude_package_data) matching package in src_dir. tc3s*|] }tjjˆt|ƒƒVqdS(N(R5R6R7R(R{R|(R;(s?/tmp/pip-build-0nEYGB/setuptools/setuptools/command/build_py.pys és(R@RARE(tspecR.R;t raw_patterns((R;s?/tmp/pip-build-0nEYGB/setuptools/setuptools/command/build_py.pyR?Ûs  (R R t__doc__RR!R#R*R"R3R9RR1ReRjRwR4RFt staticmethodR?(((s?/tmp/pip-build-0nEYGB/setuptools/setuptools/command/build_py.pyRs            ccsŒtƒ}|j}|dkrMxgt|j|ƒD]}||ƒ|Vq1Wn;x8|D]0}||ƒ}||krT||ƒ|VqTqTWdS(sHList unique elements, preserving order. Remember all elements ever seen.N(RtaddRZRt __contains__(titerabletkeytseentseen_addtelementtk((s?/tmp/pip-build-0nEYGB/setuptools/setuptools/command/build_py.pyR€ïs         cCsOtjj|ƒs|Sddlm}tjdƒjƒ|}||ƒ‚dS(Niÿÿÿÿ(tDistutilsSetupErrorsÓ Error: setup script specifies an absolute path: %s setup() arguments must *always* be /-separated paths relative to the setup.py directory, *never* absolute paths. (R5R6tisabstdistutils.errorsR‘ttextwraptdedenttlstrip(R6R‘tmsg((s?/tmp/pip-build-0nEYGB/setuptools/setuptools/command/build_py.pyRVs ((Rtdistutils.utilRtdistutils.command.build_pytcommandRRR5RzR”RmR“RpR@tsetuptools.externRtsetuptools.extern.six.movesRRRtsetuptools.lib2to3_exRt ImportErrorRZR€RV(((s?/tmp/pip-build-0nEYGB/setuptools/setuptools/command/build_py.pyts"       Ø