setup-cpp/dist/legacy/actions_python.58721305.js

3 lines
77 KiB
JavaScript
Raw Normal View History

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 $kC5q1$path=require("path"),$kC5q1$os=require("os"),$kC5q1$fs=require("fs"),$kC5q1$stream=require("stream"),$kC5q1$util=require("util"),$kC5q1$assert=require("assert"),$kC5q1$child_process=require("child_process"),$kC5q1$http=require("http"),$kC5q1$https=require("https"),$parcel$global="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},parcelRequire=$parcel$global.parcelRequire810d;parcelRequire.register("8L9T2",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){var l;h.IS_MAC&&(process.env.AGENT_TOOLSDIRECTORY="/Users/runner/hostedtoolcache");let c=null===(l=process.env.AGENT_TOOLSDIRECTORY)||void 0===l?void 0:l.trim();if("string"==typeof c&&""!==c&&(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})`);}let n=!1;if(n){let{cacheDependencies:e}=await parcelRequire("65Nuu");await e("pip",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("g8XlV"),i=parcelRequire("49ncA"),s=parcelRequire("hHq4F"),n=parcelRequire("2heqc"),o=parcelRequire("A8hFE"),a=parcelRequire("cLprm"),h=parcelRequire("42Mcf"),l=parcelRequire("3WkGD"),c=$kC5q1$path.resolve(__dirname,"../../src/python");let d=!1;}),parcelRequire.register("g8XlV",function(e,t){var r,i,s,n,o;function a(e){return r.IS_WINDOWS?$kC5q1$path.join(e,"Scripts"):$kC5q1$path.join(e,"bin");}async function h(e,t,h,p,f){let d=null,y=l(e),m=u(y,f);if(n.debug(`Semantic version spec of ${e} is ${m}`),p){var g;d=await s.getManifest();let e=null===(g=await s.findReleaseFromManifest(m,t,d))||void 0===g?void 0:g.version;e?(m=e,n.info(`Resolved as '${m}'`)):n.info(`Failed to resolve version ${m} from manifest`);}let x=o.find("Python",m,t);if(!x){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),x=o.find("Python",m,t));}if(!x){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($kC5q1$os.EOL));}let w=a(x),b=r.IS_WINDOWS?".exe":"",v=$kC5q1$path.join(r.IS_WINDOWS?x:w,"python"+b);if(h){if(n.exportVariable("pythonLocation",x),n.exportVariable("PKG_CONFIG_PATH",x+"/lib/pkgconfig"),n.exportVariable("pythonLocation",x),n.exportVariable("Python_ROOT_DIR",x),n.exportVariable("Python2_ROOT_DIR",x),n.exportVariable("Python3_ROOT_DIR",x),n.exportVariable("PKG_CONFIG_PATH",x+"/lib/pkgconfig"),r.IS_LINUX){let e=process.env.LD_LIBRARY_PATH?":"+process.env.LD_LIBRARY_PATH:"",t=$kC5q1$path.join(x,"lib");e.split(":").includes(t)||n.exportVariable("LD_LIBRARY_PATH",t+e);}if(n.addPath(x),n.addPath(w),r.IS_WINDOWS){let e=$kC5q1$path.basename($kC5q1$path.dirname(x)),t=i.major(e),r=i.minor(e),s=$kC5q1$path.join(process.env.APPDATA||"","Python",`Python${t}${r}`,"Scripts");n.addPath(s);}}let S=c(x);return n.setOutput("python-version",S),n.setOutput("python-path",v),{impl:"CPython",version:S};}function l(e){let t=/^(\d+)\.(\d+)-dev$/;return e
`,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;}),parcelRequire.register("2S5Eu",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("3XGwc"),i=parcelRequire("gBYD8");}),parcelRequire.register("9JW1y",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 $kC5q1$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("3XGwc");}),parcelRequire.register("bhUE6",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(I(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'"'+y(e).replace(/"/g,'\\"')+'"';}function f(e){return"'"+e+"'";}function d(e,t){for(;t.length<e;)t="0"+t;return t;}function y(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 m(e){let t=e.split(/\n/).map(e=>y(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")),x(e,r);}function x(e,t){switch(t||(t=c(e)),t){case"string-multiline":return m(e);case"string":return p(e);case"string-literal":return f(e);case"integer":return w(e);case"float":return b(e);case"boolean":return v(e);c
//# sourceMappingURL=actions_python.58721305.js.map