diff --git a/dist/cache-factory.8ad1a0d1.js b/dist/cache-factory.8ad1a0d1.js new file mode 100644 index 00000000..5aa4e15f --- /dev/null +++ b/dist/cache-factory.8ad1a0d1.js @@ -0,0 +1,2 @@ +function e(e,t,r,o){Object.defineProperty(e,t,{get:r,set:o,enumerable:!0,configurable:!0})}function t(e){return e&&e.__esModule?e.default:e}var r=require("child_process"),o=require("util"),s=require("path"),a=require("os"),n=require("fs"),i=require("assert"),c=require("crypto"),l=require("stream"),p=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).parcelRequire810d;p.register("tIILP",((t,r)=>{function o(e,t,r){switch(e){case i.Pip:return new s.default(t,r);case i.Pipenv:return new a.default(t,r);case i.Poetry:return new n.default(t,r);default:throw Error(`Caching for '${e}' is not supported`)}}e(t.exports,"getCacheDistributor",(()=>o));var s=p("5p0V2"),a=p("gyWii"),n=p("9rlmk");let i;(e=>{e.Pip="pip",e.Pipenv="pipenv",e.Poetry="poetry"})(i||(i={}))})),p.register("5p0V2",(function(n,i){e(n.exports,"default",(()=>f));var c=p("b5WCL"),l=p("9bqVn"),u=p("ca0ts"),h=p("c3SoR"),d=p("3Mp5H"),f=class extends h.default{constructor(e,t="**/requirements.txt"){super("pip",t),this.pythonVersion=e}async getCacheGlobalDirectories(){let e=1,n="",i="";if(d.IS_WINDOWS){const e=t(o).promisify(r.exec);({stdout:n,stderr:i}=await e("pip cache dir"))}else({stdout:n,stderr:i,exitCode:e}=await u.getExecOutput("pip cache dir"));if(e&&i)throw Error("Could not get cache folder path for pip package manager");let c=n.trim();return c.includes("~")&&(c=s.join(t(a).homedir(),c.slice(1))),l.debug("global cache directory path is "+c),[c]}async computeKeys(){const e=await c.hashFiles(this.cacheDependencyPath);return{primaryKey:`${this.CACHE_KEY_PREFIX}-${process.env.RUNNER_OS}-python-${this.pythonVersion}-${this.packageManager}-${e}`,restoreKey:[`${this.CACHE_KEY_PREFIX}-${process.env.RUNNER_OS}-python-${this.pythonVersion}-${this.packageManager}`]}}}})),p.register("b5WCL",(function(e,t){"use strict";function r(e,t){return o(this,void 0,void 0,(function*(){return yield s.DefaultGlobber.create(e,t)}))}var o=e.exports&&e.exports.__awaiter||((e,t,r,o)=>new(r||(r=Promise))(((s,a)=>{function n(e){try{c(o.next(e))}catch(e){a(e)}}function i(e){try{c(o.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((e=>{e(t)}))).then(n,i)}c((o=o.apply(e,t||[])).next())})));Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.hashFiles=e.exports.create=void 0;var s=p("2LsYP"),a=p("c7nrF");e.exports.create=r,e.exports.hashFiles=function(e,t){return o(this,void 0,void 0,(function*(){let o=!0;t&&"boolean"==typeof t.followSymbolicLinks&&(o=t.followSymbolicLinks);const s=yield r(e,{followSymbolicLinks:o});return a.hashFiles(s)}))}})),p.register("2LsYP",(function(e,t){"use strict";var r=e.exports&&e.exports.__createBinding||(Object.create?(e,t,r,o)=>{void 0===o&&(o=r),Object.defineProperty(e,o,{enumerable:!0,get(){return t[r]}})}:(e,t,r,o)=>{void 0===o&&(o=r),e[o]=t[r]}),o=e.exports&&e.exports.__setModuleDefault||(Object.create?(e,t)=>{Object.defineProperty(e,"default",{enumerable:!0,value:t})}:(e,t)=>{e.default=t}),a=e.exports&&e.exports.__importStar||(e=>{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.hasOwnProperty.call(e,s)&&r(t,e,s);return o(t,e),t}),i=e.exports&&e.exports.__awaiter||((e,t,r,o)=>new(r||(r=Promise))(((s,a)=>{function n(e){try{c(o.next(e))}catch(e){a(e)}}function i(e){try{c(o.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((e=>{e(t)}))).then(n,i)}c((o=o.apply(e,t||[])).next())}))),c=e.exports&&e.exports.__asyncValues||function(e){function t(t){r[t]=e[t]&&(r=>new Promise(((o,s)=>{((e,t,r,o)=>{Promise.resolve(o).then((t=>{e({value:t,done:r})}),t)})(o,s,(r=e[t](r)).done,r.value)})))}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=e[Symbol.asyncIterator];return o?o.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),r={},t("next"),t("throw"),t("return"),r[Symbol.asyncIterator]=function(){return this},r)},l=e.exports&&e.exports.__await||function(e){return this instanceof l?(this.v=e,this):new l(e)},u=e.exports&&e.exports.__asyncGenerator||function(e,t,r){function o(e){p[e]&&(c[e]=t=>new Promise(((r,o)=>{u.push([e,t,r,o])>1||s(e,t)})))}function s(e,t){try{(r=p[e](t)).value instanceof l?Promise.resolve(r.value.v).then(a,n):i(u[0][2],r)}catch(e){i(u[0][3],e)}var r}function a(e){s("next",e)}function n(e){s("throw",e)}function i(e,t){e(t),u.shift(),u.length&&s(u[0][0],u[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var c,p=r.apply(e,t||[]),u=[];return c={},o("next"),o("throw"),o("return"),c[Symbol.asyncIterator]=function(){return this},c};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.DefaultGlobber=void 0;const h=a(p("9bqVn")),d=a(n),f=a(p("ivUaY")),m=a(s),y=a(p("btf6r"));var b=p("iOrzV"),g=p("9aW8w"),v=p("e51CO");const x="win32"===process.platform;class _{constructor(e){this.patterns=[],this.searchPaths=[],this.options=f.getOptions(e)}getSearchPaths(){return this.searchPaths.slice()}glob(){var e,t;return i(this,void 0,void 0,(function*(){const r=[];try{for(var o,s=c(this.globGenerator());!(o=yield s.next()).done;)r.push(o.value)}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=s.return)&&(yield t.call(s))}finally{if(e)throw e.error}}return r}))}globGenerator(){return u(this,arguments,(function*(){const e=f.getOptions(this.options),t=[];for(const r of this.patterns)t.push(r),e.implicitDescendants&&(r.trailingSeparator||"**"!==r.segments[r.segments.length-1])&&t.push(new g.Pattern(r.negate,!0,r.segments.concat("**")));const r=[];for(const e of y.getSearchPaths(t)){h.debug(`Search path '${e}'`);try{yield l(d.promises.lstat(e))}catch(e){if("ENOENT"===e.code)continue;throw e}r.unshift(new v.SearchState(e,1))}const o=[];for(;r.length;){const s=r.pop(),a=y.match(t,s.path),n=!!a||y.partialMatch(t,s.path);if(!a&&!n)continue;const i=yield l(_.stat(s,e,o));if(i)if(i.isDirectory()){if(a&b.MatchKind.Directory&&e.matchDirectories)yield yield l(s.path);else if(!n)continue;const t=s.level+1,o=(yield l(d.promises.readdir(s.path))).map((e=>new v.SearchState(m.join(s.path,e),t)));r.push(...o.reverse())}else a&b.MatchKind.File&&(yield yield l(s.path))}}))}static create(e,t){return i(this,void 0,void 0,(function*(){const r=new _(t);x&&(e=(e=e.replace(/\r\n/g,"\n")).replace(/\r/g,"\n"));const o=e.split("\n").map((e=>e.trim()));for(const e of o)e&&!e.startsWith("#")&&r.patterns.push(new g.Pattern(e));return r.searchPaths.push(...y.getSearchPaths(r.patterns)),r}))}static stat(e,t,r){return i(this,void 0,void 0,(function*(){let o;if(t.followSymbolicLinks)try{o=yield d.promises.stat(e.path)}catch(r){if("ENOENT"===r.code){if(t.omitBrokenSymbolicLinks)return void h.debug(`Broken symlink '${e.path}'`);throw Error(`No information found for the path '${e.path}'. This may indicate a broken symbolic link.`)}throw r}else o=yield d.promises.lstat(e.path);if(o.isDirectory()&&t.followSymbolicLinks){const t=yield d.promises.realpath(e.path);for(;r.length>=e.level;)r.pop();if(r.some((e=>e===t)))return void h.debug(`Symlink cycle detected for path '${e.path}' and realpath '${t}'`);r.push(t)}return o}))}}e.exports.DefaultGlobber=_})),p.register("ivUaY",((e,t)=>{"use strict";var r=e.exports&&e.exports.__createBinding||(Object.create?(e,t,r,o)=>{void 0===o&&(o=r),Object.defineProperty(e,o,{enumerable:!0,get(){return t[r]}})}:(e,t,r,o)=>{void 0===o&&(o=r),e[o]=t[r]}),o=e.exports&&e.exports.__setModuleDefault||(Object.create?(e,t)=>{Object.defineProperty(e,"default",{enumerable:!0,value:t})}:(e,t)=>{e.default=t}),s=e.exports&&e.exports.__importStar||(e=>{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.hasOwnProperty.call(e,s)&&r(t,e,s);return o(t,e),t});Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.getOptions=void 0;const a=s(p("9bqVn"));e.exports.getOptions=e=>{const t={followSymbolicLinks:!0,implicitDescendants:!0,matchDirectories:!0,omitBrokenSymbolicLinks:!0};return e&&("boolean"==typeof e.followSymbolicLinks&&(t.followSymbolicLinks=e.followSymbolicLinks,a.debug(`followSymbolicLinks '${t.followSymbolicLinks}'`)),"boolean"==typeof e.implicitDescendants&&(t.implicitDescendants=e.implicitDescendants,a.debug(`implicitDescendants '${t.implicitDescendants}'`)),"boolean"==typeof e.matchDirectories&&(t.matchDirectories=e.matchDirectories,a.debug(`matchDirectories '${t.matchDirectories}'`)),"boolean"==typeof e.omitBrokenSymbolicLinks&&(t.omitBrokenSymbolicLinks=e.omitBrokenSymbolicLinks,a.debug(`omitBrokenSymbolicLinks '${t.omitBrokenSymbolicLinks}'`))),t}})),p.register("btf6r",((e,t)=>{"use strict";var r=e.exports&&e.exports.__createBinding||(Object.create?(e,t,r,o)=>{void 0===o&&(o=r),Object.defineProperty(e,o,{enumerable:!0,get(){return t[r]}})}:(e,t,r,o)=>{void 0===o&&(o=r),e[o]=t[r]}),o=e.exports&&e.exports.__setModuleDefault||(Object.create?(e,t)=>{Object.defineProperty(e,"default",{enumerable:!0,value:t})}:(e,t)=>{e.default=t}),s=e.exports&&e.exports.__importStar||(e=>{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.hasOwnProperty.call(e,s)&&r(t,e,s);return o(t,e),t});Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.partialMatch=e.exports.match=e.exports.getSearchPaths=void 0;const a=s(p("aXEcz"));var n=p("iOrzV");const i="win32"===process.platform;e.exports.getSearchPaths=e=>{e=e.filter((e=>!e.negate));const t={};for(const r of e)t[i?r.searchPath.toUpperCase():r.searchPath]="candidate";const r=[];for(const o of e){const e=i?o.searchPath.toUpperCase():o.searchPath;if("included"===t[e])continue;let s=!1,n=e,c=a.dirname(n);for(;c!==n;){if(t[c]){s=!0;break}n=c,c=a.dirname(n)}s||(r.push(o.searchPath),t[e]="included")}return r},e.exports.match=(e,t)=>{let r=n.MatchKind.None;for(const o of e)o.negate?r&=~o.match(t):r|=o.match(t);return r},e.exports.partialMatch=(e,t)=>e.some((e=>!e.negate&&e.partialMatch(t)))})),p.register("aXEcz",((e,t)=>{"use strict";function r(e){return h.default(e,"hasAbsoluteRoot parameter 'itemPath' must not be empty"),e=o(e),d?e.startsWith("\\\\")||/^[A-Z]:\\/i.test(e):e.startsWith("/")}function o(e){return e=e||"",d?(e=e.replace(/\//g,"\\"),(/^\\\\+[^\\]/.test(e)?"\\":"")+e.replace(/\\\\+/g,"\\")):e.replace(/\/\/+/g,"/")}function a(e){return e?(e=o(e)).endsWith(u.sep)?e===u.sep||d&&/^[A-Z]:\\$/i.test(e)?e:e.substr(0,e.length-1):e:""}var n=e.exports&&e.exports.__createBinding||(Object.create?(e,t,r,o)=>{void 0===o&&(o=r),Object.defineProperty(e,o,{enumerable:!0,get(){return t[r]}})}:(e,t,r,o)=>{void 0===o&&(o=r),e[o]=t[r]}),c=e.exports&&e.exports.__setModuleDefault||(Object.create?(e,t)=>{Object.defineProperty(e,"default",{enumerable:!0,value:t})}:(e,t)=>{e.default=t}),l=e.exports&&e.exports.__importStar||(e=>{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return c(t,e),t}),p=e.exports&&e.exports.__importDefault||(e=>e&&e.__esModule?e:{default:e});Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.safeTrimTrailingSeparator=e.exports.normalizeSeparators=e.exports.hasRoot=e.exports.hasAbsoluteRoot=e.exports.ensureAbsoluteRoot=e.exports.dirname=void 0;const u=l(s),h=p(i),d="win32"===process.platform;e.exports.dirname=e=>{if(e=a(e),d&&/^\\\\[^\\]+(\\[^\\]+)?$/.test(e))return e;let t=u.dirname(e);return d&&/^\\\\[^\\]+\\[^\\]+\\$/.test(t)&&(t=a(t)),t},e.exports.ensureAbsoluteRoot=(e,t)=>{if(h.default(e,"ensureAbsoluteRoot parameter 'root' must not be empty"),h.default(t,"ensureAbsoluteRoot parameter 'itemPath' must not be empty"),r(t))return t;if(d){if(t.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)){let e=process.cwd();return h.default(e.match(/^[A-Z]:\\/i),`Expected current directory to start with an absolute drive root. Actual '${e}'`),t[0].toUpperCase()===e[0].toUpperCase()?2===t.length?`${t[0]}:\\${e.substr(3)}`:(e.endsWith("\\")||(e+="\\"),`${t[0]}:\\${e.substr(3)}${t.substr(2)}`):`${t[0]}:\\${t.substr(2)}`}if(o(t).match(/^\\$|^\\[^\\]/)){const e=process.cwd();return h.default(e.match(/^[A-Z]:\\/i),`Expected current directory to start with an absolute drive root. Actual '${e}'`),`${e[0]}:\\${t.substr(1)}`}}return h.default(r(e),"ensureAbsoluteRoot parameter 'root' must have an absolute root"),e.endsWith("/")||d&&e.endsWith("\\")||(e+=u.sep),e+t},e.exports.hasAbsoluteRoot=r,e.exports.hasRoot=e=>(h.default(e,"isRooted parameter 'itemPath' must not be empty"),e=o(e),d?e.startsWith("\\")||/^[A-Z]:/i.test(e):e.startsWith("/")),e.exports.normalizeSeparators=o,e.exports.safeTrimTrailingSeparator=a})),p.register("iOrzV",((e,t)=>{"use strict";var r;Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.MatchKind=void 0,(r=e.exports.MatchKind||(e.exports.MatchKind={}))[r.None=0]="None",r[r.Directory=1]="Directory",r[r.File=2]="File",r[r.All=3]="All"})),p.register("9aW8w",(function(e,t){"use strict";var r=e.exports&&e.exports.__createBinding||(Object.create?(e,t,r,o)=>{void 0===o&&(o=r),Object.defineProperty(e,o,{enumerable:!0,get(){return t[r]}})}:(e,t,r,o)=>{void 0===o&&(o=r),e[o]=t[r]}),o=e.exports&&e.exports.__setModuleDefault||(Object.create?(e,t)=>{Object.defineProperty(e,"default",{enumerable:!0,value:t})}:(e,t)=>{e.default=t}),n=e.exports&&e.exports.__importStar||(e=>{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.hasOwnProperty.call(e,s)&&r(t,e,s);return o(t,e),t}),c=e.exports&&e.exports.__importDefault||(e=>e&&e.__esModule?e:{default:e});Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.Pattern=void 0;const l=n(a),u=n(s),h=n(p("aXEcz")),d=c(i);var f=p("5RQ11"),m=p("iOrzV"),y=p("i7Uxm");const b="win32"===process.platform;class g{constructor(e,t=!1,r,o){let s;if(this.negate=!1,"string"==typeof e)s=e.trim();else{d.default((r=r||[]).length,"Parameter 'segments' must not empty");const t=g.getLiteral(r[0]);d.default(t&&h.hasAbsoluteRoot(t),"Parameter 'segments' first element must be a root path"),s=(""+new y.Path(r)).trim(),e&&(s="!"+s)}for(;s.startsWith("!");)this.negate=!this.negate,s=s.substr(1).trim();s=g.fixupPattern(s,o),this.segments=new y.Path(s).segments,this.trailingSeparator=h.normalizeSeparators(s).endsWith(u.sep),s=h.safeTrimTrailingSeparator(s);let a=!1;const n=this.segments.map((e=>g.getLiteral(e))).filter((e=>!a&&!(a=""===e)));this.searchPath=""+new y.Path(n),this.rootRegExp=RegExp(g.regExpEscape(n[0]),b?"i":""),this.isImplicitPattern=t;const i={dot:!0,nobrace:!0,nocase:b,nocomment:!0,noext:!0,nonegate:!0};s=b?s.replace(/\\/g,"/"):s,this.minimatch=new f.Minimatch(s,i)}match(e){return"**"===this.segments[this.segments.length-1]?(e=h.normalizeSeparators(e)).endsWith(u.sep)||!1!==this.isImplicitPattern||(e=`${e}${u.sep}`):e=h.safeTrimTrailingSeparator(e),this.minimatch.match(e)?this.trailingSeparator?m.MatchKind.Directory:m.MatchKind.All:m.MatchKind.None}partialMatch(e){return e=h.safeTrimTrailingSeparator(e),h.dirname(e)===e?this.rootRegExp.test(e):this.minimatch.matchOne(e.split(b?/\\+/:/\/+/),this.minimatch.set[0],!0)}static globEscape(e){return(b?e:e.replace(/\\/g,"\\\\")).replace(/(\[)(?=[^/]+\])/g,"[[]").replace(/\?/g,"[?]").replace(/\*/g,"[*]")}static fixupPattern(e,t){d.default(e,"pattern cannot be empty");const r=new y.Path(e).segments.map((e=>g.getLiteral(e)));if(d.default(r.every(((e,t)=>("."!==e||0===t)&&".."!==e)),`Invalid pattern '${e}'. Relative pathing '.' and '..' is not allowed.`),d.default(!h.hasRoot(e)||r[0],`Invalid pattern '${e}'. Root segment must not contain globs.`),"."===(e=h.normalizeSeparators(e))||e.startsWith("."+u.sep))e=g.globEscape(process.cwd())+e.substr(1);else if("~"===e||e.startsWith("~"+u.sep))t=t||l.homedir(),d.default(t,"Unable to determine HOME directory"),d.default(h.hasAbsoluteRoot(t),`Expected HOME directory to be a rooted path. Actual '${t}'`),e=g.globEscape(t)+e.substr(1);else if(b&&(e.match(/^[A-Z]:$/i)||e.match(/^[A-Z]:[^\\]/i))){let t=h.ensureAbsoluteRoot("C:\\dummy-root",e.substr(0,2));e.length>2&&!t.endsWith("\\")&&(t+="\\"),e=g.globEscape(t)+e.substr(2)}else if(b&&("\\"===e||e.match(/^\\[^\\]/))){let t=h.ensureAbsoluteRoot("C:\\dummy-root","\\");t.endsWith("\\")||(t+="\\"),e=g.globEscape(t)+e.substr(1)}else e=h.ensureAbsoluteRoot(g.globEscape(process.cwd()),e);return h.normalizeSeparators(e)}static getLiteral(e){let t="";for(let r=0;e.length>r;r++){const o=e[r];if("\\"!==o||b||r+1>=e.length){if("*"===o||"?"===o)return"";if("["===o&&e.length>r+1){let o="",s=-1;for(let t=r+1;e.length>t;t++){const r=e[t];if("\\"!==r||b||t+1>=e.length){if("]"===r){s=t;break}o+=r}else o+=e[++t]}if(s>=0){if(o.length>1)return"";if(o){t+=o,r=s;continue}}}t+=o}else t+=e[++r]}return t}static regExpEscape(e){return e.replace(/[[\\^$.|?*+()]/g,"\\$&")}}e.exports.Pattern=g})),p.register("i7Uxm",(function(e,t){"use strict";var r=e.exports&&e.exports.__createBinding||(Object.create?(e,t,r,o)=>{void 0===o&&(o=r),Object.defineProperty(e,o,{enumerable:!0,get(){return t[r]}})}:(e,t,r,o)=>{void 0===o&&(o=r),e[o]=t[r]}),o=e.exports&&e.exports.__setModuleDefault||(Object.create?(e,t)=>{Object.defineProperty(e,"default",{enumerable:!0,value:t})}:(e,t)=>{e.default=t}),a=e.exports&&e.exports.__importStar||(e=>{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.hasOwnProperty.call(e,s)&&r(t,e,s);return o(t,e),t}),n=e.exports&&e.exports.__importDefault||(e=>e&&e.__esModule?e:{default:e});Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.Path=void 0;const c=a(s),l=a(p("aXEcz")),u=n(i),h="win32"===process.platform;e.exports.Path=class{constructor(e){if(this.segments=[],"string"==typeof e)if(u.default(e,"Parameter 'itemPath' must not be empty"),e=l.safeTrimTrailingSeparator(e),l.hasRoot(e)){let t=e,r=l.dirname(t);for(;r!==t;){const e=c.basename(t);this.segments.unshift(e),t=r,r=l.dirname(t)}this.segments.unshift(t)}else this.segments=e.split(c.sep);else{u.default(e.length>0,"Parameter 'itemPath' must not be an empty array");for(let t=0;e.length>t;t++){let r=e[t];u.default(r,"Parameter 'itemPath' must not contain any empty segments"),r=l.normalizeSeparators(e[t]),0===t&&l.hasRoot(r)?(r=l.safeTrimTrailingSeparator(r),u.default(r===l.dirname(r),"Parameter 'itemPath' root segment contains information for multiple segments"),this.segments.push(r)):(u.default(!r.includes(c.sep),"Parameter 'itemPath' contains unexpected path separators"),this.segments.push(r))}}}toString(){let e=this.segments[0],t=e.endsWith(c.sep)||h&&/^[A-Z]:$/i.test(e);for(let r=1;this.segments.length>r;r++)t?t=!1:e+=c.sep,e+=this.segments[r];return e}}})),p.register("e51CO",(function(e,t){"use strict";Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.SearchState=void 0,e.exports.SearchState=class{constructor(e,t){this.path=e,this.level=t}}})),p.register("c7nrF",(function(e,t){"use strict";var r=e.exports&&e.exports.__createBinding||(Object.create?(e,t,r,o)=>{void 0===o&&(o=r),Object.defineProperty(e,o,{enumerable:!0,get(){return t[r]}})}:(e,t,r,o)=>{void 0===o&&(o=r),e[o]=t[r]}),a=e.exports&&e.exports.__setModuleDefault||(Object.create?(e,t)=>{Object.defineProperty(e,"default",{enumerable:!0,value:t})}:(e,t)=>{e.default=t}),i=e.exports&&e.exports.__importStar||(e=>{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.hasOwnProperty.call(e,o)&&r(t,e,o);return a(t,e),t}),u=e.exports&&e.exports.__awaiter||((e,t,r,o)=>new(r||(r=Promise))(((s,a)=>{function n(e){try{c(o.next(e))}catch(e){a(e)}}function i(e){try{c(o.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((e=>{e(t)}))).then(n,i)}c((o=o.apply(e,t||[])).next())}))),h=e.exports&&e.exports.__asyncValues||function(e){function t(t){r[t]=e[t]&&(r=>new Promise(((o,s)=>{((e,t,r,o)=>{Promise.resolve(o).then((t=>{e({value:t,done:r})}),t)})(o,s,(r=e[t](r)).done,r.value)})))}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=e[Symbol.asyncIterator];return o?o.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),r={},t("next"),t("throw"),t("return"),r[Symbol.asyncIterator]=function(){return this},r)};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.hashFiles=void 0;const d=i(c),f=i(p("9bqVn")),m=i(n),y=i(l),b=i(o),g=i(s);e.exports.hashFiles=function(e){var t,r,o;return u(this,void 0,void 0,(function*(){let s=!1;const a=null!==(o=process.env.GITHUB_WORKSPACE)&&void 0!==o?o:process.cwd(),n=d.createHash("sha256");let i=0;try{for(var c,l=h(e.globGenerator());!(c=yield l.next()).done;){const e=c.value;if(f.debug(e),!e.startsWith(`${a}${g.sep}`)){f.debug(`Ignore '${e}' since it is not under GITHUB_WORKSPACE.`);continue}if(m.statSync(e).isDirectory()){f.debug(`Skip directory '${e}'.`);continue}const t=d.createHash("sha256"),r=b.promisify(y.pipeline);yield r(m.createReadStream(e),t),n.write(t.digest()),i++,s||(s=!0)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=l.return)&&(yield r.call(l))}finally{if(t)throw t.error}}return n.end(),s?(f.debug(`Found ${i} files to hash.`),n.digest("hex")):(f.debug("No matches found for glob"),"")}))}})),p.register("c3SoR",(function(t,r){e(t.exports,"default",(()=>n));var o=p("lwNDb"),s=p("9bqVn");let a;(e=>{e.STATE_CACHE_PRIMARY_KEY="cache-primary-key",e.CACHE_MATCHED_KEY="cache-matched-key",e.CACHE_PATHS="cache-paths"})(a||(a={}));var n=class{constructor(e,t){this.packageManager=e,this.cacheDependencyPath=t,this.CACHE_KEY_PREFIX="setup-python"}async restoreCache(){const{primaryKey:e,restoreKey:t}=await this.computeKeys();if(e.endsWith("-"))throw Error(`No file in ${process.cwd()} matched to [${this.cacheDependencyPath.split("\n").join(",")}], make sure you have checked out the target repository`);const r=await this.getCacheGlobalDirectories();s.saveState(a.CACHE_PATHS,r),s.saveState(a.STATE_CACHE_PRIMARY_KEY,e);const n=await o.restoreCache(r,e,t);this.handleMatchResult(n,e)}handleMatchResult(e,t){e?(s.saveState(a.CACHE_MATCHED_KEY,e),s.info("Cache restored from key: "+e)):s.info(this.packageManager+" cache is not found"),s.setOutput("cache-hit",e===t)}}})),p.register("gyWii",(function(t,r){e(t.exports,"default",(()=>c));var o=p("b5WCL"),n=p("9bqVn"),i=p("c3SoR"),c=class extends i.default{constructor(e,t="**/Pipfile.lock"){super("pipenv",t),this.pythonVersion=e,this.patterns=t}async getCacheGlobalDirectories(){let e;e="win32"===process.platform?".virtualenvs":".local/share/virtualenvs";const t=s.join(a.homedir(),e);return n.debug("global cache directory path is "+t),[t]}async computeKeys(){const e=await o.hashFiles(this.patterns);return{primaryKey:`${this.CACHE_KEY_PREFIX}-${process.env.RUNNER_OS}-python-${this.pythonVersion}-${this.packageManager}-${e}`,restoreKey:void 0}}}})),p.register("9rlmk",(function(t,r){e(t.exports,"default",(()=>i));var o=p("b5WCL"),a=p("ca0ts"),n=p("c3SoR"),i=class extends n.default{constructor(e,t="**/poetry.lock"){super("poetry",t),this.pythonVersion=e,this.patterns=t}async getCacheGlobalDirectories(){const e=await this.getPoetryConfiguration(),t=[e["virtualenvs.path"].replace("{cache-dir}",e["cache-dir"])];return!0===e["virtualenvs.in-project"]&&t.push(s.join(process.cwd(),".venv")),t}async computeKeys(){const e=await o.hashFiles(this.patterns);return{primaryKey:`${this.CACHE_KEY_PREFIX}-${process.env.RUNNER_OS}-python-${this.pythonVersion}-${this.packageManager}-${e}`,restoreKey:void 0}}async getPoetryConfiguration(){const{stdout:e,stderr:t,exitCode:r}=await a.getExecOutput("poetry",["config","--list"]);if(r&&t)throw Error("Could not get cache folder path for poetry package manager");const o=e.trim().split("\n"),s={};for(let e of o){e=e.replace(/#.*$/,"");const[t,r]=e.split("=").map((e=>e.trim()));s[t]=JSON.parse(r)}return s}}})); +//# sourceMappingURL=cache-factory.8ad1a0d1.js.map diff --git a/dist/cache-factory.8ad1a0d1.js.map b/dist/cache-factory.8ad1a0d1.js.map new file mode 100644 index 00000000..248d17f4 --- /dev/null +++ b/dist/cache-factory.8ad1a0d1.js.map @@ -0,0 +1 @@ +{"mappings":"4eAUO,SAASA,EACdC,EACAC,EACAC,GAEA,OAAQF,GACN,KAAKG,EAAgBC,IACnB,OAAO,IAAIC,EAAAC,QAASL,EAAeC,GACrC,KAAKC,EA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ACEkD,SAAAA,EAKZjC,kCACE,MAAMyP,QAAqB/N,KAAKgO,yBAQ1BC,EAAQ,CALUF,EAAa,oBAAoB9I,QACvD,cAFe8I,EAAa,eAY9B,OAJ+C,IAA3CA,EAAa,2BACfE,EAAM3L,KAAK/C,EAAAC,KAAUW,QAAQwH,MAAO,UAG/BsG,EAGT3P,oBACE,MAAMwB,QAAa7B,EAAA8B,UAAeC,KAAKO,UAGvC,MAAO,CArCXN,WAmCuB,GAAGD,KAAKE,oBAAoBC,QAAQC,IAAe,oBAAYJ,KAAK3C,iBAAiB2C,KAAK5C,kBAAkB0C,IAnCnIO,gBAoCuBwN,GAOrBvP,+BACE,MA5CJE,OA4CWA,EA5CXC,OA4CmBA,EA5CnBF,SA4C2BA,SAAkBW,EAAAC,cAAmB,SAAU,CACpE,SACA,WAGF,GAAIZ,GAAYE,EACd,MAAUV,MACR,8DAIJ,MAAMmH,EAAQ1G,EAAOa,OAAO8F,MAAM,MAE5B+I,EAAc,GAEpB,IAAK,IAAI9I,KAAQF,EAAO,CACtBE,EAAOA,EAAKH,QAAO,OAAS,IAE5B,MAAOmB,EAAK7D,GAAS6C,EAAKD,MAAM,KAAKP,KAAIuJ,GAAQA,EAAK9O,SAEtD6O,EAAO9H,GAAOgI,KAAKC,MAAM9L,GAG3B,OAAO2L","sources":["node_modules/.pnpm/github.com+actions+setup-python@98f2ad02fd48d057ee3b4d4f66525b231c3e52b6/node_modules/setup-python/src/cache-distributions/cache-factory.ts","node_modules/.pnpm/github.com+actions+setup-python@98f2ad02fd48d057ee3b4d4f66525b231c3e52b6/node_modules/setup-python/src/cache-distributions/pip-cache.ts","node_modules/.pnpm/@actions+glob@0.2.1/node_modules/@actions/glob/src/glob.ts","node_modules/.pnpm/@actions+glob@0.2.1/node_modules/@actions/glob/src/internal-globber.ts","node_modules/.pnpm/@actions+glob@0.2.1/node_modules/@actions/glob/src/internal-glob-options-helper.ts","node_modules/.pnpm/@actions+glob@0.2.1/node_modules/@actions/glob/src/internal-pattern-helper.ts","node_modules/.pnpm/@actions+glob@0.2.1/node_modules/@actions/glob/src/internal-path-helper.ts","node_modules/.pnpm/@actions+glob@0.2.1/node_modules/@actions/glob/src/internal-match-kind.ts","node_modules/.pnpm/@actions+glob@0.2.1/node_modules/@actions/glob/src/internal-pattern.ts","node_modules/.pnpm/@actions+glob@0.2.1/node_modules/@actions/glob/src/internal-path.ts","node_modules/.pnpm/@actions+glob@0.2.1/node_modules/@actions/glob/src/internal-search-state.ts","node_modules/.pnpm/@actions+glob@0.2.1/node_modules/@actions/glob/src/internal-hash-files.ts","node_modules/.pnpm/github.com+actions+setup-python@98f2ad02fd48d057ee3b4d4f66525b231c3e52b6/node_modules/setup-python/src/cache-distributions/cache-distributor.ts","node_modules/.pnpm/github.com+actions+setup-python@98f2ad02fd48d057ee3b4d4f66525b231c3e52b6/node_modules/setup-python/src/cache-distributions/pipenv-cache.ts","node_modules/.pnpm/github.com+actions+setup-python@98f2ad02fd48d057ee3b4d4f66525b231c3e52b6/node_modules/setup-python/src/cache-distributions/poetry-cache.ts"],"sourcesContent":["import PipCache from './pip-cache';\nimport PipenvCache from './pipenv-cache';\nimport PoetryCache from './poetry-cache';\n\nexport enum PackageManagers {\n Pip = 'pip',\n Pipenv = 'pipenv',\n Poetry = 'poetry'\n}\n\nexport function getCacheDistributor(\n packageManager: string,\n pythonVersion: string,\n cacheDependencyPath: string | undefined\n) {\n switch (packageManager) {\n case PackageManagers.Pip:\n return new PipCache(pythonVersion, cacheDependencyPath);\n case PackageManagers.Pipenv:\n return new PipenvCache(pythonVersion, cacheDependencyPath);\n case PackageManagers.Poetry:\n return new PoetryCache(pythonVersion, cacheDependencyPath);\n default:\n throw new Error(`Caching for '${packageManager}' is not supported`);\n }\n}\n","import * as glob from '@actions/glob';\nimport * as core from '@actions/core';\nimport * as exec from '@actions/exec';\nimport * as child_process from 'child_process';\nimport utils from 'util';\nimport * as path from 'path';\nimport os from 'os';\n\nimport CacheDistributor from './cache-distributor';\nimport {IS_WINDOWS} from '../utils';\n\nclass PipCache extends CacheDistributor {\n constructor(\n private pythonVersion: string,\n cacheDependencyPath: string = '**/requirements.txt'\n ) {\n super('pip', cacheDependencyPath);\n }\n\n protected async getCacheGlobalDirectories() {\n let exitCode = 1;\n let stdout = '';\n let stderr = '';\n\n // Add temporary fix for Windows\n // On windows it is necessary to execute through an exec\n // because the getExecOutput gives a non zero code or writes to stderr for pip 22.0.2,\n // or spawn must be started with the shell option enabled for getExecOutput\n // Related issue: https://github.com/actions/setup-python/issues/328\n if (IS_WINDOWS) {\n const execPromisify = utils.promisify(child_process.exec);\n ({stdout: stdout, stderr: stderr} = await execPromisify('pip cache dir'));\n } else {\n ({\n stdout: stdout,\n stderr: stderr,\n exitCode: exitCode\n } = await exec.getExecOutput('pip cache dir'));\n }\n\n if (exitCode && stderr) {\n throw new Error(\n `Could not get cache folder path for pip package manager`\n );\n }\n\n let resolvedPath = stdout.trim();\n\n if (resolvedPath.includes('~')) {\n resolvedPath = path.join(os.homedir(), resolvedPath.slice(1));\n }\n\n core.debug(`global cache directory path is ${resolvedPath}`);\n\n return [resolvedPath];\n }\n\n protected async computeKeys() {\n const hash = await glob.hashFiles(this.cacheDependencyPath);\n const primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;\n const restoreKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-python-${this.pythonVersion}-${this.packageManager}`;\n\n return {\n primaryKey,\n restoreKey: [restoreKey]\n };\n }\n}\n\nexport default PipCache;\n",null,null,null,null,null,null,null,null,null,null,"import * as cache from '@actions/cache';\nimport * as core from '@actions/core';\n\nexport enum State {\n STATE_CACHE_PRIMARY_KEY = 'cache-primary-key',\n CACHE_MATCHED_KEY = 'cache-matched-key',\n CACHE_PATHS = 'cache-paths'\n}\n\nabstract class CacheDistributor {\n protected CACHE_KEY_PREFIX = 'setup-python';\n constructor(\n protected packageManager: string,\n protected cacheDependencyPath: string\n ) {}\n\n protected abstract getCacheGlobalDirectories(): Promise;\n protected abstract computeKeys(): Promise<{\n primaryKey: string;\n restoreKey: string[] | undefined;\n }>;\n\n public async restoreCache() {\n const {primaryKey, restoreKey} = await this.computeKeys();\n if (primaryKey.endsWith('-')) {\n throw new Error(\n `No file in ${process.cwd()} matched to [${this.cacheDependencyPath\n .split('\\n')\n .join(',')}], make sure you have checked out the target repository`\n );\n }\n\n const cachePath = await this.getCacheGlobalDirectories();\n\n core.saveState(State.CACHE_PATHS, cachePath);\n core.saveState(State.STATE_CACHE_PRIMARY_KEY, primaryKey);\n\n const matchedKey = await cache.restoreCache(\n cachePath,\n primaryKey,\n restoreKey\n );\n\n this.handleMatchResult(matchedKey, primaryKey);\n }\n\n public handleMatchResult(matchedKey: string | undefined, primaryKey: string) {\n if (matchedKey) {\n core.saveState(State.CACHE_MATCHED_KEY, matchedKey);\n core.info(`Cache restored from key: ${matchedKey}`);\n } else {\n core.info(`${this.packageManager} cache is not found`);\n }\n core.setOutput('cache-hit', matchedKey === primaryKey);\n }\n}\n\nexport default CacheDistributor;\n","import * as glob from '@actions/glob';\nimport * as os from 'os';\nimport * as path from 'path';\nimport * as core from '@actions/core';\n\nimport CacheDistributor from './cache-distributor';\n\nclass PipenvCache extends CacheDistributor {\n constructor(\n private pythonVersion: string,\n protected patterns: string = '**/Pipfile.lock'\n ) {\n super('pipenv', patterns);\n }\n\n protected async getCacheGlobalDirectories() {\n let virtualEnvRelativePath;\n\n // Default virtualenv directories are hardcoded,\n // because pipenv is not preinstalled on hosted images and virtualenv is not created:\n // https://github.com/pypa/pipenv/blob/1daaa0de9a0b00d386c6baeb809d8d4ee6795cfd/pipenv/utils.py#L1990-L2002\n if (process.platform === 'win32') {\n virtualEnvRelativePath = '.virtualenvs';\n } else {\n virtualEnvRelativePath = '.local/share/virtualenvs';\n }\n const resolvedPath = path.join(os.homedir(), virtualEnvRelativePath);\n core.debug(`global cache directory path is ${resolvedPath}`);\n\n return [resolvedPath];\n }\n\n protected async computeKeys() {\n const hash = await glob.hashFiles(this.patterns);\n const primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;\n const restoreKey = undefined;\n return {\n primaryKey,\n restoreKey\n };\n }\n}\n\nexport default PipenvCache;\n","import * as glob from '@actions/glob';\nimport * as os from 'os';\nimport * as path from 'path';\nimport * as exec from '@actions/exec';\n\nimport CacheDistributor from './cache-distributor';\n\nclass PoetryCache extends CacheDistributor {\n constructor(\n private pythonVersion: string,\n protected patterns: string = '**/poetry.lock'\n ) {\n super('poetry', patterns);\n }\n\n protected async getCacheGlobalDirectories() {\n const poetryConfig = await this.getPoetryConfiguration();\n\n const cacheDir = poetryConfig['cache-dir'];\n const virtualenvsPath = poetryConfig['virtualenvs.path'].replace(\n '{cache-dir}',\n cacheDir\n );\n\n const paths = [virtualenvsPath];\n\n if (poetryConfig['virtualenvs.in-project'] === true) {\n paths.push(path.join(process.cwd(), '.venv'));\n }\n\n return paths;\n }\n\n protected async computeKeys() {\n const hash = await glob.hashFiles(this.patterns);\n const primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;\n const restoreKey = undefined;\n return {\n primaryKey,\n restoreKey\n };\n }\n\n private async getPoetryConfiguration() {\n const {stdout, stderr, exitCode} = await exec.getExecOutput('poetry', [\n 'config',\n '--list'\n ]);\n\n if (exitCode && stderr) {\n throw new Error(\n 'Could not get cache folder path for poetry package manager'\n );\n }\n\n const lines = stdout.trim().split('\\n');\n\n const config: any = {};\n\n for (let line of lines) {\n line = line.replace(/#.*$/, '');\n\n const [key, value] = line.split('=').map(part => part.trim());\n\n config[key] = JSON.parse(value);\n }\n\n return config as {\n 'cache-dir': string;\n 'virtualenvs.in-project': boolean;\n 'virtualenvs.path': string;\n };\n }\n}\n\nexport default PoetryCache;\n"],"names":["$a80505c8137e72d5$export$a69587775d1d8aae","packageManager","pythonVersion","cacheDependencyPath","$a80505c8137e72d5$export$150e8fc98ea6f32f","Pip","$5p0V2","default","Pipenv","$gyWii","Poetry","$9rlmk","Error","parcelRequire","$b5WCL","$74a60ce38fff9598$export$2e2bcd8739ae039","$c3SoR","constructor","super","async","exitCode","stdout","stderr","$3Mp5H","IS_WINDOWS","execPromisify","$parcel$interopDefault","$5Kpnh$util","promisify","$5Kpnh$child_process","exec","$ca0ts","getExecOutput","resolvedPath","trim","includes","$5Kpnh$path","join","$5Kpnh$os","homedir","slice","$9bqVn","debug","hash","hashFiles","this","primaryKey","CACHE_KEY_PREFIX","process","env","restoreKey","$813da2e51fd92cc8$var$create","patterns","options","$2LsYP","DefaultGlobber","create","module","exports","followSymbolicLinks","globber","$c7nrF","$2036736610e6ad99$var$core","$2036736610e6ad99$var$__importStar","$2036736610e6ad99$var$fs","$5Kpnh$fs","$2036736610e6ad99$var$globOptionsHelper","$2036736610e6ad99$var$path","$2036736610e6ad99$var$patternHelper","$2036736610e6ad99$var$IS_WINDOWS","platform","$2036736610e6ad99$var$DefaultGlobber","searchPaths","getOptions","getSearchPaths","glob","result","_c","_b","$2036736610e6ad99$var$__asyncValues","globGenerator","next","done","push","value","pattern","implicitDescendants","trailingSeparator","segments","length","$9aW8w","Pattern","negate","concat","stack","searchPath","$2036736610e6ad99$var$__await","promises","lstat","err","code","unshift","$e51CO","SearchState","traversalChain","item","pop","match","path","partialMatch","stats","stat","isDirectory","$iOrzV","MatchKind","Directory","matchDirectories","childLevel","level","childItems","readdir","map","x","reverse","File","static","replace","lines","split","line","startsWith","omitBrokenSymbolicLinks","realPath","realpath","some","$d7a6b29e5cd7dc52$var$core","$d7a6b29e5cd7dc52$var$__importStar","copy","$859e1e40578bfff4$var$pathHelper","$859e1e40578bfff4$var$__importStar","$859e1e40578bfff4$var$IS_WINDOWS","filter","searchPathMap","toUpperCase","pattern1","key","foundAncestor","tempKey","parent","dirname","itemPath","None","$7fae9946df676070$var$hasAbsoluteRoot","$7fae9946df676070$var$assert_1","$7fae9946df676070$var$normalizeSeparators","$7fae9946df676070$var$IS_WINDOWS","test","p","$7fae9946df676070$var$safeTrimTrailingSeparator","endsWith","$7fae9946df676070$var$path","sep","substr","$7fae9946df676070$var$__importStar","$7fae9946df676070$var$__importDefault","$5Kpnh$assert","ensureAbsoluteRoot","root","cwd","hasAbsoluteRoot","hasRoot","normalizeSeparators","safeTrimTrailingSeparator","$6ae224ea6e46bf0e$var$os","$6ae224ea6e46bf0e$var$__importStar","$6ae224ea6e46bf0e$var$path","$6ae224ea6e46bf0e$var$pathHelper","$6ae224ea6e46bf0e$var$assert_1","$6ae224ea6e46bf0e$var$__importDefault","$6ae224ea6e46bf0e$var$IS_WINDOWS","$6ae224ea6e46bf0e$var$Pattern","patternOrNegate","isImplicitPattern","getLiteral","$i7Uxm","Path","fixupPattern","foundGlob","searchSegments","rootRegExp","RegExp","regExpEscape","minimatchOptions","dot","nobrace","nocase","nocomment","noext","nonegate","minimatch","$5RQ11","Minimatch","All","matchOne","set","s","literalSegments","every","i","globEscape","segment","literal","c","closed","i2","c2","$d324bc816fc48e7a$var$path","$d324bc816fc48e7a$var$__importStar","$d324bc816fc48e7a$var$pathHelper","$d324bc816fc48e7a$var$assert_1","$d324bc816fc48e7a$var$__importDefault","$d324bc816fc48e7a$var$IS_WINDOWS","remaining","dir","basename","toString","skipSlash","$0246d80d32367c4d$var$crypto","$0246d80d32367c4d$var$__importStar","$5Kpnh$crypto","$0246d80d32367c4d$var$core","$0246d80d32367c4d$var$fs","$0246d80d32367c4d$var$stream","$5Kpnh$stream","$0246d80d32367c4d$var$util","$0246d80d32367c4d$var$path","hasMatch","githubWorkspace","createHash","count","_d","$0246d80d32367c4d$var$__asyncValues","file","statSync","pipeline","createReadStream","write","digest","end","$lwNDb","$67075960fd2a3751$export$7254cc27399e90bd","$67075960fd2a3751$export$2e2bcd8739ae039","computeKeys","cachePath","getCacheGlobalDirectories","saveState","CACHE_PATHS","STATE_CACHE_PRIMARY_KEY","matchedKey","restoreCache","handleMatchResult","CACHE_MATCHED_KEY","info","setOutput","$747adf5cb8f42b9c$export$2e2bcd8739ae039","virtualEnvRelativePath","undefined","$dbc3e31cefa4c000$export$2e2bcd8739ae039","poetryConfig","getPoetryConfiguration","paths","config","part","JSON","parse"],"version":3,"file":"cache-factory.8ad1a0d1.js.map","sourceRoot":"../"} \ No newline at end of file diff --git a/dist/cache.32a23f6d.js b/dist/cache.32a23f6d.js new file mode 100644 index 00000000..a8af950d --- /dev/null +++ b/dist/cache.32a23f6d.js @@ -0,0 +1,2 @@ +function e(e,t,r,o){Object.defineProperty(e,t,{get:r,set:o,enumerable:!0,configurable:!0})}function t(e){return e&&e.__esModule?e.default:e}var r=require("child_process"),o=require("util"),s=require("path"),a=require("os"),i=require("fs"),n=require("assert"),c=require("crypto"),l=require("stream"),p=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).parcelRequire810d;p.register("iNHnD",((t,r)=>{async function o(e,t){if(s.isCacheFeatureAvailable()){const r=a.getCacheDistributor(e,t,void 0);await r.restoreCache()}}e(t.exports,"cacheDependencies",(()=>o));var s=p("3Mp5H"),a=p("tIILP")})),p.register("tIILP",((t,r)=>{function o(e,t,r){switch(e){case n.Pip:return new s.default(t,r);case n.Pipenv:return new a.default(t,r);case n.Poetry:return new i.default(t,r);default:throw Error(`Caching for '${e}' is not supported`)}}e(t.exports,"getCacheDistributor",(()=>o));var s=p("5p0V2"),a=p("gyWii"),i=p("9rlmk");let n;(e=>{e.Pip="pip",e.Pipenv="pipenv",e.Poetry="poetry"})(n||(n={}))})),p.register("5p0V2",(function(i,n){e(i.exports,"default",(()=>f));var c=p("b5WCL"),l=p("9bqVn"),u=p("ca0ts"),h=p("c3SoR"),d=p("3Mp5H"),f=class extends h.default{constructor(e,t="**/requirements.txt"){super("pip",t),this.pythonVersion=e}async getCacheGlobalDirectories(){let e=1,i="",n="";if(d.IS_WINDOWS){const e=t(o).promisify(r.exec);({stdout:i,stderr:n}=await e("pip cache dir"))}else({stdout:i,stderr:n,exitCode:e}=await u.getExecOutput("pip cache dir"));if(e&&n)throw Error("Could not get cache folder path for pip package manager");let c=i.trim();return c.includes("~")&&(c=s.join(t(a).homedir(),c.slice(1))),l.debug("global cache directory path is "+c),[c]}async computeKeys(){const e=await c.hashFiles(this.cacheDependencyPath);return{primaryKey:`${this.CACHE_KEY_PREFIX}-${process.env.RUNNER_OS}-python-${this.pythonVersion}-${this.packageManager}-${e}`,restoreKey:[`${this.CACHE_KEY_PREFIX}-${process.env.RUNNER_OS}-python-${this.pythonVersion}-${this.packageManager}`]}}}})),p.register("b5WCL",(function(e,t){"use strict";function r(e,t){return o(this,void 0,void 0,(function*(){return yield s.DefaultGlobber.create(e,t)}))}var o=e.exports&&e.exports.__awaiter||((e,t,r,o)=>new(r||(r=Promise))(((s,a)=>{function i(e){try{c(o.next(e))}catch(e){a(e)}}function n(e){try{c(o.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((e=>{e(t)}))).then(i,n)}c((o=o.apply(e,t||[])).next())})));Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.hashFiles=e.exports.create=void 0;var s=p("2LsYP"),a=p("c7nrF");e.exports.create=r,e.exports.hashFiles=function(e,t){return o(this,void 0,void 0,(function*(){let o=!0;t&&"boolean"==typeof t.followSymbolicLinks&&(o=t.followSymbolicLinks);const s=yield r(e,{followSymbolicLinks:o});return a.hashFiles(s)}))}})),p.register("2LsYP",(function(e,t){"use strict";var r=e.exports&&e.exports.__createBinding||(Object.create?(e,t,r,o)=>{void 0===o&&(o=r),Object.defineProperty(e,o,{enumerable:!0,get(){return t[r]}})}:(e,t,r,o)=>{void 0===o&&(o=r),e[o]=t[r]}),o=e.exports&&e.exports.__setModuleDefault||(Object.create?(e,t)=>{Object.defineProperty(e,"default",{enumerable:!0,value:t})}:(e,t)=>{e.default=t}),a=e.exports&&e.exports.__importStar||(e=>{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.hasOwnProperty.call(e,s)&&r(t,e,s);return o(t,e),t}),n=e.exports&&e.exports.__awaiter||((e,t,r,o)=>new(r||(r=Promise))(((s,a)=>{function i(e){try{c(o.next(e))}catch(e){a(e)}}function n(e){try{c(o.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((e=>{e(t)}))).then(i,n)}c((o=o.apply(e,t||[])).next())}))),c=e.exports&&e.exports.__asyncValues||function(e){function t(t){r[t]=e[t]&&(r=>new Promise(((o,s)=>{((e,t,r,o)=>{Promise.resolve(o).then((t=>{e({value:t,done:r})}),t)})(o,s,(r=e[t](r)).done,r.value)})))}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=e[Symbol.asyncIterator];return o?o.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),r={},t("next"),t("throw"),t("return"),r[Symbol.asyncIterator]=function(){return this},r)},l=e.exports&&e.exports.__await||function(e){return this instanceof l?(this.v=e,this):new l(e)},u=e.exports&&e.exports.__asyncGenerator||function(e,t,r){function o(e){p[e]&&(c[e]=t=>new Promise(((r,o)=>{u.push([e,t,r,o])>1||s(e,t)})))}function s(e,t){try{(r=p[e](t)).value instanceof l?Promise.resolve(r.value.v).then(a,i):n(u[0][2],r)}catch(e){n(u[0][3],e)}var r}function a(e){s("next",e)}function i(e){s("throw",e)}function n(e,t){e(t),u.shift(),u.length&&s(u[0][0],u[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var c,p=r.apply(e,t||[]),u=[];return c={},o("next"),o("throw"),o("return"),c[Symbol.asyncIterator]=function(){return this},c};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.DefaultGlobber=void 0;const h=a(p("9bqVn")),d=a(i),f=a(p("ivUaY")),m=a(s),y=a(p("btf6r"));var b=p("iOrzV"),g=p("9aW8w"),v=p("e51CO");const x="win32"===process.platform;class _{constructor(e){this.patterns=[],this.searchPaths=[],this.options=f.getOptions(e)}getSearchPaths(){return this.searchPaths.slice()}glob(){var e,t;return n(this,void 0,void 0,(function*(){const r=[];try{for(var o,s=c(this.globGenerator());!(o=yield s.next()).done;)r.push(o.value)}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=s.return)&&(yield t.call(s))}finally{if(e)throw e.error}}return r}))}globGenerator(){return u(this,arguments,(function*(){const e=f.getOptions(this.options),t=[];for(const r of this.patterns)t.push(r),e.implicitDescendants&&(r.trailingSeparator||"**"!==r.segments[r.segments.length-1])&&t.push(new g.Pattern(r.negate,!0,r.segments.concat("**")));const r=[];for(const e of y.getSearchPaths(t)){h.debug(`Search path '${e}'`);try{yield l(d.promises.lstat(e))}catch(e){if("ENOENT"===e.code)continue;throw e}r.unshift(new v.SearchState(e,1))}const o=[];for(;r.length;){const s=r.pop(),a=y.match(t,s.path),i=!!a||y.partialMatch(t,s.path);if(!a&&!i)continue;const n=yield l(_.stat(s,e,o));if(n)if(n.isDirectory()){if(a&b.MatchKind.Directory&&e.matchDirectories)yield yield l(s.path);else if(!i)continue;const t=s.level+1,o=(yield l(d.promises.readdir(s.path))).map((e=>new v.SearchState(m.join(s.path,e),t)));r.push(...o.reverse())}else a&b.MatchKind.File&&(yield yield l(s.path))}}))}static create(e,t){return n(this,void 0,void 0,(function*(){const r=new _(t);x&&(e=(e=e.replace(/\r\n/g,"\n")).replace(/\r/g,"\n"));const o=e.split("\n").map((e=>e.trim()));for(const e of o)e&&!e.startsWith("#")&&r.patterns.push(new g.Pattern(e));return r.searchPaths.push(...y.getSearchPaths(r.patterns)),r}))}static stat(e,t,r){return n(this,void 0,void 0,(function*(){let o;if(t.followSymbolicLinks)try{o=yield d.promises.stat(e.path)}catch(r){if("ENOENT"===r.code){if(t.omitBrokenSymbolicLinks)return void h.debug(`Broken symlink '${e.path}'`);throw Error(`No information found for the path '${e.path}'. This may indicate a broken symbolic link.`)}throw r}else o=yield d.promises.lstat(e.path);if(o.isDirectory()&&t.followSymbolicLinks){const t=yield d.promises.realpath(e.path);for(;r.length>=e.level;)r.pop();if(r.some((e=>e===t)))return void h.debug(`Symlink cycle detected for path '${e.path}' and realpath '${t}'`);r.push(t)}return o}))}}e.exports.DefaultGlobber=_})),p.register("ivUaY",((e,t)=>{"use strict";var r=e.exports&&e.exports.__createBinding||(Object.create?(e,t,r,o)=>{void 0===o&&(o=r),Object.defineProperty(e,o,{enumerable:!0,get(){return t[r]}})}:(e,t,r,o)=>{void 0===o&&(o=r),e[o]=t[r]}),o=e.exports&&e.exports.__setModuleDefault||(Object.create?(e,t)=>{Object.defineProperty(e,"default",{enumerable:!0,value:t})}:(e,t)=>{e.default=t}),s=e.exports&&e.exports.__importStar||(e=>{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.hasOwnProperty.call(e,s)&&r(t,e,s);return o(t,e),t});Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.getOptions=void 0;const a=s(p("9bqVn"));e.exports.getOptions=e=>{const t={followSymbolicLinks:!0,implicitDescendants:!0,matchDirectories:!0,omitBrokenSymbolicLinks:!0};return e&&("boolean"==typeof e.followSymbolicLinks&&(t.followSymbolicLinks=e.followSymbolicLinks,a.debug(`followSymbolicLinks '${t.followSymbolicLinks}'`)),"boolean"==typeof e.implicitDescendants&&(t.implicitDescendants=e.implicitDescendants,a.debug(`implicitDescendants '${t.implicitDescendants}'`)),"boolean"==typeof e.matchDirectories&&(t.matchDirectories=e.matchDirectories,a.debug(`matchDirectories '${t.matchDirectories}'`)),"boolean"==typeof e.omitBrokenSymbolicLinks&&(t.omitBrokenSymbolicLinks=e.omitBrokenSymbolicLinks,a.debug(`omitBrokenSymbolicLinks '${t.omitBrokenSymbolicLinks}'`))),t}})),p.register("btf6r",((e,t)=>{"use strict";var r=e.exports&&e.exports.__createBinding||(Object.create?(e,t,r,o)=>{void 0===o&&(o=r),Object.defineProperty(e,o,{enumerable:!0,get(){return t[r]}})}:(e,t,r,o)=>{void 0===o&&(o=r),e[o]=t[r]}),o=e.exports&&e.exports.__setModuleDefault||(Object.create?(e,t)=>{Object.defineProperty(e,"default",{enumerable:!0,value:t})}:(e,t)=>{e.default=t}),s=e.exports&&e.exports.__importStar||(e=>{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.hasOwnProperty.call(e,s)&&r(t,e,s);return o(t,e),t});Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.partialMatch=e.exports.match=e.exports.getSearchPaths=void 0;const a=s(p("aXEcz"));var i=p("iOrzV");const n="win32"===process.platform;e.exports.getSearchPaths=e=>{e=e.filter((e=>!e.negate));const t={};for(const r of e)t[n?r.searchPath.toUpperCase():r.searchPath]="candidate";const r=[];for(const o of e){const e=n?o.searchPath.toUpperCase():o.searchPath;if("included"===t[e])continue;let s=!1,i=e,c=a.dirname(i);for(;c!==i;){if(t[c]){s=!0;break}i=c,c=a.dirname(i)}s||(r.push(o.searchPath),t[e]="included")}return r},e.exports.match=(e,t)=>{let r=i.MatchKind.None;for(const o of e)o.negate?r&=~o.match(t):r|=o.match(t);return r},e.exports.partialMatch=(e,t)=>e.some((e=>!e.negate&&e.partialMatch(t)))})),p.register("aXEcz",((e,t)=>{"use strict";function r(e){return h.default(e,"hasAbsoluteRoot parameter 'itemPath' must not be empty"),e=o(e),d?e.startsWith("\\\\")||/^[A-Z]:\\/i.test(e):e.startsWith("/")}function o(e){return e=e||"",d?(e=e.replace(/\//g,"\\"),(/^\\\\+[^\\]/.test(e)?"\\":"")+e.replace(/\\\\+/g,"\\")):e.replace(/\/\/+/g,"/")}function a(e){return e?(e=o(e)).endsWith(u.sep)?e===u.sep||d&&/^[A-Z]:\\$/i.test(e)?e:e.substr(0,e.length-1):e:""}var i=e.exports&&e.exports.__createBinding||(Object.create?(e,t,r,o)=>{void 0===o&&(o=r),Object.defineProperty(e,o,{enumerable:!0,get(){return t[r]}})}:(e,t,r,o)=>{void 0===o&&(o=r),e[o]=t[r]}),c=e.exports&&e.exports.__setModuleDefault||(Object.create?(e,t)=>{Object.defineProperty(e,"default",{enumerable:!0,value:t})}:(e,t)=>{e.default=t}),l=e.exports&&e.exports.__importStar||(e=>{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return c(t,e),t}),p=e.exports&&e.exports.__importDefault||(e=>e&&e.__esModule?e:{default:e});Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.safeTrimTrailingSeparator=e.exports.normalizeSeparators=e.exports.hasRoot=e.exports.hasAbsoluteRoot=e.exports.ensureAbsoluteRoot=e.exports.dirname=void 0;const u=l(s),h=p(n),d="win32"===process.platform;e.exports.dirname=e=>{if(e=a(e),d&&/^\\\\[^\\]+(\\[^\\]+)?$/.test(e))return e;let t=u.dirname(e);return d&&/^\\\\[^\\]+\\[^\\]+\\$/.test(t)&&(t=a(t)),t},e.exports.ensureAbsoluteRoot=(e,t)=>{if(h.default(e,"ensureAbsoluteRoot parameter 'root' must not be empty"),h.default(t,"ensureAbsoluteRoot parameter 'itemPath' must not be empty"),r(t))return t;if(d){if(t.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)){let e=process.cwd();return h.default(e.match(/^[A-Z]:\\/i),`Expected current directory to start with an absolute drive root. Actual '${e}'`),t[0].toUpperCase()===e[0].toUpperCase()?2===t.length?`${t[0]}:\\${e.substr(3)}`:(e.endsWith("\\")||(e+="\\"),`${t[0]}:\\${e.substr(3)}${t.substr(2)}`):`${t[0]}:\\${t.substr(2)}`}if(o(t).match(/^\\$|^\\[^\\]/)){const e=process.cwd();return h.default(e.match(/^[A-Z]:\\/i),`Expected current directory to start with an absolute drive root. Actual '${e}'`),`${e[0]}:\\${t.substr(1)}`}}return h.default(r(e),"ensureAbsoluteRoot parameter 'root' must have an absolute root"),e.endsWith("/")||d&&e.endsWith("\\")||(e+=u.sep),e+t},e.exports.hasAbsoluteRoot=r,e.exports.hasRoot=e=>(h.default(e,"isRooted parameter 'itemPath' must not be empty"),e=o(e),d?e.startsWith("\\")||/^[A-Z]:/i.test(e):e.startsWith("/")),e.exports.normalizeSeparators=o,e.exports.safeTrimTrailingSeparator=a})),p.register("iOrzV",((e,t)=>{"use strict";var r;Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.MatchKind=void 0,(r=e.exports.MatchKind||(e.exports.MatchKind={}))[r.None=0]="None",r[r.Directory=1]="Directory",r[r.File=2]="File",r[r.All=3]="All"})),p.register("9aW8w",(function(e,t){"use strict";var r=e.exports&&e.exports.__createBinding||(Object.create?(e,t,r,o)=>{void 0===o&&(o=r),Object.defineProperty(e,o,{enumerable:!0,get(){return t[r]}})}:(e,t,r,o)=>{void 0===o&&(o=r),e[o]=t[r]}),o=e.exports&&e.exports.__setModuleDefault||(Object.create?(e,t)=>{Object.defineProperty(e,"default",{enumerable:!0,value:t})}:(e,t)=>{e.default=t}),i=e.exports&&e.exports.__importStar||(e=>{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.hasOwnProperty.call(e,s)&&r(t,e,s);return o(t,e),t}),c=e.exports&&e.exports.__importDefault||(e=>e&&e.__esModule?e:{default:e});Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.Pattern=void 0;const l=i(a),u=i(s),h=i(p("aXEcz")),d=c(n);var f=p("5RQ11"),m=p("iOrzV"),y=p("i7Uxm");const b="win32"===process.platform;class g{constructor(e,t=!1,r,o){let s;if(this.negate=!1,"string"==typeof e)s=e.trim();else{d.default((r=r||[]).length,"Parameter 'segments' must not empty");const t=g.getLiteral(r[0]);d.default(t&&h.hasAbsoluteRoot(t),"Parameter 'segments' first element must be a root path"),s=(""+new y.Path(r)).trim(),e&&(s="!"+s)}for(;s.startsWith("!");)this.negate=!this.negate,s=s.substr(1).trim();s=g.fixupPattern(s,o),this.segments=new y.Path(s).segments,this.trailingSeparator=h.normalizeSeparators(s).endsWith(u.sep),s=h.safeTrimTrailingSeparator(s);let a=!1;const i=this.segments.map((e=>g.getLiteral(e))).filter((e=>!a&&!(a=""===e)));this.searchPath=""+new y.Path(i),this.rootRegExp=RegExp(g.regExpEscape(i[0]),b?"i":""),this.isImplicitPattern=t;const n={dot:!0,nobrace:!0,nocase:b,nocomment:!0,noext:!0,nonegate:!0};s=b?s.replace(/\\/g,"/"):s,this.minimatch=new f.Minimatch(s,n)}match(e){return"**"===this.segments[this.segments.length-1]?(e=h.normalizeSeparators(e)).endsWith(u.sep)||!1!==this.isImplicitPattern||(e=`${e}${u.sep}`):e=h.safeTrimTrailingSeparator(e),this.minimatch.match(e)?this.trailingSeparator?m.MatchKind.Directory:m.MatchKind.All:m.MatchKind.None}partialMatch(e){return e=h.safeTrimTrailingSeparator(e),h.dirname(e)===e?this.rootRegExp.test(e):this.minimatch.matchOne(e.split(b?/\\+/:/\/+/),this.minimatch.set[0],!0)}static globEscape(e){return(b?e:e.replace(/\\/g,"\\\\")).replace(/(\[)(?=[^/]+\])/g,"[[]").replace(/\?/g,"[?]").replace(/\*/g,"[*]")}static fixupPattern(e,t){d.default(e,"pattern cannot be empty");const r=new y.Path(e).segments.map((e=>g.getLiteral(e)));if(d.default(r.every(((e,t)=>("."!==e||0===t)&&".."!==e)),`Invalid pattern '${e}'. Relative pathing '.' and '..' is not allowed.`),d.default(!h.hasRoot(e)||r[0],`Invalid pattern '${e}'. Root segment must not contain globs.`),"."===(e=h.normalizeSeparators(e))||e.startsWith("."+u.sep))e=g.globEscape(process.cwd())+e.substr(1);else if("~"===e||e.startsWith("~"+u.sep))t=t||l.homedir(),d.default(t,"Unable to determine HOME directory"),d.default(h.hasAbsoluteRoot(t),`Expected HOME directory to be a rooted path. Actual '${t}'`),e=g.globEscape(t)+e.substr(1);else if(b&&(e.match(/^[A-Z]:$/i)||e.match(/^[A-Z]:[^\\]/i))){let t=h.ensureAbsoluteRoot("C:\\dummy-root",e.substr(0,2));e.length>2&&!t.endsWith("\\")&&(t+="\\"),e=g.globEscape(t)+e.substr(2)}else if(b&&("\\"===e||e.match(/^\\[^\\]/))){let t=h.ensureAbsoluteRoot("C:\\dummy-root","\\");t.endsWith("\\")||(t+="\\"),e=g.globEscape(t)+e.substr(1)}else e=h.ensureAbsoluteRoot(g.globEscape(process.cwd()),e);return h.normalizeSeparators(e)}static getLiteral(e){let t="";for(let r=0;e.length>r;r++){const o=e[r];if("\\"!==o||b||r+1>=e.length){if("*"===o||"?"===o)return"";if("["===o&&e.length>r+1){let o="",s=-1;for(let t=r+1;e.length>t;t++){const r=e[t];if("\\"!==r||b||t+1>=e.length){if("]"===r){s=t;break}o+=r}else o+=e[++t]}if(s>=0){if(o.length>1)return"";if(o){t+=o,r=s;continue}}}t+=o}else t+=e[++r]}return t}static regExpEscape(e){return e.replace(/[[\\^$.|?*+()]/g,"\\$&")}}e.exports.Pattern=g})),p.register("i7Uxm",(function(e,t){"use strict";var r=e.exports&&e.exports.__createBinding||(Object.create?(e,t,r,o)=>{void 0===o&&(o=r),Object.defineProperty(e,o,{enumerable:!0,get(){return t[r]}})}:(e,t,r,o)=>{void 0===o&&(o=r),e[o]=t[r]}),o=e.exports&&e.exports.__setModuleDefault||(Object.create?(e,t)=>{Object.defineProperty(e,"default",{enumerable:!0,value:t})}:(e,t)=>{e.default=t}),a=e.exports&&e.exports.__importStar||(e=>{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.hasOwnProperty.call(e,s)&&r(t,e,s);return o(t,e),t}),i=e.exports&&e.exports.__importDefault||(e=>e&&e.__esModule?e:{default:e});Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.Path=void 0;const c=a(s),l=a(p("aXEcz")),u=i(n),h="win32"===process.platform;e.exports.Path=class{constructor(e){if(this.segments=[],"string"==typeof e)if(u.default(e,"Parameter 'itemPath' must not be empty"),e=l.safeTrimTrailingSeparator(e),l.hasRoot(e)){let t=e,r=l.dirname(t);for(;r!==t;){const e=c.basename(t);this.segments.unshift(e),t=r,r=l.dirname(t)}this.segments.unshift(t)}else this.segments=e.split(c.sep);else{u.default(e.length>0,"Parameter 'itemPath' must not be an empty array");for(let t=0;e.length>t;t++){let r=e[t];u.default(r,"Parameter 'itemPath' must not contain any empty segments"),r=l.normalizeSeparators(e[t]),0===t&&l.hasRoot(r)?(r=l.safeTrimTrailingSeparator(r),u.default(r===l.dirname(r),"Parameter 'itemPath' root segment contains information for multiple segments"),this.segments.push(r)):(u.default(!r.includes(c.sep),"Parameter 'itemPath' contains unexpected path separators"),this.segments.push(r))}}}toString(){let e=this.segments[0],t=e.endsWith(c.sep)||h&&/^[A-Z]:$/i.test(e);for(let r=1;this.segments.length>r;r++)t?t=!1:e+=c.sep,e+=this.segments[r];return e}}})),p.register("e51CO",(function(e,t){"use strict";Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.SearchState=void 0,e.exports.SearchState=class{constructor(e,t){this.path=e,this.level=t}}})),p.register("c7nrF",(function(e,t){"use strict";var r=e.exports&&e.exports.__createBinding||(Object.create?(e,t,r,o)=>{void 0===o&&(o=r),Object.defineProperty(e,o,{enumerable:!0,get(){return t[r]}})}:(e,t,r,o)=>{void 0===o&&(o=r),e[o]=t[r]}),a=e.exports&&e.exports.__setModuleDefault||(Object.create?(e,t)=>{Object.defineProperty(e,"default",{enumerable:!0,value:t})}:(e,t)=>{e.default=t}),n=e.exports&&e.exports.__importStar||(e=>{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.hasOwnProperty.call(e,o)&&r(t,e,o);return a(t,e),t}),u=e.exports&&e.exports.__awaiter||((e,t,r,o)=>new(r||(r=Promise))(((s,a)=>{function i(e){try{c(o.next(e))}catch(e){a(e)}}function n(e){try{c(o.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((e=>{e(t)}))).then(i,n)}c((o=o.apply(e,t||[])).next())}))),h=e.exports&&e.exports.__asyncValues||function(e){function t(t){r[t]=e[t]&&(r=>new Promise(((o,s)=>{((e,t,r,o)=>{Promise.resolve(o).then((t=>{e({value:t,done:r})}),t)})(o,s,(r=e[t](r)).done,r.value)})))}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=e[Symbol.asyncIterator];return o?o.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),r={},t("next"),t("throw"),t("return"),r[Symbol.asyncIterator]=function(){return this},r)};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.hashFiles=void 0;const d=n(c),f=n(p("9bqVn")),m=n(i),y=n(l),b=n(o),g=n(s);e.exports.hashFiles=function(e){var t,r,o;return u(this,void 0,void 0,(function*(){let s=!1;const a=null!==(o=process.env.GITHUB_WORKSPACE)&&void 0!==o?o:process.cwd(),i=d.createHash("sha256");let n=0;try{for(var c,l=h(e.globGenerator());!(c=yield l.next()).done;){const e=c.value;if(f.debug(e),!e.startsWith(`${a}${g.sep}`)){f.debug(`Ignore '${e}' since it is not under GITHUB_WORKSPACE.`);continue}if(m.statSync(e).isDirectory()){f.debug(`Skip directory '${e}'.`);continue}const t=d.createHash("sha256"),r=b.promisify(y.pipeline);yield r(m.createReadStream(e),t),i.write(t.digest()),n++,s||(s=!0)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=l.return)&&(yield r.call(l))}finally{if(t)throw t.error}}return i.end(),s?(f.debug(`Found ${n} files to hash.`),i.digest("hex")):(f.debug("No matches found for glob"),"")}))}})),p.register("c3SoR",(function(t,r){e(t.exports,"default",(()=>i));var o=p("lwNDb"),s=p("9bqVn");let a;(e=>{e.STATE_CACHE_PRIMARY_KEY="cache-primary-key",e.CACHE_MATCHED_KEY="cache-matched-key",e.CACHE_PATHS="cache-paths"})(a||(a={}));var i=class{constructor(e,t){this.packageManager=e,this.cacheDependencyPath=t,this.CACHE_KEY_PREFIX="setup-python"}async restoreCache(){const{primaryKey:e,restoreKey:t}=await this.computeKeys();if(e.endsWith("-"))throw Error(`No file in ${process.cwd()} matched to [${this.cacheDependencyPath.split("\n").join(",")}], make sure you have checked out the target repository`);const r=await this.getCacheGlobalDirectories();s.saveState(a.CACHE_PATHS,r),s.saveState(a.STATE_CACHE_PRIMARY_KEY,e);const i=await o.restoreCache(r,e,t);this.handleMatchResult(i,e)}handleMatchResult(e,t){e?(s.saveState(a.CACHE_MATCHED_KEY,e),s.info("Cache restored from key: "+e)):s.info(this.packageManager+" cache is not found"),s.setOutput("cache-hit",e===t)}}})),p.register("gyWii",(function(t,r){e(t.exports,"default",(()=>c));var o=p("b5WCL"),i=p("9bqVn"),n=p("c3SoR"),c=class extends n.default{constructor(e,t="**/Pipfile.lock"){super("pipenv",t),this.pythonVersion=e,this.patterns=t}async getCacheGlobalDirectories(){let e;e="win32"===process.platform?".virtualenvs":".local/share/virtualenvs";const t=s.join(a.homedir(),e);return i.debug("global cache directory path is "+t),[t]}async computeKeys(){const e=await o.hashFiles(this.patterns);return{primaryKey:`${this.CACHE_KEY_PREFIX}-${process.env.RUNNER_OS}-python-${this.pythonVersion}-${this.packageManager}-${e}`,restoreKey:void 0}}}})),p.register("9rlmk",(function(t,r){e(t.exports,"default",(()=>n));var o=p("b5WCL"),a=p("ca0ts"),i=p("c3SoR"),n=class extends i.default{constructor(e,t="**/poetry.lock"){super("poetry",t),this.pythonVersion=e,this.patterns=t}async getCacheGlobalDirectories(){const e=await this.getPoetryConfiguration(),t=[e["virtualenvs.path"].replace("{cache-dir}",e["cache-dir"])];return!0===e["virtualenvs.in-project"]&&t.push(s.join(process.cwd(),".venv")),t}async computeKeys(){const e=await o.hashFiles(this.patterns);return{primaryKey:`${this.CACHE_KEY_PREFIX}-${process.env.RUNNER_OS}-python-${this.pythonVersion}-${this.packageManager}-${e}`,restoreKey:void 0}}async getPoetryConfiguration(){const{stdout:e,stderr:t,exitCode:r}=await a.getExecOutput("poetry",["config","--list"]);if(r&&t)throw Error("Could not get cache folder path for poetry package manager");const o=e.trim().split("\n"),s={};for(let e of o){e=e.replace(/#.*$/,"");const[t,r]=e.split("=").map((e=>e.trim()));s[t]=JSON.parse(r)}return s}}})); +//# sourceMappingURL=cache.32a23f6d.js.map diff --git a/dist/cache.32a23f6d.js.map b/dist/cache.32a23f6d.js.map new file mode 100644 index 00000000..deee7cd1 --- /dev/null +++ b/dist/cache.32a23f6d.js.map @@ -0,0 +1 @@ +{"mappings":"4eAGOA,eAAeC,EAAkBC,EAAeC,GACrD,GAAIC,EAAAC,0BAA2B,CAC7B,MACMC,EAAmBC,EAAAC,oBAAoBN,EAAOC,OADxBM,SAEtBH,EAAiBI,yDAP3B,IAAAN,EAAAO,EAAA,qDCUO,SAASC,EACdC,EACAV,EACAW,GAEA,OAAQD,GACN,KAAKE,EAAgBC,IACnB,OAAO,IAAIC,EAAAC,QAASf,EAAeW,GACrC,KAAKC,EAAgBI,OACnB,OAAO,IAAIC,EAAAF,QAAYf,EAAeW,GACxC,KAAKC,EAAgBM,OACnB,OAAO,IAAIC,EAAAJ,QAAYf,EAAeW,GACxC,QACE,MAAUS,MAAM,gBAAgBV,mEAvBtC,IAAAI,EAAAN,EAAA,uCAIOI,GAAKA,IAAAA,EACP,IAAG,MADIA,EAEJ,OAAG,SAFCA,EAGJ,OAAG,WAHCA,IAAAA,EAAe,yECJ3B,IAAAS,EAAAb,EAAA,6DAqEAc,EA1DA,cAAuBC,EAAAR,QACrBS,YACUxB,EACRW,EAA8B,uBAE9Bc,MAAM,MAAOd,QAHLX,cAAAA,EAMVH,kCACE,IAAI6B,EAAW,EACXC,EAAS,GACTC,EAAS,GAOb,GAAI3B,EAAA4B,WAAY,CACd,MAAMC,EAAgBC,EAAAC,GAAMC,UAAUC,EAAAC,QACpCR,OAAQA,EAAQC,OAAQA,SAAgBE,EAAc,wBAGtDH,OAAQA,EACRC,OAAQA,EACRF,SAAUA,SACFU,EAAAC,cAAmB,kBAG/B,GAAIX,GAAYE,EACd,MAAUR,MACR,2DAIJ,IAAIkB,EAAeX,EAAOY,OAQ1B,OANID,EAA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D,MAAM,KAAKP,KAAIqJ,GAAQA,EAAK5O,SAEtD2O,EAAO5H,GAAO8H,KAAKC,MAAM5L,GAG3B,OAAOyL","sources":["src/python/cache.ts","node_modules/.pnpm/github.com+actions+setup-python@98f2ad02fd48d057ee3b4d4f66525b231c3e52b6/node_modules/setup-python/src/cache-distributions/cache-factory.ts","node_modules/.pnpm/github.com+actions+setup-python@98f2ad02fd48d057ee3b4d4f66525b231c3e52b6/node_modules/setup-python/src/cache-distributions/pip-cache.ts","node_modules/.pnpm/@actions+glob@0.2.1/node_modules/@actions/glob/src/glob.ts","node_modules/.pnpm/@actions+glob@0.2.1/node_modules/@actions/glob/src/internal-globber.ts","node_modules/.pnpm/@actions+glob@0.2.1/node_modules/@actions/glob/src/internal-glob-options-helper.ts","node_modules/.pnpm/@actions+glob@0.2.1/node_modules/@actions/glob/src/internal-pattern-helper.ts","node_modules/.pnpm/@actions+glob@0.2.1/node_modules/@actions/glob/src/internal-path-helper.ts","node_modules/.pnpm/@actions+glob@0.2.1/node_modules/@actions/glob/src/internal-match-kind.ts","node_modules/.pnpm/@actions+glob@0.2.1/node_modules/@actions/glob/src/internal-pattern.ts","node_modules/.pnpm/@actions+glob@0.2.1/node_modules/@actions/glob/src/internal-path.ts","node_modules/.pnpm/@actions+glob@0.2.1/node_modules/@actions/glob/src/internal-search-state.ts","node_modules/.pnpm/@actions+glob@0.2.1/node_modules/@actions/glob/src/internal-hash-files.ts","node_modules/.pnpm/github.com+actions+setup-python@98f2ad02fd48d057ee3b4d4f66525b231c3e52b6/node_modules/setup-python/src/cache-distributions/cache-distributor.ts","node_modules/.pnpm/github.com+actions+setup-python@98f2ad02fd48d057ee3b4d4f66525b231c3e52b6/node_modules/setup-python/src/cache-distributions/pipenv-cache.ts","node_modules/.pnpm/github.com+actions+setup-python@98f2ad02fd48d057ee3b4d4f66525b231c3e52b6/node_modules/setup-python/src/cache-distributions/poetry-cache.ts"],"sourcesContent":["import { isCacheFeatureAvailable } from \"setup-python/src/utils\"\r\nimport { getCacheDistributor } from \"setup-python/src/cache-distributions/cache-factory\"\r\n\r\nexport async function cacheDependencies(cache: string, pythonVersion: string) {\r\n if (isCacheFeatureAvailable()) {\r\n const cacheDependencyPath = undefined // core.getInput(\"cache-dependency-path\") || undefined\r\n const cacheDistributor = getCacheDistributor(cache, pythonVersion, cacheDependencyPath)\r\n await cacheDistributor.restoreCache()\r\n }\r\n}\r\n","import PipCache from './pip-cache';\nimport PipenvCache from './pipenv-cache';\nimport PoetryCache from './poetry-cache';\n\nexport enum PackageManagers {\n Pip = 'pip',\n Pipenv = 'pipenv',\n Poetry = 'poetry'\n}\n\nexport function getCacheDistributor(\n packageManager: string,\n pythonVersion: string,\n cacheDependencyPath: string | undefined\n) {\n switch (packageManager) {\n case PackageManagers.Pip:\n return new PipCache(pythonVersion, cacheDependencyPath);\n case PackageManagers.Pipenv:\n return new PipenvCache(pythonVersion, cacheDependencyPath);\n case PackageManagers.Poetry:\n return new PoetryCache(pythonVersion, cacheDependencyPath);\n default:\n throw new Error(`Caching for '${packageManager}' is not supported`);\n }\n}\n","import * as glob from '@actions/glob';\nimport * as core from '@actions/core';\nimport * as exec from '@actions/exec';\nimport * as child_process from 'child_process';\nimport utils from 'util';\nimport * as path from 'path';\nimport os from 'os';\n\nimport CacheDistributor from './cache-distributor';\nimport {IS_WINDOWS} from '../utils';\n\nclass PipCache extends CacheDistributor {\n constructor(\n private pythonVersion: string,\n cacheDependencyPath: string = '**/requirements.txt'\n ) {\n super('pip', cacheDependencyPath);\n }\n\n protected async getCacheGlobalDirectories() {\n let exitCode = 1;\n let stdout = '';\n let stderr = '';\n\n // Add temporary fix for Windows\n // On windows it is necessary to execute through an exec\n // because the getExecOutput gives a non zero code or writes to stderr for pip 22.0.2,\n // or spawn must be started with the shell option enabled for getExecOutput\n // Related issue: https://github.com/actions/setup-python/issues/328\n if (IS_WINDOWS) {\n const execPromisify = utils.promisify(child_process.exec);\n ({stdout: stdout, stderr: stderr} = await execPromisify('pip cache dir'));\n } else {\n ({\n stdout: stdout,\n stderr: stderr,\n exitCode: exitCode\n } = await exec.getExecOutput('pip cache dir'));\n }\n\n if (exitCode && stderr) {\n throw new Error(\n `Could not get cache folder path for pip package manager`\n );\n }\n\n let resolvedPath = stdout.trim();\n\n if (resolvedPath.includes('~')) {\n resolvedPath = path.join(os.homedir(), resolvedPath.slice(1));\n }\n\n core.debug(`global cache directory path is ${resolvedPath}`);\n\n return [resolvedPath];\n }\n\n protected async computeKeys() {\n const hash = await glob.hashFiles(this.cacheDependencyPath);\n const primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;\n const restoreKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-python-${this.pythonVersion}-${this.packageManager}`;\n\n return {\n primaryKey,\n restoreKey: [restoreKey]\n };\n }\n}\n\nexport default PipCache;\n",null,null,null,null,null,null,null,null,null,null,"import * as cache from '@actions/cache';\nimport * as core from '@actions/core';\n\nexport enum State {\n STATE_CACHE_PRIMARY_KEY = 'cache-primary-key',\n CACHE_MATCHED_KEY = 'cache-matched-key',\n CACHE_PATHS = 'cache-paths'\n}\n\nabstract class CacheDistributor {\n protected CACHE_KEY_PREFIX = 'setup-python';\n constructor(\n protected packageManager: string,\n protected cacheDependencyPath: string\n ) {}\n\n protected abstract getCacheGlobalDirectories(): Promise;\n protected abstract computeKeys(): Promise<{\n primaryKey: string;\n restoreKey: string[] | undefined;\n }>;\n\n public async restoreCache() {\n const {primaryKey, restoreKey} = await this.computeKeys();\n if (primaryKey.endsWith('-')) {\n throw new Error(\n `No file in ${process.cwd()} matched to [${this.cacheDependencyPath\n .split('\\n')\n .join(',')}], make sure you have checked out the target repository`\n );\n }\n\n const cachePath = await this.getCacheGlobalDirectories();\n\n core.saveState(State.CACHE_PATHS, cachePath);\n core.saveState(State.STATE_CACHE_PRIMARY_KEY, primaryKey);\n\n const matchedKey = await cache.restoreCache(\n cachePath,\n primaryKey,\n restoreKey\n );\n\n this.handleMatchResult(matchedKey, primaryKey);\n }\n\n public handleMatchResult(matchedKey: string | undefined, primaryKey: string) {\n if (matchedKey) {\n core.saveState(State.CACHE_MATCHED_KEY, matchedKey);\n core.info(`Cache restored from key: ${matchedKey}`);\n } else {\n core.info(`${this.packageManager} cache is not found`);\n }\n core.setOutput('cache-hit', matchedKey === primaryKey);\n }\n}\n\nexport default CacheDistributor;\n","import * as glob from '@actions/glob';\nimport * as os from 'os';\nimport * as path from 'path';\nimport * as core from '@actions/core';\n\nimport CacheDistributor from './cache-distributor';\n\nclass PipenvCache extends CacheDistributor {\n constructor(\n private pythonVersion: string,\n protected patterns: string = '**/Pipfile.lock'\n ) {\n super('pipenv', patterns);\n }\n\n protected async getCacheGlobalDirectories() {\n let virtualEnvRelativePath;\n\n // Default virtualenv directories are hardcoded,\n // because pipenv is not preinstalled on hosted images and virtualenv is not created:\n // https://github.com/pypa/pipenv/blob/1daaa0de9a0b00d386c6baeb809d8d4ee6795cfd/pipenv/utils.py#L1990-L2002\n if (process.platform === 'win32') {\n virtualEnvRelativePath = '.virtualenvs';\n } else {\n virtualEnvRelativePath = '.local/share/virtualenvs';\n }\n const resolvedPath = path.join(os.homedir(), virtualEnvRelativePath);\n core.debug(`global cache directory path is ${resolvedPath}`);\n\n return [resolvedPath];\n }\n\n protected async computeKeys() {\n const hash = await glob.hashFiles(this.patterns);\n const primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;\n const restoreKey = undefined;\n return {\n primaryKey,\n restoreKey\n };\n }\n}\n\nexport default PipenvCache;\n","import * as glob from '@actions/glob';\nimport * as os from 'os';\nimport * as path from 'path';\nimport * as exec from '@actions/exec';\n\nimport CacheDistributor from './cache-distributor';\n\nclass PoetryCache extends CacheDistributor {\n constructor(\n private pythonVersion: string,\n protected patterns: string = '**/poetry.lock'\n ) {\n super('poetry', patterns);\n }\n\n protected async getCacheGlobalDirectories() {\n const poetryConfig = await this.getPoetryConfiguration();\n\n const cacheDir = poetryConfig['cache-dir'];\n const virtualenvsPath = poetryConfig['virtualenvs.path'].replace(\n '{cache-dir}',\n cacheDir\n );\n\n const paths = [virtualenvsPath];\n\n if (poetryConfig['virtualenvs.in-project'] === true) {\n paths.push(path.join(process.cwd(), '.venv'));\n }\n\n return paths;\n }\n\n protected async computeKeys() {\n const hash = await glob.hashFiles(this.patterns);\n const primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;\n const restoreKey = undefined;\n return {\n primaryKey,\n restoreKey\n };\n }\n\n private async getPoetryConfiguration() {\n const {stdout, stderr, exitCode} = await exec.getExecOutput('poetry', [\n 'config',\n '--list'\n ]);\n\n if (exitCode && stderr) {\n throw new Error(\n 'Could not get cache folder path for poetry package manager'\n );\n }\n\n const lines = stdout.trim().split('\\n');\n\n const config: any = {};\n\n for (let line of lines) {\n line = line.replace(/#.*$/, '');\n\n const [key, value] = line.split('=').map(part => part.trim());\n\n config[key] = JSON.parse(value);\n }\n\n return config as {\n 'cache-dir': string;\n 'virtualenvs.in-project': boolean;\n 'virtualenvs.path': string;\n };\n }\n}\n\nexport default PoetryCache;\n"],"names":["async","$247857e5e6b34d30$export$1dbe78e280c9e8ae","cache","pythonVersion","$3Mp5H","isCacheFeatureAvailable","cacheDistributor","$tIILP","getCacheDistributor","undefined","restoreCache","parcelRequire","$a80505c8137e72d5$export$a69587775d1d8aae","packageManager","cacheDependencyPath","$a80505c8137e72d5$export$150e8fc98ea6f32f","Pip","$5p0V2","default","Pipenv","$gyWii","Poetry","$9rlmk","Error","$b5WCL","$74a60ce38fff9598$export$2e2bcd8739ae039","$c3SoR","constructor","super","exitCode","stdout","stderr","IS_WINDOWS","execPromisify","$parcel$interopDefault","$amy5t$util","promisify","$amy5t$child_process","exec","$ca0ts","getExecOutput","resolvedPath","trim","includes","$amy5t$path","join","$amy5t$os","homedir","slice","$9bqVn","debug","hash","hashFiles","this","primaryKey","CACHE_KEY_PREFIX","process","env","restoreKey","$813da2e51fd92cc8$var$create","patterns","options","$2LsYP","DefaultGlobber","create","module","exports","followSymbolicLinks","globber","$c7nrF","$2036736610e6ad99$var$core","$2036736610e6ad99$var$__importStar","$2036736610e6ad99$var$fs","$amy5t$fs","$2036736610e6ad99$var$globOptionsHelper","$2036736610e6ad99$var$path","$2036736610e6ad99$var$patternHelper","$2036736610e6ad99$var$IS_WINDOWS","platform","$2036736610e6ad99$var$DefaultGlobber","searchPaths","getOptions","getSearchPaths","glob","result","_c","_b","$2036736610e6ad99$var$__asyncValues","globGenerator","next","done","push","value","pattern","implicitDescendants","trailingSeparator","segments","length","$9aW8w","Pattern","negate","concat","stack","searchPath","$2036736610e6ad99$var$__await","promises","lstat","err","code","unshift","$e51CO","SearchState","traversalChain","item","pop","match","path","partialMatch","stats","stat","isDirectory","$iOrzV","MatchKind","Directory","matchDirectories","childLevel","level","childItems","readdir","map","x","reverse","File","static","replace","lines","split","line","startsWith","omitBrokenSymbolicLinks","realPath","realpath","some","$d7a6b29e5cd7dc52$var$core","$d7a6b29e5cd7dc52$var$__importStar","copy","$859e1e40578bfff4$var$pathHelper","$859e1e40578bfff4$var$__importStar","$859e1e40578bfff4$var$IS_WINDOWS","filter","searchPathMap","toUpperCase","pattern1","key","foundAncestor","tempKey","parent","dirname","itemPath","None","$7fae9946df676070$var$hasAbsoluteRoot","$7fae9946df676070$var$assert_1","$7fae9946df676070$var$normalizeSeparators","$7fae9946df676070$var$IS_WINDOWS","test","p","$7fae9946df676070$var$safeTrimTrailingSeparator","endsWith","$7fae9946df676070$var$path","sep","substr","$7fae9946df676070$var$__importStar","$7fae9946df676070$var$__importDefault","$amy5t$assert","ensureAbsoluteRoot","root","cwd","hasAbsoluteRoot","hasRoot","normalizeSeparators","safeTrimTrailingSeparator","$6ae224ea6e46bf0e$var$os","$6ae224ea6e46bf0e$var$__importStar","$6ae224ea6e46bf0e$var$path","$6ae224ea6e46bf0e$var$pathHelper","$6ae224ea6e46bf0e$var$assert_1","$6ae224ea6e46bf0e$var$__importDefault","$6ae224ea6e46bf0e$var$IS_WINDOWS","$6ae224ea6e46bf0e$var$Pattern","patternOrNegate","isImplicitPattern","getLiteral","$i7Uxm","Path","fixupPattern","foundGlob","searchSegments","rootRegExp","RegExp","regExpEscape","minimatchOptions","dot","nobrace","nocase","nocomment","noext","nonegate","minimatch","$5RQ11","Minimatch","All","matchOne","set","s","literalSegments","every","i","globEscape","segment","literal","c","closed","i2","c2","$d324bc816fc48e7a$var$path","$d324bc816fc48e7a$var$__importStar","$d324bc816fc48e7a$var$pathHelper","$d324bc816fc48e7a$var$assert_1","$d324bc816fc48e7a$var$__importDefault","$d324bc816fc48e7a$var$IS_WINDOWS","remaining","dir","basename","toString","skipSlash","$0246d80d32367c4d$var$crypto","$0246d80d32367c4d$var$__importStar","$amy5t$crypto","$0246d80d32367c4d$var$core","$0246d80d32367c4d$var$fs","$0246d80d32367c4d$var$stream","$amy5t$stream","$0246d80d32367c4d$var$util","$0246d80d32367c4d$var$path","hasMatch","githubWorkspace","createHash","count","_d","$0246d80d32367c4d$var$__asyncValues","file","statSync","pipeline","createReadStream","write","digest","end","$lwNDb","$67075960fd2a3751$export$7254cc27399e90bd","$67075960fd2a3751$export$2e2bcd8739ae039","computeKeys","cachePath","getCacheGlobalDirectories","saveState","CACHE_PATHS","STATE_CACHE_PRIMARY_KEY","matchedKey","handleMatchResult","CACHE_MATCHED_KEY","info","setOutput","$747adf5cb8f42b9c$export$2e2bcd8739ae039","virtualEnvRelativePath","$dbc3e31cefa4c000$export$2e2bcd8739ae039","poetryConfig","getPoetryConfiguration","paths","config","part","JSON","parse"],"version":3,"file":"cache.32a23f6d.js.map","sourceRoot":"../"} \ No newline at end of file diff --git a/src/python/actions_python.ts b/src/python/actions_python.ts index 4131ed3b..55def0d5 100644 --- a/src/python/actions_python.ts +++ b/src/python/actions_python.ts @@ -5,19 +5,11 @@ import { info, warning } from "../utils/io/io" import * as core from "@actions/core" import path from "path" import { isGitHubCI } from "../utils/env/isci" -import { isCacheFeatureAvailable } from "setup-python/src/utils" -import { getCacheDistributor } from "setup-python/src/cache-distributions/cache-factory" function isPyPyVersion(versionSpec: string) { return versionSpec.startsWith("pypy-") } -async function cacheDependencies(cache: string, pythonVersion: string) { - const cacheDependencyPath = undefined // core.getInput("cache-dependency-path") || undefined - const cacheDistributor = getCacheDistributor(cache, pythonVersion, cacheDependencyPath) - await cacheDistributor.restoreCache() -} - export async function setupActionsPython(version: string, _setupDir: string, arch: string) { if (process.env.AGENT_TOOLSDIRECTORY?.trim()) { core.debug(`Python is expected to be installed into AGENT_TOOLSDIRECTORY=${process.env.AGENT_TOOLSDIRECTORY}`) @@ -41,9 +33,9 @@ export async function setupActionsPython(version: string, _setupDir: string, arc } const cache = "pip" // core.getInput("cache") // package manager used for caching - if (isCacheFeatureAvailable()) { - await cacheDependencies(cache, pythonVersion) - } + + const { cacheDependencies } = await import("./cache") + await cacheDependencies(cache, pythonVersion) } } catch (err) { core.setFailed((err as Error).message) diff --git a/src/python/cache.ts b/src/python/cache.ts new file mode 100644 index 00000000..ebd3f898 --- /dev/null +++ b/src/python/cache.ts @@ -0,0 +1,10 @@ +import { isCacheFeatureAvailable } from "setup-python/src/utils" +import { getCacheDistributor } from "setup-python/src/cache-distributions/cache-factory" + +export async function cacheDependencies(cache: string, pythonVersion: string) { + if (isCacheFeatureAvailable()) { + const cacheDependencyPath = undefined // core.getInput("cache-dependency-path") || undefined + const cacheDistributor = getCacheDistributor(cache, pythonVersion, cacheDependencyPath) + await cacheDistributor.restoreCache() + } +}