Template
1
0
mirror of https://github.com/aminya/setup-cpp synced 2024-11-30 21:22:30 +08:00
setup-cpp/dist/node12/actions_python.e3292b54.js

3 lines
1.5 MiB
JavaScript
Raw Normal View History

2023-01-15 17:37:02 +08:00
function e(e){return e&&e.__esModule?e.default:e}function a(e,a,t,i){Object.defineProperty(e,a,{get:t,set:i,enumerable:!0,configurable:!0})}var t=require("path"),i=require("os"),o=require("fs"),s=require("util"),r=require("assert"),n=require("crypto"),p=require("url"),d=require("buffer"),l=require("stream"),m=require("events"),c=require("timers"),u=require("string_decoder"),h=require("http"),g=require("https"),f=require("punycode"),y=require("zlib"),b=require("child_process"),v="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},x=v.parcelRequire810d;x.register("apy8x",((i,o)=>{async function s(a,t,i){var o;c.IS_MAC&&(process.env.AGENT_TOOLSDIRECTORY="/Users/runner/hostedtoolcache");const s=null===(o=process.env.AGENT_TOOLSDIRECTORY)||void 0===o?void 0:o.trim();if("string"==typeof s&&""!==s&&(process.env.RUNNER_TOOL_CACHE=process.env.AGENT_TOOLSDIRECTORY),(0,d.debug)("Python is expected to be installed into "+process.env.RUNNER_TOOL_CACHE),a){let e;if(a.startsWith("pypy")){const t=await(0,n.findPyPyVersion)(a,i,!0,!1);e=`${t.resolvedPyPyVersion}-${t.resolvedPythonVersion}`,(0,p.info)(`Successfully set up PyPy ${t.resolvedPyPyVersion} with Python (${t.resolvedPythonVersion})`)}else{const t=await(0,r.useCpythonVersion)(a,i,!0,!1);e=t.version,(0,p.info)(`Successfully set up ${t.impl} (${e})`)}if((0,c.isCacheFeatureAvailable)()){const a="pip";await(async(e,a)=>{const t=(0,u.getCacheDistributor)(e,a,void 0);await t.restoreCache()})(a,e)}}"github-actions"===e(m)()&&await(async()=>{const a=(0,l.join)(g,"python_matcher.json");if(!await e(h)(a))return(0,p.warning)("the python_matcher.json file does not exist in the same folder as setup_cpp.js");(0,p.info)("::add-matcher::"+a)})()}a(i.exports,"setupActionsPython",(()=>s));var r=x("eHIu2"),n=x("9UIqH"),p=x("pcnv8"),d=x("PfmXd"),l=x("drEX5"),m=x("gmbrv"),c=x("kb9gG"),u=x("eaup4"),h=x("aSpCH"),g=t.resolve(__dirname,"../../src/python")})),x.register("eHIu2",((e,o)=>{async function s(e,a,o,s){let m=null,c=e.replace(/^(\d+)\.(\d+)-dev$/,"~$1.$2.0-0").replace(/(\d+\.\d+\.\d+)((?:a|b|rc)\d*)/g,"$1-$2");if(d.debug(`Semantic version spec of ${e} is ${c}`),s){var u;m=await p.getManifest();const e=null===(u=await p.findReleaseFromManifest(c,a,m))||void 0===u?void 0:u.version;e?(c=e,d.info(`Resolved as '${c}'`)):d.info(`Failed to resolve version ${c} from manifest`)}let h=l.find("Python",c,a);if(!h){d.info(`Version ${c} was not found in the local cache`);const e=await p.findReleaseFromManifest(c,a,m);e&&e.files&&e.files.length>0&&(d.info(`Version ${c} is available for downloading`),await p.installCpythonFromRelease(e),h=l.find("Python",c,a))}if(!h){const t=await(0,r.getOSInfo)();throw Error([`The version '${e}' with architecture '${a}' was not found for ${t?`${t.osName} ${t.osVersion}`:"this operating system"}.`,"The list of all available versions can be found here: "+p.MANIFEST_URL].join(i.EOL))}const g=(e=>t.join(e,r.IS_WINDOWS?"Scripts":"bin"))(h),f=t.join(r.IS_WINDOWS?h:g,"python"+(r.IS_WINDOWS?".exe":""));if(o){if(d.exportVariable("pythonLocation",h),d.exportVariable("PKG_CONFIG_PATH",h+"/lib/pkgconfig"),d.exportVariable("pythonLocation",h),d.exportVariable("Python_ROOT_DIR",h),d.exportVariable("Python2_ROOT_DIR",h),d.exportVariable("Python3_ROOT_DIR",h),d.exportVariable("PKG_CONFIG_PATH",h+"/lib/pkgconfig"),r.IS_LINUX){const e=process.env.LD_LIBRARY_PATH?":"+process.env.LD_LIBRARY_PATH:"",a=t.join(h,"lib");e.split(":").includes(a)||d.exportVariable("LD_LIBRARY_PATH",a+e)}if(d.addPath(h),d.addPath(g),r.IS_WINDOWS){const e=t.basename(t.dirname(h)),a=n.major(e),i=n.minor(e),o=t.join(process.env.APPDATA||"","Python",`Python${a}${i}`,"Scripts");d.addPath(o)}}const y=(e=>{const a=e.split(t.sep),i=a.findIndex((e=>"PyPy"===e||"Python"===e));return a[i+1]||""})(h);return d.setOutput("python-version",y),d.setOutput("python-path",f),{impl:"CPython",version:y}}a(e.exports,"useCpythonVersion",(()=>s));var r=x("kb9gG"),n=x("dgS7u"),p=x("4Om2Q"),d=x("PfmXd"),l=x("1GQ3N")})),x.register("kb9gG",((i,s)=>{function r
//# sourceMappingURL=actions_python.e3292b54.js.map