mirror of
				https://gitea.com/actions/setup-python.git
				synced 2025-10-31 11:48:56 +08:00 
			
		
		
		
	Bump typescript from 5.4.2 to 5.9.3 and update docs/advanced-usage.md (#1094)
* Bump typescript from 5.4.2 to 5.8.3 Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.4.2 to 5.8.3. - [Release notes](https://github.com/microsoft/TypeScript/releases) - [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release-publish.yml) - [Commits](https://github.com/microsoft/TypeScript/compare/v5.4.2...v5.8.3) --- updated-dependencies: - dependency-name: typescript dependency-version: 5.8.3 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update header text from 'Linux' to 'Ubuntu' * update target to ES2022 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: priya-kinthali <priya-kinthali@github.com>
This commit is contained in:
		
							
								
								
									
										229
									
								
								dist/cache-save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										229
									
								
								dist/cache-save/index.js
									
									
									
									
										vendored
									
									
								
							| @@ -87714,22 +87714,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( | |||||||
| }) : function(o, v) { | }) : function(o, v) { | ||||||
|     o["default"] = v; |     o["default"] = v; | ||||||
| }); | }); | ||||||
| var __importStar = (this && this.__importStar) || function (mod) { | var __importStar = (this && this.__importStar) || (function () { | ||||||
|     if (mod && mod.__esModule) return mod; |     var ownKeys = function(o) { | ||||||
|     var result = {}; |         ownKeys = Object.getOwnPropertyNames || function (o) { | ||||||
|     if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); |             var ar = []; | ||||||
|     __setModuleDefault(result, mod); |             for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; | ||||||
|     return result; |             return ar; | ||||||
| }; |         }; | ||||||
| var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { |         return ownKeys(o); | ||||||
|     function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } |     }; | ||||||
|     return new (P || (P = Promise))(function (resolve, reject) { |     return function (mod) { | ||||||
|         function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } |         if (mod && mod.__esModule) return mod; | ||||||
|         function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } |         var result = {}; | ||||||
|         function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } |         if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); | ||||||
|         step((generator = generator.apply(thisArg, _arguments || [])).next()); |         __setModuleDefault(result, mod); | ||||||
|     }); |         return result; | ||||||
| }; |     }; | ||||||
|  | })(); | ||||||
| Object.defineProperty(exports, "__esModule", ({ value: true })); | Object.defineProperty(exports, "__esModule", ({ value: true })); | ||||||
| exports.State = void 0; | exports.State = void 0; | ||||||
| const cache = __importStar(__nccwpck_require__(5116)); | const cache = __importStar(__nccwpck_require__(5116)); | ||||||
| @@ -87742,41 +87743,39 @@ var State; | |||||||
|     State["CACHE_PATHS"] = "cache-paths"; |     State["CACHE_PATHS"] = "cache-paths"; | ||||||
| })(State || (exports.State = State = {})); | })(State || (exports.State = State = {})); | ||||||
| class CacheDistributor { | class CacheDistributor { | ||||||
|  |     packageManager; | ||||||
|  |     cacheDependencyPath; | ||||||
|  |     CACHE_KEY_PREFIX = 'setup-python'; | ||||||
|     constructor(packageManager, cacheDependencyPath) { |     constructor(packageManager, cacheDependencyPath) { | ||||||
|         this.packageManager = packageManager; |         this.packageManager = packageManager; | ||||||
|         this.cacheDependencyPath = cacheDependencyPath; |         this.cacheDependencyPath = cacheDependencyPath; | ||||||
|         this.CACHE_KEY_PREFIX = 'setup-python'; |  | ||||||
|     } |     } | ||||||
|     handleLoadedCache() { |     async handleLoadedCache() { } | ||||||
|         return __awaiter(this, void 0, void 0, function* () { }); |     async restoreCache() { | ||||||
|     } |         const { primaryKey, restoreKey } = await this.computeKeys(); | ||||||
|     restoreCache() { |         if (primaryKey.endsWith('-')) { | ||||||
|         return __awaiter(this, void 0, void 0, function* () { |             const file = this.packageManager === 'pip' | ||||||
|             const { primaryKey, restoreKey } = yield this.computeKeys(); |                 ? `${this.cacheDependencyPath | ||||||
|             if (primaryKey.endsWith('-')) { |                     .split('\n') | ||||||
|                 const file = this.packageManager === 'pip' |                     .join(',')} or ${constants_1.CACHE_DEPENDENCY_BACKUP_PATH}` | ||||||
|                     ? `${this.cacheDependencyPath |                 : this.cacheDependencyPath.split('\n').join(','); | ||||||
|                         .split('\n') |             throw new Error(`No file in ${process.cwd()} matched to [${file}], make sure you have checked out the target repository`); | ||||||
|                         .join(',')} or ${constants_1.CACHE_DEPENDENCY_BACKUP_PATH}` |         } | ||||||
|                     : this.cacheDependencyPath.split('\n').join(','); |         const cachePath = await this.getCacheGlobalDirectories(); | ||||||
|                 throw new Error(`No file in ${process.cwd()} matched to [${file}], make sure you have checked out the target repository`); |         core.saveState(State.CACHE_PATHS, cachePath); | ||||||
|             } |         let matchedKey; | ||||||
|             const cachePath = yield this.getCacheGlobalDirectories(); |         try { | ||||||
|             core.saveState(State.CACHE_PATHS, cachePath); |             matchedKey = await cache.restoreCache(cachePath, primaryKey, restoreKey); | ||||||
|             let matchedKey; |         } | ||||||
|             try { |         catch (err) { | ||||||
|                 matchedKey = yield cache.restoreCache(cachePath, primaryKey, restoreKey); |             const message = err.message; | ||||||
|             } |             core.info(`[warning]${message}`); | ||||||
|             catch (err) { |             core.setOutput('cache-hit', false); | ||||||
|                 const message = err.message; |             return; | ||||||
|                 core.info(`[warning]${message}`); |         } | ||||||
|                 core.setOutput('cache-hit', false); |         core.saveState(State.STATE_CACHE_PRIMARY_KEY, primaryKey); | ||||||
|                 return; |         await this.handleLoadedCache(); | ||||||
|             } |         this.handleMatchResult(matchedKey, primaryKey); | ||||||
|             core.saveState(State.STATE_CACHE_PRIMARY_KEY, primaryKey); |  | ||||||
|             yield this.handleLoadedCache(); |  | ||||||
|             this.handleMatchResult(matchedKey, primaryKey); |  | ||||||
|         }); |  | ||||||
|     } |     } | ||||||
|     handleMatchResult(matchedKey, primaryKey) { |     handleMatchResult(matchedKey, primaryKey) { | ||||||
|         if (matchedKey) { |         if (matchedKey) { | ||||||
| @@ -87827,27 +87826,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( | |||||||
| }) : function(o, v) { | }) : function(o, v) { | ||||||
|     o["default"] = v; |     o["default"] = v; | ||||||
| }); | }); | ||||||
| var __importStar = (this && this.__importStar) || function (mod) { | var __importStar = (this && this.__importStar) || (function () { | ||||||
|     if (mod && mod.__esModule) return mod; |     var ownKeys = function(o) { | ||||||
|     var result = {}; |         ownKeys = Object.getOwnPropertyNames || function (o) { | ||||||
|     if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); |             var ar = []; | ||||||
|     __setModuleDefault(result, mod); |             for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; | ||||||
|     return result; |             return ar; | ||||||
| }; |         }; | ||||||
| var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { |         return ownKeys(o); | ||||||
|     function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } |     }; | ||||||
|     return new (P || (P = Promise))(function (resolve, reject) { |     return function (mod) { | ||||||
|         function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } |         if (mod && mod.__esModule) return mod; | ||||||
|         function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } |         var result = {}; | ||||||
|         function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } |         if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); | ||||||
|         step((generator = generator.apply(thisArg, _arguments || [])).next()); |         __setModuleDefault(result, mod); | ||||||
|     }); |         return result; | ||||||
| }; |     }; | ||||||
|  | })(); | ||||||
| var __importDefault = (this && this.__importDefault) || function (mod) { | var __importDefault = (this && this.__importDefault) || function (mod) { | ||||||
|     return (mod && mod.__esModule) ? mod : { "default": mod }; |     return (mod && mod.__esModule) ? mod : { "default": mod }; | ||||||
| }; | }; | ||||||
| Object.defineProperty(exports, "__esModule", ({ value: true })); | Object.defineProperty(exports, "__esModule", ({ value: true })); | ||||||
| exports.run = void 0; | exports.run = run; | ||||||
| const core = __importStar(__nccwpck_require__(7484)); | const core = __importStar(__nccwpck_require__(7484)); | ||||||
| const cache = __importStar(__nccwpck_require__(5116)); | const cache = __importStar(__nccwpck_require__(5116)); | ||||||
| const fs_1 = __importDefault(__nccwpck_require__(9896)); | const fs_1 = __importDefault(__nccwpck_require__(9896)); | ||||||
| @@ -87855,62 +87855,57 @@ const cache_distributor_1 = __nccwpck_require__(2326); | |||||||
| // Added early exit to resolve issue with slow post action step:
 | // Added early exit to resolve issue with slow post action step:
 | ||||||
| // - https://github.com/actions/setup-node/issues/878
 | // - https://github.com/actions/setup-node/issues/878
 | ||||||
| // https://github.com/actions/cache/pull/1217
 | // https://github.com/actions/cache/pull/1217
 | ||||||
| function run(earlyExit) { | async function run(earlyExit) { | ||||||
|     return __awaiter(this, void 0, void 0, function* () { |     try { | ||||||
|         try { |         const cache = core.getInput('cache'); | ||||||
|             const cache = core.getInput('cache'); |         if (cache) { | ||||||
|             if (cache) { |             await saveCache(cache); | ||||||
|                 yield saveCache(cache); |             if (earlyExit) { | ||||||
|                 if (earlyExit) { |                 process.exit(0); | ||||||
|                     process.exit(0); |  | ||||||
|                 } |  | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         catch (error) { |     } | ||||||
|             const err = error; |     catch (error) { | ||||||
|             core.setFailed(err.message); |         const err = error; | ||||||
|         } |         core.setFailed(err.message); | ||||||
|     }); |     } | ||||||
| } | } | ||||||
| exports.run = run; | async function saveCache(packageManager) { | ||||||
| function saveCache(packageManager) { |     const cachePathState = core.getState(cache_distributor_1.State.CACHE_PATHS); | ||||||
|     return __awaiter(this, void 0, void 0, function* () { |     if (!cachePathState) { | ||||||
|         const cachePathState = core.getState(cache_distributor_1.State.CACHE_PATHS); |         core.warning('Cache paths are empty. Please check the previous logs and make sure that the python version is specified'); | ||||||
|         if (!cachePathState) { |         return; | ||||||
|             core.warning('Cache paths are empty. Please check the previous logs and make sure that the python version is specified'); |     } | ||||||
|             return; |     const cachePaths = JSON.parse(cachePathState); | ||||||
|         } |     core.debug(`paths for caching are ${cachePaths.join(', ')}`); | ||||||
|         const cachePaths = JSON.parse(cachePathState); |     if (!isCacheDirectoryExists(cachePaths)) { | ||||||
|         core.debug(`paths for caching are ${cachePaths.join(', ')}`); |         core.warning(`Cache folder path is retrieved for ${packageManager} but doesn't exist on disk: ${cachePaths.join(', ')}. This likely indicates that there are no dependencies to cache. Consider removing the cache step if it is not needed.`); | ||||||
|         if (!isCacheDirectoryExists(cachePaths)) { |         return; | ||||||
|             core.warning(`Cache folder path is retrieved for ${packageManager} but doesn't exist on disk: ${cachePaths.join(', ')}. This likely indicates that there are no dependencies to cache. Consider removing the cache step if it is not needed.`); |     } | ||||||
|             return; |     const primaryKey = core.getState(cache_distributor_1.State.STATE_CACHE_PRIMARY_KEY); | ||||||
|         } |     const matchedKey = core.getState(cache_distributor_1.State.CACHE_MATCHED_KEY); | ||||||
|         const primaryKey = core.getState(cache_distributor_1.State.STATE_CACHE_PRIMARY_KEY); |     if (!primaryKey) { | ||||||
|         const matchedKey = core.getState(cache_distributor_1.State.CACHE_MATCHED_KEY); |         core.warning('Error retrieving key from state.'); | ||||||
|         if (!primaryKey) { |         return; | ||||||
|             core.warning('Error retrieving key from state.'); |     } | ||||||
|             return; |     else if (matchedKey === primaryKey) { | ||||||
|         } |         // no change in target directories
 | ||||||
|         else if (matchedKey === primaryKey) { |         core.info(`Cache hit occurred on the primary key ${primaryKey}, not saving cache.`); | ||||||
|             // no change in target directories
 |         return; | ||||||
|             core.info(`Cache hit occurred on the primary key ${primaryKey}, not saving cache.`); |     } | ||||||
|             return; |     let cacheId = 0; | ||||||
|         } |     try { | ||||||
|         let cacheId = 0; |         cacheId = await cache.saveCache(cachePaths, primaryKey); | ||||||
|         try { |     } | ||||||
|             cacheId = yield cache.saveCache(cachePaths, primaryKey); |     catch (err) { | ||||||
|         } |         const message = err.message; | ||||||
|         catch (err) { |         core.info(`[warning]${message}`); | ||||||
|             const message = err.message; |         return; | ||||||
|             core.info(`[warning]${message}`); |     } | ||||||
|             return; |     if (cacheId == -1) { | ||||||
|         } |         return; | ||||||
|         if (cacheId == -1) { |     } | ||||||
|             return; |     core.info(`Cache saved with the key: ${primaryKey}`); | ||||||
|         } |  | ||||||
|         core.info(`Cache saved with the key: ${primaryKey}`); |  | ||||||
|     }); |  | ||||||
| } | } | ||||||
| function isCacheDirectoryExists(cacheDirectory) { | function isCacheDirectoryExists(cacheDirectory) { | ||||||
|     const result = cacheDirectory.reduce((previousValue, currentValue) => { |     const result = cacheDirectory.reduce((previousValue, currentValue) => { | ||||||
|   | |||||||
							
								
								
									
										1992
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1992
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -18,7 +18,7 @@ | |||||||
| - [Hosted tool cache](advanced-usage.md#hosted-tool-cache)  | - [Hosted tool cache](advanced-usage.md#hosted-tool-cache)  | ||||||
| - [Using `setup-python` with a self-hosted runner](advanced-usage.md#using-setup-python-with-a-self-hosted-runner) | - [Using `setup-python` with a self-hosted runner](advanced-usage.md#using-setup-python-with-a-self-hosted-runner) | ||||||
|     - [Windows](advanced-usage.md#windows) |     - [Windows](advanced-usage.md#windows) | ||||||
|     - [Linux](advanced-usage.md#linux) |     - [Ubuntu](advanced-usage.md#Ubuntu) | ||||||
|     - [macOS](advanced-usage.md#macos) |     - [macOS](advanced-usage.md#macos) | ||||||
| - [Using `setup-python` on GHES](advanced-usage.md#using-setup-python-on-ghes) | - [Using `setup-python` on GHES](advanced-usage.md#using-setup-python-on-ghes) | ||||||
| - [Allow pre-releases](advanced-usage.md#allow-pre-releases) | - [Allow pre-releases](advanced-usage.md#allow-pre-releases) | ||||||
| @@ -578,9 +578,9 @@ If you have a supported self-hosted runner and you would like to use `setup-pyth | |||||||
|  |  | ||||||
| >If you are experiencing problems while configuring Python on your self-hosted runner, turn on [step debugging](https://github.com/actions/toolkit/blob/main/docs/action-debugging.md#step-debug-logs) to see additional logs. | >If you are experiencing problems while configuring Python on your self-hosted runner, turn on [step debugging](https://github.com/actions/toolkit/blob/main/docs/action-debugging.md#step-debug-logs) to see additional logs. | ||||||
|  |  | ||||||
| ### Linux | ### Ubuntu | ||||||
|  |  | ||||||
| By default, the runner downloads and installs tools into the folder set up by `RUNNER_TOOL_CACHE` environment variable. The environment variable called `AGENT_TOOLSDIRECTORY` can be set to change this location for Linux self-hosted runners: | By default, the runner downloads and installs tools into the folder set up by `RUNNER_TOOL_CACHE` environment variable. The environment variable called `AGENT_TOOLSDIRECTORY` can be set to change this location for Ubuntu self-hosted runners: | ||||||
| - In the same shell that your runner is using, type `export AGENT_TOOLSDIRECTORY=/path/to/folder`. | - In the same shell that your runner is using, type `export AGENT_TOOLSDIRECTORY=/path/to/folder`. | ||||||
| - More permanent way of setting the environment variable is to create an `.env` file in the same directory as your runner and to add `AGENT_TOOLSDIRECTORY=/path/to/folder`. This ensures the variable is always set if your runner is configured as a service. | - More permanent way of setting the environment variable is to create an `.env` file in the same directory as your runner and to add `AGENT_TOOLSDIRECTORY=/path/to/folder`. This ensures the variable is always set if your runner is configured as a service. | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										9
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										9
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @@ -34,7 +34,7 @@ | |||||||
|         "jest-circus": "^29.7.0", |         "jest-circus": "^29.7.0", | ||||||
|         "prettier": "^3.5.3", |         "prettier": "^3.5.3", | ||||||
|         "ts-jest": "^29.3.2", |         "ts-jest": "^29.3.2", | ||||||
|         "typescript": "^5.4.2" |         "typescript": "^5.9.3" | ||||||
|       }, |       }, | ||||||
|       "engines": { |       "engines": { | ||||||
|         "node": ">=24.0.0" |         "node": ">=24.0.0" | ||||||
| @@ -5446,10 +5446,11 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/typescript": { |     "node_modules/typescript": { | ||||||
|       "version": "5.4.2", |       "version": "5.9.3", | ||||||
|       "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", |       "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", | ||||||
|       "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", |       "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|  |       "license": "Apache-2.0", | ||||||
|       "bin": { |       "bin": { | ||||||
|         "tsc": "bin/tsc", |         "tsc": "bin/tsc", | ||||||
|         "tsserver": "bin/tsserver" |         "tsserver": "bin/tsserver" | ||||||
|   | |||||||
| @@ -53,6 +53,6 @@ | |||||||
|     "jest-circus": "^29.7.0", |     "jest-circus": "^29.7.0", | ||||||
|     "prettier": "^3.5.3", |     "prettier": "^3.5.3", | ||||||
|     "ts-jest": "^29.3.2", |     "ts-jest": "^29.3.2", | ||||||
|     "typescript": "^5.4.2" |     "typescript": "^5.9.3" | ||||||
|   } |   } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ | |||||||
|   "compilerOptions": { |   "compilerOptions": { | ||||||
|     /* Basic Options */ |     /* Basic Options */ | ||||||
|     // "incremental": true,                   /* Enable incremental compilation */ |     // "incremental": true,                   /* Enable incremental compilation */ | ||||||
|     "target": "es6",                          /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ |     "target": "ES2022",                          /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ | ||||||
|     "module": "commonjs",                     /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ |     "module": "commonjs",                     /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ | ||||||
|     // "allowJs": true,                       /* Allow javascript files to be compiled. */ |     // "allowJs": true,                       /* Allow javascript files to be compiled. */ | ||||||
|     // "checkJs": true,                       /* Report errors in .js files. */ |     // "checkJs": true,                       /* Report errors in .js files. */ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	![49699333+dependabot[bot]@users.noreply.github.com](/assets/img/avatar_default.png) dependabot[bot]
					dependabot[bot]