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

3 lines
1.5 MiB
JavaScript
Raw Normal View History

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("fs"),o=require("os"),s=require("util"),r=require("assert"),n=require("crypto"),p=require("url"),d=require("buffer"),l=require("stream"),m=require("http"),c=require("https"),u=require("punycode"),h=require("zlib"),g=require("string_decoder"),f=require("events"),y=require("timers"),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("ijScl",((o,s)=>{async function r(a,t,o){u.IS_MAC&&(process.env.AGENT_TOOLSDIRECTORY="/Users/runner/hostedtoolcache");const s=process.env.AGENT_TOOLSDIRECTORY?.trim();if("string"==typeof s&&""!==s&&(process.env.RUNNER_TOOL_CACHE=process.env.AGENT_TOOLSDIRECTORY),(0,l.debug)("Python is expected to be installed into "+process.env.RUNNER_TOOL_CACHE),a){let e;if(a.startsWith("pypy")){const t=await(0,p.findPyPyVersion)(a,o,!0,!1);e=`${t.resolvedPyPyVersion}-${t.resolvedPythonVersion}`,(0,d.info)(`Successfully set up PyPy ${t.resolvedPyPyVersion} with Python (${t.resolvedPythonVersion})`)}else{const t=await(0,n.useCpythonVersion)(a,o,!0,!1);e=t.version,(0,d.info)(`Successfully set up ${t.impl} (${e})`)}if((0,u.isCacheFeatureAvailable)()){const a="pip";await(async(e,a)=>{const t=(0,h.getCacheDistributor)(e,a,void 0);await t.restoreCache()})(a,e)}}"github-actions"===e(c)()&&(()=>{const e=(0,m.join)(g,"python_matcher.json");if(!(0,i.existsSync)(e))return(0,d.warning)("the python_matcher.json file does not exist in the same folder as setup_cpp.js");(0,d.info)("::add-matcher::"+e)})()}a(o.exports,"setupActionsPython",(()=>r));var n=x("9c9p2"),p=x("iUqCq"),d=x("bouSm"),l=x("lXEOe"),m=x("jeNZZ"),c=x("1QGzx"),u=x("1xaKt"),h=x("d8Fps"),g=t.resolve(__dirname,"../../src/python")})),x.register("9c9p2",((e,i)=>{async function s(e,a,i,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){m=await p.getManifest();const e=(await p.findReleaseFromManifest(c,a,m))?.version;e?(c=e,d.info(`Resolved as '${c}'`)):d.info(`Failed to resolve version ${c} from manifest`)}let u=l.find("Python",c,a);if(!u){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),u=l.find("Python",c,a))}if(!u)throw Error([`Version ${e} with arch ${a} not found`,"The list of all available versions can be found here: "+p.MANIFEST_URL].join(o.EOL));const h=(e=>t.join(e,r.IS_WINDOWS?"Scripts":"bin"))(u),g=t.join(r.IS_WINDOWS?u:h,"python"+(r.IS_WINDOWS?".exe":""));if(i){if(d.exportVariable("pythonLocation",u),d.exportVariable("PKG_CONFIG_PATH",u+"/lib/pkgconfig"),d.exportVariable("pythonLocation",u),d.exportVariable("Python_ROOT_DIR",u),d.exportVariable("Python2_ROOT_DIR",u),d.exportVariable("Python3_ROOT_DIR",u),d.exportVariable("PKG_CONFIG_PATH",u+"/lib/pkgconfig"),r.IS_LINUX){const e=process.env.LD_LIBRARY_PATH?":"+process.env.LD_LIBRARY_PATH:"",a=t.join(u,"lib");e.split(":").includes(a)||d.exportVariable("LD_LIBRARY_PATH",a+e)}if(d.addPath(u),d.addPath(h),r.IS_WINDOWS){const e=t.basename(t.dirname(u)),a=n.major(e),i=n.minor(e),o=t.join(process.env.APPDATA||"","Python",`Python${a}${i}`,"Scripts");d.addPath(o)}}const f=(e=>{const a=e.split(t.sep),i=a.findIndex((e=>"PyPy"===e||"Python"===e));return a[i+1]||""})(u);return d.setOutput("python-version",f),d.setOutput("python-path",g),{impl:"CPython",version:f}}a(e.exports,"useCpythonVersion",(()=>s));var r=x("1xaKt"),n=x("cTdPL"),p=x("kSTcx"),d=x("lXEOe"),l=x("bafIx")})),x.register("1xaKt",((o,s)=>{function r(a,o,s,r=!1){const n=t.join(a,o),p=t.join(a,s);e(i).existsSync(p)||(e(i).symlinkSync(n,p),!w&&r&&e(i).chmodSync(p,"755"))}function n(e){return p(e)||!!b.validRange(e)}function p(e){return"nightly"===e}fun
//# sourceMappingURL=actions_python.b4fff571.js.map