mirror of
				https://kkgithub.com/actions/setup-python.git
				synced 2025-10-28 09:01:50 +08:00 
			
		
		
		
	Compare commits
	
		
			8 Commits
		
	
	
		
			dependabot
			...
			test-macos
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 09262e015b | |||
| 06417d4504 | |||
| d1bb3a8c04 | |||
| ade6528851 | |||
| 3c6f142cc0 | |||
| 88ffd4d597 | |||
| 532b046aaf | |||
| 1264885983 | 
							
								
								
									
										62
									
								
								.github/workflows/e2e-cache-freethreaded.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										62
									
								
								.github/workflows/e2e-cache-freethreaded.yml
									
									
									
									
										vendored
									
									
								
							| @ -6,7 +6,7 @@ on: | ||||
|       - '**.md' | ||||
|   push: | ||||
|     branches: | ||||
|       - main | ||||
|       - test-macos-x64-runner | ||||
|       - releases/* | ||||
|     paths-ignore: | ||||
|       - '**.md' | ||||
| @ -23,13 +23,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             ubuntu-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-22.04-arm, | ||||
|             windows-latest, | ||||
|             macos-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python-version: [3.13.0t, 3.13.1t, 3.13.2t] | ||||
|     steps: | ||||
| @ -50,15 +44,9 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             windows-latest, | ||||
|             macos-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python-version: [3.13.0t, 3.13.1t, 3.13.2t] | ||||
|         python-version: [3.13.1t, 3.13.2t, 3.13.5t] | ||||
|     steps: | ||||
|       - uses: actions/checkout@v4 | ||||
|       - name: Setup Python | ||||
| @ -80,13 +68,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             ubuntu-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-22.04-arm, | ||||
|             windows-latest, | ||||
|             macos-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python-version: [3.13.0, 3.13.1, 3.13.2] | ||||
|     steps: | ||||
| @ -112,13 +94,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             ubuntu-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-22.04-arm, | ||||
|             windows-latest, | ||||
|             macos-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python-version: [3.13.0t, 3.13.1t, 3.13.2t] | ||||
|     steps: | ||||
| @ -140,15 +116,9 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             ubuntu-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-22.04-arm, | ||||
|             windows-latest, | ||||
|             macos-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python-version: [3.13.0t, 3.13.1t, 3.13.2t] | ||||
|         python-version: [3.13.1t, 3.13.2t, 3.13.5t] | ||||
|     steps: | ||||
|       - uses: actions/checkout@v4 | ||||
|       - name: Setup Python | ||||
| @ -171,13 +141,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             ubuntu-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-22.04-arm, | ||||
|             windows-latest, | ||||
|             macos-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python-version: [3.13.0t, 3.13.1t, 3.13.2t] | ||||
|     steps: | ||||
| @ -199,13 +163,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             ubuntu-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-22.04-arm, | ||||
|             windows-latest, | ||||
|             macos-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python-version: [3.13.0t, 3.13.1t, 3.13.2t] | ||||
|     steps: | ||||
|  | ||||
							
								
								
									
										58
									
								
								.github/workflows/e2e-cache.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										58
									
								
								.github/workflows/e2e-cache.yml
									
									
									
									
										vendored
									
									
								
							| @ -6,7 +6,7 @@ on: | ||||
|       - '**.md' | ||||
|   push: | ||||
|     branches: | ||||
|       - main | ||||
|       - test-macos-x64-runner | ||||
|       - releases/* | ||||
|     paths-ignore: | ||||
|       - '**.md' | ||||
| @ -23,13 +23,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             windows-latest, | ||||
|             macos-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python-version: | ||||
|           [ | ||||
| @ -63,13 +57,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             windows-latest, | ||||
|             macos-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python-version: | ||||
|           ['3.10', 'pypy-3.10-v7.x', '3.11', 'pypy-3.11-v7.x', '3.12', '3.13'] | ||||
| @ -120,13 +108,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             windows-latest, | ||||
|             macos-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python-version: | ||||
|           [ | ||||
| @ -161,13 +143,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             windows-latest, | ||||
|             macos-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python-version: | ||||
|           [ | ||||
| @ -202,13 +178,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             windows-latest, | ||||
|             macos-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python-version: | ||||
|           ['3.10', 'pypy-3.10-v7.x', '3.11', 'pypy-3.11-v7.x', '3.12', '3.13'] | ||||
| @ -258,13 +228,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             windows-latest, | ||||
|             macos-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] | ||||
|     steps: | ||||
| @ -286,13 +250,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             windows-latest, | ||||
|             macos-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] | ||||
|     steps: | ||||
|  | ||||
							
								
								
									
										13
									
								
								.github/workflows/e2e-tests.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										13
									
								
								.github/workflows/e2e-tests.yml
									
									
									
									
										vendored
									
									
								
							| @ -3,7 +3,7 @@ name: e2e tests | ||||
| on: | ||||
|   push: | ||||
|     branches: | ||||
|       - main | ||||
|       - test-macos-x64-runner | ||||
|     paths-ignore: | ||||
|       - '**.md' | ||||
|   pull_request: | ||||
| @ -19,13 +19,7 @@ jobs: | ||||
|       matrix: | ||||
|         operating-system: | ||||
|           [ | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm, | ||||
|             macos-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
| @ -38,7 +32,7 @@ jobs: | ||||
|       - name: Verify 3.9.13 | ||||
|         run: python __tests__/verify-python.py 3.9.13 | ||||
|  | ||||
|       - name: Run with setup-python 3.9.13 | ||||
|       - name: Run with setup-python 3.10.11 | ||||
|         uses: ./ | ||||
|         with: | ||||
|           python-version: 3.10.11 | ||||
| @ -89,6 +83,7 @@ jobs: | ||||
|           python-version: '<3.13' | ||||
|       - name: Verify <3.13 | ||||
|         run: python __tests__/verify-python.py 3.12 | ||||
|  | ||||
|       - name: Test Raw Endpoint Access | ||||
|         run: | | ||||
|           curl -L https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json | jq empty | ||||
|  | ||||
							
								
								
									
										18
									
								
								.github/workflows/test-graalpy.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								.github/workflows/test-graalpy.yml
									
									
									
									
										vendored
									
									
								
							| @ -3,7 +3,7 @@ name: Validate GraalPy e2e | ||||
| on: | ||||
|   push: | ||||
|     branches: | ||||
|       - main | ||||
|       - test-macos-x64-runner | ||||
|     paths-ignore: | ||||
|       - '**.md' | ||||
|   pull_request: | ||||
| @ -20,12 +20,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|         graalpy: | ||||
|           - 'graalpy-22.3' | ||||
| @ -75,12 +70,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|         graalpy: ['graalpy22.3', 'graalpy23.0', 'graalpy23.1', 'graalpy24.1'] | ||||
|  | ||||
| @ -106,7 +96,7 @@ jobs: | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [ubuntu-latest, macos-latest, macos-13] | ||||
|         os: [macos-14-large] | ||||
|     steps: | ||||
|       - uses: actions/checkout@v4 | ||||
|       - name: Setup GraalPy and check latest | ||||
|  | ||||
							
								
								
									
										45
									
								
								.github/workflows/test-pypy.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										45
									
								
								.github/workflows/test-pypy.yml
									
									
									
									
										vendored
									
									
								
							| @ -3,7 +3,7 @@ name: Validate PyPy e2e | ||||
| on: | ||||
|   push: | ||||
|     branches: | ||||
|       - main | ||||
|       - test-macos-x64-runner | ||||
|     paths-ignore: | ||||
|       - '**.md' | ||||
|   pull_request: | ||||
| @ -22,13 +22,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|         pypy: | ||||
|           - 'pypy-2.7' | ||||
| @ -85,16 +79,7 @@ jobs: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: | ||||
|           - macos-13 | ||||
|           - macos-14 | ||||
|           - macos-15 | ||||
|           - windows-2019 | ||||
|           - windows-2022 | ||||
|           - windows-2025 | ||||
|           - ubuntu-22.04 | ||||
|           - ubuntu-24.04 | ||||
|           - ubuntu-22.04-arm | ||||
|           - ubuntu-24.04-arm | ||||
|           - macos-14-large | ||||
|         pypy: ['pypy-2.7', 'pypy-3.10', 'pypy-3.11'] | ||||
|  | ||||
|     steps: | ||||
| @ -139,13 +124,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|         pypy: ['pypy2.7', 'pypy3.9', 'pypy3.10-nightly', 'pypy3.11'] | ||||
|  | ||||
| @ -173,13 +152,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|     steps: | ||||
|       - uses: actions/checkout@v4 | ||||
| @ -215,13 +188,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|     steps: | ||||
|       - uses: actions/checkout@v4 | ||||
|  | ||||
							
								
								
									
										106
									
								
								.github/workflows/test-python-freethreaded.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										106
									
								
								.github/workflows/test-python-freethreaded.yml
									
									
									
									
										vendored
									
									
								
							| @ -3,7 +3,7 @@ name: Validate Python e2e freethread | ||||
| on: | ||||
|   push: | ||||
|     branches: | ||||
|       - main | ||||
|       - test-macos-x64-runner | ||||
|     paths-ignore: | ||||
|       - '**.md' | ||||
|   pull_request: | ||||
| @ -22,13 +22,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             macos-13, | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python: [3.13.0t, 3.13.1t, 3.13.2t] | ||||
|     steps: | ||||
| @ -59,13 +53,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             macos-13, | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python: [3.13.0t, 3.13.1t, 3.13.2t] | ||||
|     steps: | ||||
| @ -99,13 +87,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             macos-13, | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python: [3.13.0t, 3.13.1t, 3.13.2t] | ||||
|     steps: | ||||
| @ -137,13 +119,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             macos-13, | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python: [3.13.0, 3.13.1, 3.13.2] | ||||
|     steps: | ||||
| @ -178,13 +154,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             macos-13, | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python: [3.13.0, 3.13.1, 3.13.2] | ||||
|     steps: | ||||
| @ -219,13 +189,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             macos-13, | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python: [3.13.0t, 3.13.1t, 3.13.2t, 3.14t-dev] | ||||
|     steps: | ||||
| @ -250,13 +214,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             macos-13, | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm | ||||
|             macos-14-large | ||||
|           ] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
| @ -287,13 +245,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
| @ -324,13 +276,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
| @ -362,13 +308,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             macos-13, | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python: [3.13.0t, 3.13.1t, 3.13.2t] | ||||
|     steps: | ||||
| @ -395,13 +335,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python-version: [3.13t, 3.14t-dev] | ||||
|     steps: | ||||
| @ -422,13 +356,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|     steps: | ||||
|       - uses: actions/checkout@v4 | ||||
| @ -451,13 +379,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             macos-13, | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python: [3.13.1, 3.13.2, 3.14-dev, 3.14.0-alpha.6] | ||||
|     steps: | ||||
|  | ||||
							
								
								
									
										100
									
								
								.github/workflows/test-python.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										100
									
								
								.github/workflows/test-python.yml
									
									
									
									
										vendored
									
									
								
							| @ -3,7 +3,7 @@ name: Validate Python e2e | ||||
| on: | ||||
|   push: | ||||
|     branches: | ||||
|       - main | ||||
|       - test-macos-x64-runner | ||||
|     paths-ignore: | ||||
|       - '**.md' | ||||
|   pull_request: | ||||
| @ -22,13 +22,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             macos-13, | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python: [3.9.13, 3.10.11, 3.11.9, 3.12.3, 3.13.2] | ||||
|     steps: | ||||
| @ -66,13 +60,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             macos-13, | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python: [3.9.13, 3.10.11, 3.11.9, 3.12.3, 3.13.2] | ||||
|     steps: | ||||
| @ -113,13 +101,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             macos-13, | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python: [3.9.13, 3.10.11, 3.11.9, 3.12.3, 3.13.2] | ||||
|     steps: | ||||
| @ -158,13 +140,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             macos-13, | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python: [3.9.13, 3.10.11, 3.11.9, '==3.12.3', 3.13.2] | ||||
|     steps: | ||||
| @ -208,13 +184,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             macos-13, | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python: [3.9.13, 3.10.11, 3.11.9, 3.12.3, 3.13.2] | ||||
|     steps: | ||||
| @ -258,13 +228,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             macos-13, | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python: [pypy3.11-7.3.18, graalpy-24.1.2, 3.13.2, 3.14-dev] | ||||
|         exclude: | ||||
| @ -292,13 +256,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             macos-13, | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm | ||||
|             macos-14-large | ||||
|           ] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
| @ -335,13 +293,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
| @ -372,13 +324,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
| @ -410,13 +356,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             macos-13, | ||||
|             ubuntu-latest, | ||||
|             ubuntu-24.04-arm | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python: ['3.9', '3.10', '3.11', '3.12', '3.13'] | ||||
|     steps: | ||||
| @ -443,13 +383,7 @@ jobs: | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-latest, | ||||
|             macos-13 | ||||
|             macos-14-large | ||||
|           ] | ||||
|         python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] | ||||
|     steps: | ||||
| @ -475,14 +409,8 @@ jobs: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: | ||||
|           [ | ||||
|             macos-latest, | ||||
|             windows-latest, | ||||
|             ubuntu-22.04, | ||||
|             ubuntu-22.04-arm, | ||||
|             ubuntu-24.04-arm, | ||||
|             ubuntu-latest, | ||||
|             macos-13 | ||||
|          [ | ||||
|             macos-14-large | ||||
|           ] | ||||
|     steps: | ||||
|       - uses: actions/checkout@v4 | ||||
|  | ||||
| @ -94,6 +94,8 @@ steps: | ||||
|  | ||||
| >The requirements file format allows for specifying dependency versions using logical operators (for example chardet>=3.0.4) or specifying dependencies without any versions. In this case the pip install -r requirements.txt command will always try to install the latest available package version. To be sure that the cache will be used, please stick to a specific dependency version and update it manually if necessary. | ||||
|  | ||||
| >The `setup-python` action does not handle authentication for pip when installing packages from private repositories. For help, refer [pip’s VCS support documentation](https://pip.pypa.io/en/stable/topics/vcs-support/) or visit the [pip repository](https://github.com/pypa/pip). | ||||
|  | ||||
| See examples of using `cache` and `cache-dependency-path` for `pipenv` and `poetry` in the section: [Caching packages](docs/advanced-usage.md#caching-packages) of the [Advanced usage](docs/advanced-usage.md) guide. | ||||
|  | ||||
| ## Advanced usage | ||||
|  | ||||
							
								
								
									
										149
									
								
								__tests__/setup-python.test.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										149
									
								
								__tests__/setup-python.test.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,149 @@ | ||||
| import * as core from '@actions/core'; | ||||
| import * as fs from 'fs'; | ||||
| import * as path from 'path'; | ||||
| import {cacheDependencies} from '../src/setup-python'; | ||||
| import {getCacheDistributor} from '../src/cache-distributions/cache-factory'; | ||||
|  | ||||
| jest.mock('fs', () => { | ||||
|   const actualFs = jest.requireActual('fs'); | ||||
|   return { | ||||
|     ...actualFs, | ||||
|     promises: { | ||||
|       access: jest.fn(), | ||||
|       mkdir: jest.fn(), | ||||
|       copyFile: jest.fn(), | ||||
|       writeFile: jest.fn(), | ||||
|       appendFile: jest.fn() | ||||
|     } | ||||
|   }; | ||||
| }); | ||||
| jest.mock('@actions/core'); | ||||
| jest.mock('../src/cache-distributions/cache-factory'); | ||||
|  | ||||
| const mockedFsPromises = fs.promises as jest.Mocked<typeof fs.promises>; | ||||
| const mockedCore = core as jest.Mocked<typeof core>; | ||||
| const mockedGetCacheDistributor = getCacheDistributor as jest.Mock; | ||||
|  | ||||
| describe('cacheDependencies', () => { | ||||
|   const mockRestoreCache = jest.fn(); | ||||
|  | ||||
|   beforeEach(() => { | ||||
|     jest.clearAllMocks(); | ||||
|     process.env.GITHUB_ACTION_PATH = '/github/action'; | ||||
|     process.env.GITHUB_WORKSPACE = '/github/workspace'; | ||||
|  | ||||
|     mockedCore.getInput.mockReturnValue('nested/deps.lock'); | ||||
|  | ||||
|     // Simulate file exists by resolving access without error | ||||
|     mockedFsPromises.access.mockImplementation(async p => { | ||||
|       const pathStr = typeof p === 'string' ? p : p.toString(); | ||||
|       if (pathStr === '/github/action/nested/deps.lock') { | ||||
|         return Promise.resolve(); | ||||
|       } | ||||
|       // Simulate directory doesn't exist to test mkdir | ||||
|       if (pathStr === path.dirname('/github/workspace/nested/deps.lock')) { | ||||
|         return Promise.reject(new Error('no dir')); | ||||
|       } | ||||
|       return Promise.resolve(); | ||||
|     }); | ||||
|  | ||||
|     // Simulate mkdir success | ||||
|     mockedFsPromises.mkdir.mockResolvedValue(undefined); | ||||
|  | ||||
|     // Simulate copyFile success | ||||
|     mockedFsPromises.copyFile.mockResolvedValue(undefined); | ||||
|  | ||||
|     mockedGetCacheDistributor.mockReturnValue({restoreCache: mockRestoreCache}); | ||||
|   }); | ||||
|  | ||||
|   it('copies the dependency file and resolves the path with directory structure', async () => { | ||||
|     await cacheDependencies('pip', '3.12'); | ||||
|  | ||||
|     const sourcePath = path.resolve('/github/action', 'nested/deps.lock'); | ||||
|     const targetPath = path.resolve('/github/workspace', 'nested/deps.lock'); | ||||
|  | ||||
|     expect(mockedFsPromises.access).toHaveBeenCalledWith( | ||||
|       sourcePath, | ||||
|       fs.constants.F_OK | ||||
|     ); | ||||
|     expect(mockedFsPromises.mkdir).toHaveBeenCalledWith( | ||||
|       path.dirname(targetPath), | ||||
|       { | ||||
|         recursive: true | ||||
|       } | ||||
|     ); | ||||
|     expect(mockedFsPromises.copyFile).toHaveBeenCalledWith( | ||||
|       sourcePath, | ||||
|       targetPath | ||||
|     ); | ||||
|     expect(mockedCore.info).toHaveBeenCalledWith( | ||||
|       `Copied ${sourcePath} to ${targetPath}` | ||||
|     ); | ||||
|     expect(mockedCore.info).toHaveBeenCalledWith( | ||||
|       `Resolved cache-dependency-path: nested/deps.lock` | ||||
|     ); | ||||
|     expect(mockRestoreCache).toHaveBeenCalled(); | ||||
|   }); | ||||
|  | ||||
|   it('warns if the dependency file does not exist', async () => { | ||||
|     // Simulate file does not exist by rejecting access | ||||
|     mockedFsPromises.access.mockRejectedValue(new Error('file not found')); | ||||
|  | ||||
|     await cacheDependencies('pip', '3.12'); | ||||
|  | ||||
|     expect(mockedCore.warning).toHaveBeenCalledWith( | ||||
|       expect.stringContaining('does not exist') | ||||
|     ); | ||||
|     expect(mockedFsPromises.copyFile).not.toHaveBeenCalled(); | ||||
|     expect(mockRestoreCache).toHaveBeenCalled(); | ||||
|   }); | ||||
|  | ||||
|   it('warns if file copy fails', async () => { | ||||
|     // Simulate copyFile failure | ||||
|     mockedFsPromises.copyFile.mockRejectedValue(new Error('copy failed')); | ||||
|  | ||||
|     await cacheDependencies('pip', '3.12'); | ||||
|  | ||||
|     expect(mockedCore.warning).toHaveBeenCalledWith( | ||||
|       expect.stringContaining('Failed to copy file') | ||||
|     ); | ||||
|     expect(mockRestoreCache).toHaveBeenCalled(); | ||||
|   }); | ||||
|  | ||||
|   it('skips path logic if no input is provided', async () => { | ||||
|     mockedCore.getInput.mockReturnValue(''); | ||||
|  | ||||
|     await cacheDependencies('pip', '3.12'); | ||||
|  | ||||
|     expect(mockedFsPromises.copyFile).not.toHaveBeenCalled(); | ||||
|     expect(mockedCore.warning).not.toHaveBeenCalled(); | ||||
|     expect(mockRestoreCache).toHaveBeenCalled(); | ||||
|   }); | ||||
|  | ||||
|   it('does not copy if dependency file is already inside the workspace but still sets resolved path', async () => { | ||||
|     // Simulate cacheDependencyPath inside workspace | ||||
|     mockedCore.getInput.mockReturnValue('deps.lock'); | ||||
|  | ||||
|     // Override sourcePath and targetPath to be equal | ||||
|     const actionPath = '/github/workspace'; // same path for action and workspace | ||||
|     process.env.GITHUB_ACTION_PATH = actionPath; | ||||
|     process.env.GITHUB_WORKSPACE = actionPath; | ||||
|  | ||||
|     // access resolves to simulate file exists | ||||
|     mockedFsPromises.access.mockResolvedValue(); | ||||
|  | ||||
|     await cacheDependencies('pip', '3.12'); | ||||
|  | ||||
|     const sourcePath = path.resolve(actionPath, 'deps.lock'); | ||||
|     const targetPath = sourcePath; // same path | ||||
|  | ||||
|     expect(mockedFsPromises.copyFile).not.toHaveBeenCalled(); | ||||
|     expect(mockedCore.info).toHaveBeenCalledWith( | ||||
|       `Dependency file is already inside the workspace: ${sourcePath}` | ||||
|     ); | ||||
|     expect(mockedCore.info).toHaveBeenCalledWith( | ||||
|       `Resolved cache-dependency-path: deps.lock` | ||||
|     ); | ||||
|     expect(mockRestoreCache).toHaveBeenCalled(); | ||||
|   }); | ||||
| }); | ||||
							
								
								
									
										70
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										70
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							| @ -95875,7 +95875,7 @@ function findPyPyVersion(versionSpec, architecture, updateEnvironment, checkLate | ||||
|             core.addPath(pythonLocation); | ||||
|             core.addPath(_binDir); | ||||
|         } | ||||
|         core.setOutput('python-version', 'pypy' + resolvedPyPyVersion); | ||||
|         core.setOutput('python-version', `pypy${resolvedPythonVersion}-${resolvedPyPyVersion}`); | ||||
|         core.setOutput('python-path', pythonPath); | ||||
|         return { resolvedPyPyVersion, resolvedPythonVersion }; | ||||
|     }); | ||||
| @ -96103,11 +96103,32 @@ function useCpythonVersion(version, architecture, updateEnvironment, checkLatest | ||||
|             if (utils_1.IS_WINDOWS) { | ||||
|                 // Add --user directory
 | ||||
|                 // `installDir` from tool cache should look like $RUNNER_TOOL_CACHE/Python/<semantic version>/x64/
 | ||||
|                 // So if `findLocalTool` succeeded above, we must have a conformant `installDir`
 | ||||
|                 // Extract version details
 | ||||
|                 const version = path.basename(path.dirname(installDir)); | ||||
|                 const major = semver.major(version); | ||||
|                 const minor = semver.minor(version); | ||||
|                 const userScriptsDir = path.join(process.env['APPDATA'] || '', 'Python', `Python${major}${minor}`, 'Scripts'); | ||||
|                 const basePath = process.env['APPDATA'] || ''; | ||||
|                 let versionSuffix = `${major}${minor}`; | ||||
|                 // Append '-32' for x86 architecture if Python version is >= 3.10
 | ||||
|                 if (architecture === 'x86' && | ||||
|                     (major > 3 || (major === 3 && minor >= 10))) { | ||||
|                     versionSuffix += '-32'; | ||||
|                 } | ||||
|                 else if (architecture === 'arm64') { | ||||
|                     versionSuffix += '-arm64'; | ||||
|                 } | ||||
|                 // Append 't' for freethreaded builds
 | ||||
|                 if (freethreaded) { | ||||
|                     versionSuffix += 't'; | ||||
|                     if (architecture === 'x86-freethreaded') { | ||||
|                         versionSuffix += '-32'; | ||||
|                     } | ||||
|                     else if (architecture === 'arm64-freethreaded') { | ||||
|                         versionSuffix += '-arm64'; | ||||
|                     } | ||||
|                 } | ||||
|                 // Add user Scripts path
 | ||||
|                 const userScriptsDir = path.join(basePath, 'Python', `Python${versionSuffix}`, 'Scripts'); | ||||
|                 core.addPath(userScriptsDir); | ||||
|             } | ||||
|             // On Linux and macOS, pip will create the --user directory and add it to PATH as needed.
 | ||||
| @ -96844,6 +96865,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { | ||||
|     return (mod && mod.__esModule) ? mod : { "default": mod }; | ||||
| }; | ||||
| Object.defineProperty(exports, "__esModule", ({ value: true })); | ||||
| exports.cacheDependencies = void 0; | ||||
| const core = __importStar(__nccwpck_require__(7484)); | ||||
| const finder = __importStar(__nccwpck_require__(6843)); | ||||
| const finderPyPy = __importStar(__nccwpck_require__(2625)); | ||||
| @ -96862,10 +96884,50 @@ function isGraalPyVersion(versionSpec) { | ||||
| function cacheDependencies(cache, pythonVersion) { | ||||
|     return __awaiter(this, void 0, void 0, function* () { | ||||
|         const cacheDependencyPath = core.getInput('cache-dependency-path') || undefined; | ||||
|         const cacheDistributor = (0, cache_factory_1.getCacheDistributor)(cache, pythonVersion, cacheDependencyPath); | ||||
|         let resolvedDependencyPath = undefined; | ||||
|         if (cacheDependencyPath) { | ||||
|             const actionPath = process.env.GITHUB_ACTION_PATH || ''; | ||||
|             const workspace = process.env.GITHUB_WORKSPACE || process.cwd(); | ||||
|             const sourcePath = path.resolve(actionPath, cacheDependencyPath); | ||||
|             const relativePath = path.relative(actionPath, sourcePath); | ||||
|             const targetPath = path.resolve(workspace, relativePath); | ||||
|             try { | ||||
|                 const sourceExists = yield fs_1.default.promises | ||||
|                     .access(sourcePath, fs_1.default.constants.F_OK) | ||||
|                     .then(() => true) | ||||
|                     .catch(() => false); | ||||
|                 if (!sourceExists) { | ||||
|                     core.warning(`The resolved cache-dependency-path does not exist: ${sourcePath}`); | ||||
|                 } | ||||
|                 else { | ||||
|                     if (sourcePath !== targetPath) { | ||||
|                         const targetDir = path.dirname(targetPath); | ||||
|                         // Create target directory if it doesn't exist
 | ||||
|                         yield fs_1.default.promises.mkdir(targetDir, { recursive: true }); | ||||
|                         // Copy file asynchronously
 | ||||
|                         yield fs_1.default.promises.copyFile(sourcePath, targetPath); | ||||
|                         core.info(`Copied ${sourcePath} to ${targetPath}`); | ||||
|                     } | ||||
|                     else { | ||||
|                         core.info(`Dependency file is already inside the workspace: ${sourcePath}`); | ||||
|                     } | ||||
|                     resolvedDependencyPath = path | ||||
|                         .relative(workspace, targetPath) | ||||
|                         .replace(/\\/g, '/'); | ||||
|                     core.info(`Resolved cache-dependency-path: ${resolvedDependencyPath}`); | ||||
|                 } | ||||
|             } | ||||
|             catch (error) { | ||||
|                 core.warning(`Failed to copy file from ${sourcePath} to ${targetPath}: ${error}`); | ||||
|             } | ||||
|         } | ||||
|         // Pass resolvedDependencyPath if available, else fallback to original input
 | ||||
|         const dependencyPathForCache = resolvedDependencyPath !== null && resolvedDependencyPath !== void 0 ? resolvedDependencyPath : cacheDependencyPath; | ||||
|         const cacheDistributor = (0, cache_factory_1.getCacheDistributor)(cache, pythonVersion, dependencyPathForCache); | ||||
|         yield cacheDistributor.restoreCache(); | ||||
|     }); | ||||
| } | ||||
| exports.cacheDependencies = cacheDependencies; | ||||
| function resolveVersionInputFromDefaultFile() { | ||||
|     const couples = [ | ||||
|         ['.python-version', utils_1.getVersionsInputFromPlainFile] | ||||
|  | ||||
| @ -412,7 +412,7 @@ steps: | ||||
| - run: pip install -e . | ||||
|   # Or pip install -e '.[test]' to install test dependencies | ||||
| ``` | ||||
|  | ||||
| Note: cache-dependency-path supports files located outside the workspace root by copying them into the workspace to enable proper caching. | ||||
| # Outputs and environment variables | ||||
|  | ||||
| ## Outputs | ||||
|  | ||||
							
								
								
									
										237
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										237
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @ -28,7 +28,7 @@ | ||||
|         "@vercel/ncc": "^0.38.3", | ||||
|         "eslint": "^8.57.0", | ||||
|         "eslint-config-prettier": "^8.6.0", | ||||
|         "eslint-plugin-jest": "^29.0.1", | ||||
|         "eslint-plugin-jest": "^27.9.0", | ||||
|         "eslint-plugin-node": "^11.1.0", | ||||
|         "jest": "^29.7.0", | ||||
|         "jest-circus": "^29.7.0", | ||||
| @ -827,20 +827,16 @@ | ||||
|       "dev": true | ||||
|     }, | ||||
|     "node_modules/@eslint-community/eslint-utils": { | ||||
|       "version": "4.7.0", | ||||
|       "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", | ||||
|       "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==", | ||||
|       "version": "4.4.0", | ||||
|       "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", | ||||
|       "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", | ||||
|       "dev": true, | ||||
|       "license": "MIT", | ||||
|       "dependencies": { | ||||
|         "eslint-visitor-keys": "^3.4.3" | ||||
|         "eslint-visitor-keys": "^3.3.0" | ||||
|       }, | ||||
|       "engines": { | ||||
|         "node": "^12.22.0 || ^14.17.0 || >=16.0.0" | ||||
|       }, | ||||
|       "funding": { | ||||
|         "url": "https://opencollective.com/eslint" | ||||
|       }, | ||||
|       "peerDependencies": { | ||||
|         "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" | ||||
|       } | ||||
| @ -1720,42 +1716,6 @@ | ||||
|         } | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/@typescript-eslint/project-service": { | ||||
|       "version": "8.34.1", | ||||
|       "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.34.1.tgz", | ||||
|       "integrity": "sha512-nuHlOmFZfuRwLJKDGQOVc0xnQrAmuq1Mj/ISou5044y1ajGNp2BNliIqp7F2LPQ5sForz8lempMFCovfeS1XoA==", | ||||
|       "dev": true, | ||||
|       "license": "MIT", | ||||
|       "dependencies": { | ||||
|         "@typescript-eslint/tsconfig-utils": "^8.34.1", | ||||
|         "@typescript-eslint/types": "^8.34.1", | ||||
|         "debug": "^4.3.4" | ||||
|       }, | ||||
|       "engines": { | ||||
|         "node": "^18.18.0 || ^20.9.0 || >=21.1.0" | ||||
|       }, | ||||
|       "funding": { | ||||
|         "type": "opencollective", | ||||
|         "url": "https://opencollective.com/typescript-eslint" | ||||
|       }, | ||||
|       "peerDependencies": { | ||||
|         "typescript": ">=4.8.4 <5.9.0" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/@typescript-eslint/project-service/node_modules/@typescript-eslint/types": { | ||||
|       "version": "8.34.1", | ||||
|       "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.34.1.tgz", | ||||
|       "integrity": "sha512-rjLVbmE7HR18kDsjNIZQHxmv9RZwlgzavryL5Lnj2ujIRTeXlKtILHgRNmQ3j4daw7zd+mQgy+uyt6Zo6I0IGA==", | ||||
|       "dev": true, | ||||
|       "license": "MIT", | ||||
|       "engines": { | ||||
|         "node": "^18.18.0 || ^20.9.0 || >=21.1.0" | ||||
|       }, | ||||
|       "funding": { | ||||
|         "type": "opencollective", | ||||
|         "url": "https://opencollective.com/typescript-eslint" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/@typescript-eslint/scope-manager": { | ||||
|       "version": "5.62.0", | ||||
|       "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", | ||||
| @ -1773,23 +1733,6 @@ | ||||
|         "url": "https://opencollective.com/typescript-eslint" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/@typescript-eslint/tsconfig-utils": { | ||||
|       "version": "8.34.1", | ||||
|       "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.34.1.tgz", | ||||
|       "integrity": "sha512-K4Sjdo4/xF9NEeA2khOb7Y5nY6NSXBnod87uniVYW9kHP+hNlDV8trUSFeynA2uxWam4gIWgWoygPrv9VMWrYg==", | ||||
|       "dev": true, | ||||
|       "license": "MIT", | ||||
|       "engines": { | ||||
|         "node": "^18.18.0 || ^20.9.0 || >=21.1.0" | ||||
|       }, | ||||
|       "funding": { | ||||
|         "type": "opencollective", | ||||
|         "url": "https://opencollective.com/typescript-eslint" | ||||
|       }, | ||||
|       "peerDependencies": { | ||||
|         "typescript": ">=4.8.4 <5.9.0" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/@typescript-eslint/type-utils": { | ||||
|       "version": "5.62.0", | ||||
|       "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", | ||||
| @ -2698,20 +2641,19 @@ | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/eslint-plugin-jest": { | ||||
|       "version": "29.0.1", | ||||
|       "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.0.1.tgz", | ||||
|       "integrity": "sha512-EE44T0OSMCeXhDrrdsbKAhprobKkPtJTbQz5yEktysNpHeDZTAL1SfDTNKmcFfJkY6yrQLtTKZALrD3j/Gpmiw==", | ||||
|       "version": "27.9.0", | ||||
|       "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.9.0.tgz", | ||||
|       "integrity": "sha512-QIT7FH7fNmd9n4se7FFKHbsLKGQiw885Ds6Y/sxKgCZ6natwCsXdgPOADnYVxN2QrRweF0FZWbJ6S7Rsn7llug==", | ||||
|       "dev": true, | ||||
|       "license": "MIT", | ||||
|       "dependencies": { | ||||
|         "@typescript-eslint/utils": "^8.0.0" | ||||
|         "@typescript-eslint/utils": "^5.10.0" | ||||
|       }, | ||||
|       "engines": { | ||||
|         "node": "^20.12.0 || ^22.0.0 || >=24.0.0" | ||||
|         "node": "^14.15.0 || ^16.10.0 || >=18.0.0" | ||||
|       }, | ||||
|       "peerDependencies": { | ||||
|         "@typescript-eslint/eslint-plugin": "^8.0.0", | ||||
|         "eslint": "^8.57.0 || ^9.0.0", | ||||
|         "@typescript-eslint/eslint-plugin": "^5.0.0 || ^6.0.0 || ^7.0.0", | ||||
|         "eslint": "^7.0.0 || ^8.0.0", | ||||
|         "jest": "*" | ||||
|       }, | ||||
|       "peerDependenciesMeta": { | ||||
| @ -2723,148 +2665,6 @@ | ||||
|         } | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/scope-manager": { | ||||
|       "version": "8.34.1", | ||||
|       "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.34.1.tgz", | ||||
|       "integrity": "sha512-beu6o6QY4hJAgL1E8RaXNC071G4Kso2MGmJskCFQhRhg8VOH/FDbC8soP8NHN7e/Hdphwp8G8cE6OBzC8o41ZA==", | ||||
|       "dev": true, | ||||
|       "license": "MIT", | ||||
|       "dependencies": { | ||||
|         "@typescript-eslint/types": "8.34.1", | ||||
|         "@typescript-eslint/visitor-keys": "8.34.1" | ||||
|       }, | ||||
|       "engines": { | ||||
|         "node": "^18.18.0 || ^20.9.0 || >=21.1.0" | ||||
|       }, | ||||
|       "funding": { | ||||
|         "type": "opencollective", | ||||
|         "url": "https://opencollective.com/typescript-eslint" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/types": { | ||||
|       "version": "8.34.1", | ||||
|       "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.34.1.tgz", | ||||
|       "integrity": "sha512-rjLVbmE7HR18kDsjNIZQHxmv9RZwlgzavryL5Lnj2ujIRTeXlKtILHgRNmQ3j4daw7zd+mQgy+uyt6Zo6I0IGA==", | ||||
|       "dev": true, | ||||
|       "license": "MIT", | ||||
|       "engines": { | ||||
|         "node": "^18.18.0 || ^20.9.0 || >=21.1.0" | ||||
|       }, | ||||
|       "funding": { | ||||
|         "type": "opencollective", | ||||
|         "url": "https://opencollective.com/typescript-eslint" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/typescript-estree": { | ||||
|       "version": "8.34.1", | ||||
|       "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.34.1.tgz", | ||||
|       "integrity": "sha512-rjCNqqYPuMUF5ODD+hWBNmOitjBWghkGKJg6hiCHzUvXRy6rK22Jd3rwbP2Xi+R7oYVvIKhokHVhH41BxPV5mA==", | ||||
|       "dev": true, | ||||
|       "license": "MIT", | ||||
|       "dependencies": { | ||||
|         "@typescript-eslint/project-service": "8.34.1", | ||||
|         "@typescript-eslint/tsconfig-utils": "8.34.1", | ||||
|         "@typescript-eslint/types": "8.34.1", | ||||
|         "@typescript-eslint/visitor-keys": "8.34.1", | ||||
|         "debug": "^4.3.4", | ||||
|         "fast-glob": "^3.3.2", | ||||
|         "is-glob": "^4.0.3", | ||||
|         "minimatch": "^9.0.4", | ||||
|         "semver": "^7.6.0", | ||||
|         "ts-api-utils": "^2.1.0" | ||||
|       }, | ||||
|       "engines": { | ||||
|         "node": "^18.18.0 || ^20.9.0 || >=21.1.0" | ||||
|       }, | ||||
|       "funding": { | ||||
|         "type": "opencollective", | ||||
|         "url": "https://opencollective.com/typescript-eslint" | ||||
|       }, | ||||
|       "peerDependencies": { | ||||
|         "typescript": ">=4.8.4 <5.9.0" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/utils": { | ||||
|       "version": "8.34.1", | ||||
|       "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.34.1.tgz", | ||||
|       "integrity": "sha512-mqOwUdZ3KjtGk7xJJnLbHxTuWVn3GO2WZZuM+Slhkun4+qthLdXx32C8xIXbO1kfCECb3jIs3eoxK3eryk7aoQ==", | ||||
|       "dev": true, | ||||
|       "license": "MIT", | ||||
|       "dependencies": { | ||||
|         "@eslint-community/eslint-utils": "^4.7.0", | ||||
|         "@typescript-eslint/scope-manager": "8.34.1", | ||||
|         "@typescript-eslint/types": "8.34.1", | ||||
|         "@typescript-eslint/typescript-estree": "8.34.1" | ||||
|       }, | ||||
|       "engines": { | ||||
|         "node": "^18.18.0 || ^20.9.0 || >=21.1.0" | ||||
|       }, | ||||
|       "funding": { | ||||
|         "type": "opencollective", | ||||
|         "url": "https://opencollective.com/typescript-eslint" | ||||
|       }, | ||||
|       "peerDependencies": { | ||||
|         "eslint": "^8.57.0 || ^9.0.0", | ||||
|         "typescript": ">=4.8.4 <5.9.0" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/visitor-keys": { | ||||
|       "version": "8.34.1", | ||||
|       "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.34.1.tgz", | ||||
|       "integrity": "sha512-xoh5rJ+tgsRKoXnkBPFRLZ7rjKM0AfVbC68UZ/ECXoDbfggb9RbEySN359acY1vS3qZ0jVTVWzbtfapwm5ztxw==", | ||||
|       "dev": true, | ||||
|       "license": "MIT", | ||||
|       "dependencies": { | ||||
|         "@typescript-eslint/types": "8.34.1", | ||||
|         "eslint-visitor-keys": "^4.2.1" | ||||
|       }, | ||||
|       "engines": { | ||||
|         "node": "^18.18.0 || ^20.9.0 || >=21.1.0" | ||||
|       }, | ||||
|       "funding": { | ||||
|         "type": "opencollective", | ||||
|         "url": "https://opencollective.com/typescript-eslint" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/eslint-plugin-jest/node_modules/brace-expansion": { | ||||
|       "version": "2.0.2", | ||||
|       "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", | ||||
|       "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", | ||||
|       "dev": true, | ||||
|       "license": "MIT", | ||||
|       "dependencies": { | ||||
|         "balanced-match": "^1.0.0" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/eslint-plugin-jest/node_modules/eslint-visitor-keys": { | ||||
|       "version": "4.2.1", | ||||
|       "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", | ||||
|       "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", | ||||
|       "dev": true, | ||||
|       "license": "Apache-2.0", | ||||
|       "engines": { | ||||
|         "node": "^18.18.0 || ^20.9.0 || >=21.1.0" | ||||
|       }, | ||||
|       "funding": { | ||||
|         "url": "https://opencollective.com/eslint" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/eslint-plugin-jest/node_modules/minimatch": { | ||||
|       "version": "9.0.5", | ||||
|       "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", | ||||
|       "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", | ||||
|       "dev": true, | ||||
|       "license": "ISC", | ||||
|       "dependencies": { | ||||
|         "brace-expansion": "^2.0.1" | ||||
|       }, | ||||
|       "engines": { | ||||
|         "node": ">=16 || 14 >=14.17" | ||||
|       }, | ||||
|       "funding": { | ||||
|         "url": "https://github.com/sponsors/isaacs" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/eslint-plugin-node": { | ||||
|       "version": "11.1.0", | ||||
|       "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", | ||||
| @ -5324,19 +5124,6 @@ | ||||
|       "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", | ||||
|       "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" | ||||
|     }, | ||||
|     "node_modules/ts-api-utils": { | ||||
|       "version": "2.1.0", | ||||
|       "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", | ||||
|       "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", | ||||
|       "dev": true, | ||||
|       "license": "MIT", | ||||
|       "engines": { | ||||
|         "node": ">=18.12" | ||||
|       }, | ||||
|       "peerDependencies": { | ||||
|         "typescript": ">=4.8.4" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/ts-jest": { | ||||
|       "version": "29.3.2", | ||||
|       "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.3.2.tgz", | ||||
|  | ||||
| @ -44,7 +44,7 @@ | ||||
|     "@vercel/ncc": "^0.38.3", | ||||
|     "eslint": "^8.57.0", | ||||
|     "eslint-config-prettier": "^8.6.0", | ||||
|     "eslint-plugin-jest": "^29.0.1", | ||||
|     "eslint-plugin-jest": "^27.9.0", | ||||
|     "eslint-plugin-node": "^11.1.0", | ||||
|     "jest": "^29.7.0", | ||||
|     "jest-circus": "^29.7.0", | ||||
|  | ||||
| @ -96,7 +96,10 @@ export async function findPyPyVersion( | ||||
|     core.addPath(pythonLocation); | ||||
|     core.addPath(_binDir); | ||||
|   } | ||||
|   core.setOutput('python-version', 'pypy' + resolvedPyPyVersion); | ||||
|   core.setOutput( | ||||
|     'python-version', | ||||
|     `pypy${resolvedPythonVersion}-${resolvedPyPyVersion}` | ||||
|   ); | ||||
|   core.setOutput('python-path', pythonPath); | ||||
|  | ||||
|   return {resolvedPyPyVersion, resolvedPythonVersion}; | ||||
|  | ||||
| @ -71,8 +71,8 @@ export async function useCpythonVersion( | ||||
|     // Use the freethreaded version if it was specified in the input, e.g., 3.13t | ||||
|     freethreaded = true; | ||||
|   } | ||||
|   core.debug(`Semantic version spec of ${version} is ${semanticVersionSpec}`); | ||||
|  | ||||
|   core.debug(`Semantic version spec of ${version} is ${semanticVersionSpec}`); | ||||
|   if (freethreaded) { | ||||
|     // Free threaded versions use an architecture suffix like `x64-freethreaded` | ||||
|     core.debug(`Using freethreaded version of ${semanticVersionSpec}`); | ||||
| @ -176,15 +176,36 @@ export async function useCpythonVersion( | ||||
|     if (IS_WINDOWS) { | ||||
|       // Add --user directory | ||||
|       // `installDir` from tool cache should look like $RUNNER_TOOL_CACHE/Python/<semantic version>/x64/ | ||||
|       // So if `findLocalTool` succeeded above, we must have a conformant `installDir` | ||||
|       // Extract version details | ||||
|       const version = path.basename(path.dirname(installDir)); | ||||
|       const major = semver.major(version); | ||||
|       const minor = semver.minor(version); | ||||
|  | ||||
|       const basePath = process.env['APPDATA'] || ''; | ||||
|       let versionSuffix = `${major}${minor}`; | ||||
|       // Append '-32' for x86 architecture if Python version is >= 3.10 | ||||
|       if ( | ||||
|         architecture === 'x86' && | ||||
|         (major > 3 || (major === 3 && minor >= 10)) | ||||
|       ) { | ||||
|         versionSuffix += '-32'; | ||||
|       } else if (architecture === 'arm64') { | ||||
|         versionSuffix += '-arm64'; | ||||
|       } | ||||
|       // Append 't' for freethreaded builds | ||||
|       if (freethreaded) { | ||||
|         versionSuffix += 't'; | ||||
|         if (architecture === 'x86-freethreaded') { | ||||
|           versionSuffix += '-32'; | ||||
|         } else if (architecture === 'arm64-freethreaded') { | ||||
|           versionSuffix += '-arm64'; | ||||
|         } | ||||
|       } | ||||
|       // Add user Scripts path | ||||
|       const userScriptsDir = path.join( | ||||
|         process.env['APPDATA'] || '', | ||||
|         basePath, | ||||
|         'Python', | ||||
|         `Python${major}${minor}`, | ||||
|         `Python${versionSuffix}`, | ||||
|         'Scripts' | ||||
|       ); | ||||
|       core.addPath(userScriptsDir); | ||||
|  | ||||
| @ -22,13 +22,62 @@ function isGraalPyVersion(versionSpec: string) { | ||||
|   return versionSpec.startsWith('graalpy'); | ||||
| } | ||||
|  | ||||
| async function cacheDependencies(cache: string, pythonVersion: string) { | ||||
| export async function cacheDependencies(cache: string, pythonVersion: string) { | ||||
|   const cacheDependencyPath = | ||||
|     core.getInput('cache-dependency-path') || undefined; | ||||
|   let resolvedDependencyPath: string | undefined = undefined; | ||||
|  | ||||
|   if (cacheDependencyPath) { | ||||
|     const actionPath = process.env.GITHUB_ACTION_PATH || ''; | ||||
|     const workspace = process.env.GITHUB_WORKSPACE || process.cwd(); | ||||
|  | ||||
|     const sourcePath = path.resolve(actionPath, cacheDependencyPath); | ||||
|     const relativePath = path.relative(actionPath, sourcePath); | ||||
|     const targetPath = path.resolve(workspace, relativePath); | ||||
|  | ||||
|     try { | ||||
|       const sourceExists = await fs.promises | ||||
|         .access(sourcePath, fs.constants.F_OK) | ||||
|         .then(() => true) | ||||
|         .catch(() => false); | ||||
|  | ||||
|       if (!sourceExists) { | ||||
|         core.warning( | ||||
|           `The resolved cache-dependency-path does not exist: ${sourcePath}` | ||||
|         ); | ||||
|       } else { | ||||
|         if (sourcePath !== targetPath) { | ||||
|           const targetDir = path.dirname(targetPath); | ||||
|           // Create target directory if it doesn't exist | ||||
|           await fs.promises.mkdir(targetDir, {recursive: true}); | ||||
|           // Copy file asynchronously | ||||
|           await fs.promises.copyFile(sourcePath, targetPath); | ||||
|           core.info(`Copied ${sourcePath} to ${targetPath}`); | ||||
|         } else { | ||||
|           core.info( | ||||
|             `Dependency file is already inside the workspace: ${sourcePath}` | ||||
|           ); | ||||
|         } | ||||
|  | ||||
|         resolvedDependencyPath = path | ||||
|           .relative(workspace, targetPath) | ||||
|           .replace(/\\/g, '/'); | ||||
|         core.info(`Resolved cache-dependency-path: ${resolvedDependencyPath}`); | ||||
|       } | ||||
|     } catch (error) { | ||||
|       core.warning( | ||||
|         `Failed to copy file from ${sourcePath} to ${targetPath}: ${error}` | ||||
|       ); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   // Pass resolvedDependencyPath if available, else fallback to original input | ||||
|   const dependencyPathForCache = resolvedDependencyPath ?? cacheDependencyPath; | ||||
|  | ||||
|   const cacheDistributor = getCacheDistributor( | ||||
|     cache, | ||||
|     pythonVersion, | ||||
|     cacheDependencyPath | ||||
|     dependencyPathForCache | ||||
|   ); | ||||
|   await cacheDistributor.restoreCache(); | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	