setup-cpp/dist/modern/actions_python.4fb6b558.js

3 lines
96 KiB
JavaScript
Raw Permalink Normal View History

2024-02-17 15:07:54 +08:00
function $parcel$export(e,t,r,i){Object.defineProperty(e,t,{get:r,set:i,enumerable:!0,configurable:!0});}function $parcel$interopDefault(e){return e&&e.__esModule?e.default:e;}var $k14yv$path=require("path"),$k14yv$os=require("os"),$k14yv$fs=require("fs"),$k14yv$stream=require("stream"),$k14yv$util=require("util"),$k14yv$assert=require("assert"),$k14yv$child_process=require("child_process"),$k14yv$http=require("http"),$k14yv$https=require("https"),$k14yv$crypto=require("crypto"),$parcel$global=globalThis,parcelRequire=$parcel$global.parcelRequire810d,parcelRegister=parcelRequire.register;parcelRegister("4kQHk",function(e,t){var r,i,s,n,o,a,h,l,c;function u(e){return e.startsWith("pypy");}async function p(e,t,o){h.IS_MAC&&(process.env.AGENT_TOOLSDIRECTORY="/Users/runner/hostedtoolcache");let l=process.env.AGENT_TOOLSDIRECTORY?.trim();if("string"==typeof l&&""!==l&&(process.env.RUNNER_TOOL_CACHE=process.env.AGENT_TOOLSDIRECTORY),(0,n.debug)("Python is expected to be installed into "+process.env.RUNNER_TOOL_CACHE),e){let t;if(u(e)){let r=await(0,i.findPyPyVersion)(e,o,!0,d,!1);t=`${r.resolvedPyPyVersion}-${r.resolvedPythonVersion}`,(0,s.info)(`Successfully set up PyPy ${r.resolvedPyPyVersion} with Python (${r.resolvedPythonVersion})`);}else{let i=await(0,r.useCpythonVersion)(e,o,!0,d,!1);t=i.version,(0,s.info)(`Successfully set up ${i.impl} (${t})`);}}a.GITHUB_ACTIONS&&(await f());}async function f(){let e=(0,o.join)(c,"python_matcher.json");if(!(await(0,l.pathExists)(e)))return(0,s.warning)("the python_matcher.json file does not exist in the same folder as setup-cpp.js");(0,s.info)("::add-matcher::"+e);}$parcel$export(e.exports,"setupActionsPython",()=>p),r=parcelRequire("66RQi"),i=parcelRequire("9q7Zq"),s=parcelRequire("ER74K"),n=parcelRequire("4t50X"),o=parcelRequire("bzNgi"),a=parcelRequire("52cQ1"),h=parcelRequire("dm0eT"),l=parcelRequire("kY0n1"),c=$k14yv$path.resolve(__dirname,"../../src/python");let d=!1;}),parcelRegister("66RQi",function(e,t){var r,i,s,n,o;function a(e){return r.IS_WINDOWS?$k14yv$path.join(e,"Scripts"):$k14yv$path.join(e,"bin");}async function h(e,t,h,p,f){let d=null,m=u(l(e),f);if(n.debug(`Semantic version spec of ${e} is ${m}`),p){d=await s.getManifest();let e=(await s.findReleaseFromManifest(m,t,d))?.version;e?(m=e,n.info(`Resolved as '${m}'`)):n.info(`Failed to resolve version ${m} from manifest`);}let y=o.find("Python",m,t);if(!y){n.info(`Version ${m} was not found in the local cache`);let e=await s.findReleaseFromManifest(m,t,d);e&&e.files&&e.files.length>0&&(n.info(`Version ${m} is available for downloading`),await s.installCpythonFromRelease(e),y=o.find("Python",m,t));}if(!y){let i=await(0,r.getOSInfo)();throw Error([`The version '${e}' with architecture '${t}' was not found for ${i?`${i.osName} ${i.osVersion}`:"this operating system"}.`,"The list of all available versions can be found here: "+s.MANIFEST_URL].join($k14yv$os.EOL));}let g=a(y),E=r.IS_WINDOWS?".exe":"",w=$k14yv$path.join(r.IS_WINDOWS?y:g,"python"+E);if(h){if(n.exportVariable("pythonLocation",y),n.exportVariable("PKG_CONFIG_PATH",y+"/lib/pkgconfig"),n.exportVariable("pythonLocation",y),n.exportVariable("Python_ROOT_DIR",y),n.exportVariable("Python2_ROOT_DIR",y),n.exportVariable("Python3_ROOT_DIR",y),n.exportVariable("PKG_CONFIG_PATH",y+"/lib/pkgconfig"),r.IS_LINUX){let e=process.env.LD_LIBRARY_PATH?":"+process.env.LD_LIBRARY_PATH:"",t=$k14yv$path.join(y,"lib");e.split(":").includes(t)||n.exportVariable("LD_LIBRARY_PATH",t+e);}if(n.addPath(y),n.addPath(g),r.IS_WINDOWS){let e=$k14yv$path.basename($k14yv$path.dirname(y)),t=i.major(e),r=i.minor(e),s=$k14yv$path.join(process.env.APPDATA||"","Python",`Python${t}${r}`,"Scripts");n.addPath(s);}}let x=c(y);return n.setOutput("python-version",x),n.setOutput("python-path",w),{impl:"CPython",version:x};}function l(e){let t=/^(\d+)\.(\d+)-dev$/;return e.replace(t,"~$1.$2.0-0");}function c(e){let t=e.split($k14yv$path.sep),r=t.findIndex(e=>"PyPy"===e||"Python"===e);return t[r+1]||"";}function u(e,t){let r=/(\d+\.\d+\.\d+)((?:a|b|rc)\d*)/g,i=/^(\d+)\.(\d+)$/,s=e.replace(r,"$1-$2");return t&&
`,t&&t.split){let i=t.split(/\n/),s=(Math.min(i.length,e.line+3)+"").length,n=" ";for(;n.length<s;)n+=" ";for(let t=Math.max(0,e.line-1);t<Math.min(i.length,e.line+2);++t){let o=t+1+"";if(o.length<s&&(o=" "+o),e.line===t){r+=o+"> "+i[t]+"\n"+n+" ";for(let t=0;t<e.col;++t)r+=" ";r+="^\n";}else r+=o+": "+i[t]+"\n";}}return e.message=r+"\n",e;}e.exports=r;}),parcelRegister("iO4Tr",function(e,t){var r,i;function s(e,t){function s(t,r,n,o){if(t>=e.length)try{return n(a.finish());}catch(t){return o(i(t,e));}try{a.parse(e.slice(t,t+r)),setImmediate(s,t+r,r,n,o);}catch(t){o(i(t,e));}}t||(t={});let n=0,o=t.blocksize||40960,a=new r();return new Promise((e,t)=>{setImmediate(s,n,o,e,t);});}e.exports=s,r=parcelRequire("16AyQ"),i=parcelRequire("c4Fk1");}),parcelRegister("ddYPD",function(e,t){var r;function i(e){return e?s(e):n(e);}function s(e){let t=new r();return e.setEncoding("utf8"),new Promise((r,i)=>{let s;function n(){if(h=!0,!s)try{r(t.finish());}catch(e){i(e);}}function o(e){l=!0,i(e);}function a(){let r;for(s=!0;null!==(r=e.read());)try{t.parse(r);}catch(e){return o(e);}if(s=!1,h)return n();l||e.once("readable",a);}let h=!1,l=!1;e.once("end",n),e.once("error",o),a();});}function n(){let e=new r();return new $k14yv$stream.Transform({objectMode:!0,transform(t,r,i){try{e.parse(t.toString(r));}catch(e){this.emit("error",e);}i();},flush(t){try{this.push(e.finish());}catch(e){this.emit("error",e);}t();}});}e.exports=i,r=parcelRequire("16AyQ");}),parcelRegister("erM83",function(e,t){function r(e){if(null===e)throw i("null");if(void 0===e)throw i("undefined");if("object"!=typeof e)throw i(typeof e);if("function"==typeof e.toJSON&&(e=e.toJSON()),null==e)return null;let t=c(e);if("table"!==t)throw i(t);return h("","",e);}function i(e){return Error("Can only stringify objects, not "+e);}function s(){return Error("Array values can't have mixed types");}function n(e){return Object.keys(e).filter(t=>l(e[t]));}function o(e){return Object.keys(e).filter(t=>!l(e[t]));}function a(e){let t=Array.isArray(e)?[]:Object.prototype.hasOwnProperty.call(e,"__proto__")?{["__proto__"]:void 0}:{};for(let r of Object.keys(e))!e[r]||"function"!=typeof e[r].toJSON||"toISOString"in e[r]?t[r]=e[r]:t[r]=e[r].toJSON();return t;}function h(e,t,r){i=n(r=a(r)),s=o(r);var i,s,h=[],l=t||"";i.forEach(e=>{var t=c(r[e]);"undefined"!==t&&"null"!==t&&h.push(l+u(e)+" = "+g(r[e],!0));}),h.length>0&&h.push("");var p=e&&i.length>0?t+" ":"";return s.forEach(t=>{h.push(S(e,p,t,r[t]));}),h.join("\n");}function l(e){switch(c(e)){case"undefined":case"null":case"integer":case"nan":case"float":case"boolean":case"string":case"datetime":return!0;case"array":return 0===e.length||"table"!==c(e[0]);case"table":return 0===Object.keys(e).length;default:return!1;}}function c(e){if(void 0===e)return"undefined";if(null===e)return"null";if("bigint"==typeof e||Number.isInteger(e)&&!Object.is(e,-0))return"integer";if("number"==typeof e)return"float";if("boolean"==typeof e)return"boolean";else if("string"==typeof e)return"string";else if("toISOString"in e)return isNaN(e)?"undefined":"datetime";else if(Array.isArray(e))return"array";else return"table";}function u(e){var t=e+"";return /^[-A-Za-z0-9_]+$/.test(t)?t:p(t);}function p(e){return'"'+m(e).replace(/"/g,'\\"')+'"';}function f(e){return"'"+e+"'";}function d(e,t){for(;t.length<e;)t="0"+t;return t;}function m(e){return e.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/([\u0000-\u001f\u007f])/,e=>"\\u"+d(4,e.codePointAt(0).toString(16)));}function y(e){let t=e.split(/\n/).map(e=>m(e).replace(/"(?="")/g,'\\"')).join("\n");return'"'===t.slice(-1)&&(t+="\\\n"),'"""\n'+t+'"""';}function g(e,t){let r=c(e);return"string"===r&&(t&&/\n/.test(e)?r="string-multiline":!/[\b\t\n\f\r']/.test(e)&&/"/.test(e)&&(r="string-literal")),E(e,r);}function E(e,t){switch(t||(t=c(e)),t){case"string-multiline":return y(e);case"string":return p(e);case"string-literal":return f(e);case"integer":return w(e);case"float":return x(e);case"boolean":return v(e);case"datetime":return O(e
//# sourceMappingURL=actions_python.4fb6b558.js.map