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

3 lines
87 KiB
JavaScript
Raw Normal View History

2024-01-22 15:34:53 +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$crypto=require("crypto"),$parcel$global=globalThis,parcelRequire=$parcel$global.parcelRequire810d,parcelRegister=parcelRequire.register;parcelRegister("4kQHk",function(e,t){var r,i,n,s,o,a,h,c,l;function u(e){return e.startsWith("pypy");}async function p(e,t,o){h.IS_MAC&&(process.env.AGENT_TOOLSDIRECTORY="/Users/runner/hostedtoolcache");let c=process.env.AGENT_TOOLSDIRECTORY?.trim();if("string"==typeof c&&""!==c&&(process.env.RUNNER_TOOL_CACHE=process.env.AGENT_TOOLSDIRECTORY),(0,s.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,n.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,n.info)(`Successfully set up ${i.impl} (${t})`);}}a.GITHUB_ACTIONS&&(await f());}async function f(){let e=(0,o.join)(l,"python_matcher.json");if(!(await(0,c.pathExists)(e)))return(0,n.warning)("the python_matcher.json file does not exist in the same folder as setup-cpp.js");(0,n.info)("::add-matcher::"+e);}$parcel$export(e.exports,"setupActionsPython",()=>p),r=parcelRequire("66RQi"),i=parcelRequire("9q7Zq"),n=parcelRequire("ER74K"),s=parcelRequire("4t50X"),o=parcelRequire("bzNgi"),a=parcelRequire("52cQ1"),h=parcelRequire("dm0eT"),c=parcelRequire("kY0n1"),l=$k14yv$path.resolve(__dirname,"../../src/python");let d=!1;}),parcelRegister("66RQi",function(e,t){var r,i,n,s,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(c(e),f);if(s.debug(`Semantic version spec of ${e} is ${m}`),p){d=await n.getManifest();let e=(await n.findReleaseFromManifest(m,t,d))?.version;e?(m=e,s.info(`Resolved as '${m}'`)):s.info(`Failed to resolve version ${m} from manifest`);}let y=o.find("Python",m,t);if(!y){s.info(`Version ${m} was not found in the local cache`);let e=await n.findReleaseFromManifest(m,t,d);e&&e.files&&e.files.length>0&&(s.info(`Version ${m} is available for downloading`),await n.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: "+n.MANIFEST_URL].join($k14yv$os.EOL));}let E=a(y),g=r.IS_WINDOWS?".exe":"",w=$k14yv$path.join(r.IS_WINDOWS?y:E,"python"+g);if(h){if(s.exportVariable("pythonLocation",y),s.exportVariable("PKG_CONFIG_PATH",y+"/lib/pkgconfig"),s.exportVariable("pythonLocation",y),s.exportVariable("Python_ROOT_DIR",y),s.exportVariable("Python2_ROOT_DIR",y),s.exportVariable("Python3_ROOT_DIR",y),s.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)||s.exportVariable("LD_LIBRARY_PATH",t+e);}if(s.addPath(y),s.addPath(E),r.IS_WINDOWS){let e=$k14yv$path.basename($k14yv$path.dirname(y)),t=i.major(e),r=i.minor(e),n=$k14yv$path.join(process.env.APPDATA||"","Python",`Python${t}${r}`,"Scripts");s.addPath(n);}}let x=l(y);return s.setOutput("python-version",x),s.setOutput("python-path",w),{impl:"CPython",version:x};}function c(e){let t=/^(\d+)\.(\d+)-dev$/;return e.replace(t,"~$1.$2.0-0");}function l(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+)$/,n=e.replace(r,"$1-$2");return t&&(n=n.replace(i,"~$1.$2.0-0")),n;}$parcel$export(e.exports,
`,t&&t.split){let i=t.split(/\n/),n=(Math.min(i.length,e.line+3)+"").length,s=" ";for(;s.length<n;)s+=" ";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<n&&(o=" "+o),e.line===t){r+=o+"> "+i[t]+"\n"+s+" ";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 n(e,t){function n(t,r,s,o){if(t>=e.length)try{return s(a.finish());}catch(t){return o(i(t,e));}try{a.parse(e.slice(t,t+r)),setImmediate(n,t+r,r,s,o);}catch(t){o(i(t,e));}}t||(t={});let s=0,o=t.blocksize||40960,a=new r();return new Promise((e,t)=>{setImmediate(n,s,o,e,t);});}e.exports=n,r=parcelRequire("16AyQ"),i=parcelRequire("c4Fk1");}),parcelRegister("ddYPD",function(e,t){var r;function i(e){return e?n(e):s(e);}function n(e){let t=new r();return e.setEncoding("utf8"),new Promise((r,i)=>{let n;function s(){if(h=!0,!n)try{r(t.finish());}catch(e){i(e);}}function o(e){c=!0,i(e);}function a(){let r;for(n=!0;null!==(r=e.read());)try{t.parse(r);}catch(e){return o(e);}if(n=!1,h)return s();c||e.once("readable",a);}let h=!1,c=!1;e.once("end",s),e.once("error",o),a();});}function s(){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=l(e);if("table"!==t)throw i(t);return h("","",e);}function i(e){return Error("Can only stringify objects, not "+e);}function n(){return Error("Array values can't have mixed types");}function s(e){return Object.keys(e).filter(t=>c(e[t]));}function o(e){return Object.keys(e).filter(t=>!c(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=s(r=a(r)),n=o(r);var i,n,h=[],c=t||"";i.forEach(e=>{var t=l(r[e]);"undefined"!==t&&"null"!==t&&h.push(c+u(e)+" = "+E(r[e],!0));}),h.length>0&&h.push("");var p=e&&i.length>0?t+" ":"";return n.forEach(t=>{h.push(R(e,p,t,r[t]));}),h.join("\n");}function c(e){switch(l(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"!==l(e[0]);case"table":return 0===Object.keys(e).length;default:return!1;}}function l(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 E(e,t){let r=l(e);return"string"===r&&(t&&/\n/.test(e)?r="string-multiline":!/[\b\t\n\f\r']/.test(e)&&/"/.test(e)&&(r="string-literal")),g(e,r);}function g(e,t){switch(t||(t=l(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 I(e
//# sourceMappingURL=actions_python.6be0dfa4.js.map