mirror of
				https://gitea.com/actions/setup-python.git
				synced 2025-10-31 07:47:08 +00:00 
			
		
		
		
	Compare commits
	
		
			5 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 7a69c2bc7d | ||
|   | 654aa00a6e | ||
|   | 6f45e887f6 | ||
|   | 2989dc4a1a | ||
|   | a0a76c4ddb | 
							
								
								
									
										2
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							| @@ -2,7 +2,7 @@ name: Validate 'setup-python' | ||||
| on:  | ||||
|   push: | ||||
|     branches: | ||||
|       - master | ||||
|       - main | ||||
|     paths-ignore: | ||||
|       - '**.md' | ||||
|   pull_request: | ||||
|   | ||||
							
								
								
									
										2
									
								
								.github/workflows/workflow.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/workflow.yml
									
									
									
									
										vendored
									
									
								
							| @@ -2,7 +2,7 @@ name: Main workflow | ||||
| on: | ||||
|   push: | ||||
|     branches: | ||||
|       - master | ||||
|       - main | ||||
|     paths-ignore: | ||||
|       - '**.md' | ||||
|   pull_request: | ||||
|   | ||||
| @@ -106,7 +106,7 @@ Check out our detailed guide on using [Python with GitHub Actions](https://help. | ||||
|     - If `3.8.1` is installed for example, and `3.8.2` is released, expect `3.8.1` to be removed and replaced by `3.8.2` in the tools cache. | ||||
|     - If the exact patch version doesn't matter to you, specifying just the major and minor version will get you the latest preinstalled patch version. In the previous example, the version spec `3.8` will use the `3.8.2` Python version found in the cache. | ||||
| - Downloadable Python versions from GitHub Releases ([actions/python-versions](https://github.com/actions/python-versions/releases)) | ||||
|     - All available versions are listed in the [version-manifest.json](https://github.com/actions/python-versions/blob/master/versions-manifest.json) file. | ||||
|     - All available versions are listed in the [version-manifest.json](https://github.com/actions/python-versions/blob/main/versions-manifest.json) file. | ||||
|     - If there is a specific version of Python that is not available, you can open an issue here | ||||
|  | ||||
| # Hosted Tool Cache | ||||
| @@ -136,7 +136,9 @@ You should specify only a major and minor version if you are okay with the most | ||||
|  | ||||
| # Using `setup-python` with a self hosted runner | ||||
|  | ||||
| If you would like to use `setup-python` and a self-hosted runner, there are a few extra things you need to make sure are set up so that new versions of Python can be downloaded and configured on your runner. | ||||
| Python distributions are only available for the same [environments](https://github.com/actions/virtual-environments#available-environments) that GitHub Actions hosted environments are available for. If you are using an unsupported version of Ubuntu such as `19.04` or another Linux distribution such as Fedora, `setup-python` will not work. If you have a supported self-hosted runner and you would like to use `setup-python`, there are a few extra things you need to make sure are set up so that new versions of Python can be downloaded and configured on your runner. | ||||
|  | ||||
| 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 addition logs. | ||||
|  | ||||
| ### Windows | ||||
|  | ||||
|   | ||||
							
								
								
									
										10
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							| @@ -6338,11 +6338,12 @@ const TOKEN = core.getInput('token'); | ||||
| const AUTH = !TOKEN || isGhes() ? undefined : `token ${TOKEN}`; | ||||
| const MANIFEST_REPO_OWNER = 'actions'; | ||||
| const MANIFEST_REPO_NAME = 'python-versions'; | ||||
| exports.MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/master/versions-manifest.json`; | ||||
| const MANIFEST_REPO_BRANCH = 'main'; | ||||
| exports.MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`; | ||||
| const IS_WINDOWS = process.platform === 'win32'; | ||||
| function findReleaseFromManifest(semanticVersionSpec, architecture) { | ||||
|     return __awaiter(this, void 0, void 0, function* () { | ||||
|         const manifest = yield tc.getManifestFromRepo(MANIFEST_REPO_OWNER, MANIFEST_REPO_NAME, AUTH); | ||||
|         const manifest = yield tc.getManifestFromRepo(MANIFEST_REPO_OWNER, MANIFEST_REPO_NAME, AUTH, MANIFEST_REPO_BRANCH); | ||||
|         return yield tc.findFromManifest(semanticVersionSpec, true, manifest, architecture); | ||||
|     }); | ||||
| } | ||||
| @@ -6354,7 +6355,10 @@ function installPython(workingDirectory) { | ||||
|             silent: true, | ||||
|             listeners: { | ||||
|                 stdout: (data) => { | ||||
|                     core.debug(data.toString().trim()); | ||||
|                     core.info(data.toString().trim()); | ||||
|                 }, | ||||
|                 stderr: (data) => { | ||||
|                     core.error(data.toString().trim()); | ||||
|                 } | ||||
|             } | ||||
|         }; | ||||
|   | ||||
| @@ -3,12 +3,14 @@ import * as core from '@actions/core'; | ||||
| import * as tc from '@actions/tool-cache'; | ||||
| import * as exec from '@actions/exec'; | ||||
| import {ExecOptions} from '@actions/exec/lib/interfaces'; | ||||
| import {stderr} from 'process'; | ||||
|  | ||||
| const TOKEN = core.getInput('token'); | ||||
| const AUTH = !TOKEN || isGhes() ? undefined : `token ${TOKEN}`; | ||||
| const MANIFEST_REPO_OWNER = 'actions'; | ||||
| const MANIFEST_REPO_NAME = 'python-versions'; | ||||
| export const MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/master/versions-manifest.json`; | ||||
| const MANIFEST_REPO_BRANCH = 'main'; | ||||
| export const MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`; | ||||
|  | ||||
| const IS_WINDOWS = process.platform === 'win32'; | ||||
|  | ||||
| @@ -19,7 +21,8 @@ export async function findReleaseFromManifest( | ||||
|   const manifest: tc.IToolRelease[] = await tc.getManifestFromRepo( | ||||
|     MANIFEST_REPO_OWNER, | ||||
|     MANIFEST_REPO_NAME, | ||||
|     AUTH | ||||
|     AUTH, | ||||
|     MANIFEST_REPO_BRANCH | ||||
|   ); | ||||
|   return await tc.findFromManifest( | ||||
|     semanticVersionSpec, | ||||
| @@ -35,7 +38,10 @@ async function installPython(workingDirectory: string) { | ||||
|     silent: true, | ||||
|     listeners: { | ||||
|       stdout: (data: Buffer) => { | ||||
|         core.debug(data.toString().trim()); | ||||
|         core.info(data.toString().trim()); | ||||
|       }, | ||||
|       stderr: (data: Buffer) => { | ||||
|         core.error(data.toString().trim()); | ||||
|       } | ||||
|     } | ||||
|   }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user