Compare commits
	
		
			2 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 6ca8e8598f | ||
|  | 8039c45ed9 | 
							
								
								
									
										53
									
								
								.github/workflows/test-pypy.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										53
									
								
								.github/workflows/test-pypy.yml
									
									
									
									
										vendored
									
									
								
							| @ -69,6 +69,59 @@ jobs: | ||||
|           ${EXECUTABLE} --version | ||||
|         shell: bash | ||||
| 
 | ||||
|   check-non-eol: | ||||
|     name: Check non-eol ${{ matrix.pypy }} on ${{ matrix.os }} | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       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 | ||||
|         pypy: ['pypy-2.7', 'pypy-3.10'] | ||||
| 
 | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v4 | ||||
| 
 | ||||
|       - name: setup-python ${{ matrix.pypy }} | ||||
|         id: setup-python | ||||
|         uses: ./ | ||||
|         with: | ||||
|           python-version: ${{ matrix.pypy }} | ||||
| 
 | ||||
|       - name: Check python-path | ||||
|         run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}' | ||||
|         shell: bash | ||||
| 
 | ||||
|       - name: PyPy and Python version | ||||
|         run: python --version | ||||
| 
 | ||||
|       - name: Run simple code | ||||
|         run: python -c 'import math; print(math.factorial(5))' | ||||
| 
 | ||||
|       - name: Assert PyPy is running | ||||
|         run: | | ||||
|           import platform | ||||
|           assert platform.python_implementation().lower() == "pypy" | ||||
|         shell: python | ||||
| 
 | ||||
|       - name: Assert expected binaries (or symlinks) are present | ||||
|         run: | | ||||
|           EXECUTABLE=${{ matrix.pypy }} | ||||
|           EXECUTABLE=${EXECUTABLE/pypy-/pypy}  # remove the first '-' in "pypy-X.Y" -> "pypyX.Y" to match executable name | ||||
|           EXECUTABLE=${EXECUTABLE%%-*}  # remove any -* suffixe | ||||
|           ${EXECUTABLE} --version | ||||
|         shell: bash | ||||
| 
 | ||||
|   setup-pypy-noenv: | ||||
|     name: Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (noenv) | ||||
|     runs-on: ${{ matrix.os }} | ||||
|  | ||||
							
								
								
									
										2832
									
								
								dist/cache-save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2832
									
								
								dist/cache-save/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										3573
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3573
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										9
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										9
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @ -25,7 +25,7 @@ | ||||
|         "@types/semver": "^7.5.8", | ||||
|         "@typescript-eslint/eslint-plugin": "^5.54.0", | ||||
|         "@typescript-eslint/parser": "^5.54.0", | ||||
|         "@vercel/ncc": "^0.38.0", | ||||
|         "@vercel/ncc": "^0.38.3", | ||||
|         "eslint": "^8.57.0", | ||||
|         "eslint-config-prettier": "^8.6.0", | ||||
|         "eslint-plugin-jest": "^27.9.0", | ||||
| @ -2011,10 +2011,11 @@ | ||||
|       "dev": true | ||||
|     }, | ||||
|     "node_modules/@vercel/ncc": { | ||||
|       "version": "0.38.1", | ||||
|       "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.1.tgz", | ||||
|       "integrity": "sha512-IBBb+iI2NLu4VQn3Vwldyi2QwaXt5+hTyh58ggAMoCGE6DJmPvwL3KPBWcJl1m9LYPChBLE980Jw+CS4Wokqxw==", | ||||
|       "version": "0.38.3", | ||||
|       "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.3.tgz", | ||||
|       "integrity": "sha512-rnK6hJBS6mwc+Bkab+PGPs9OiS0i/3kdTO+CkI8V0/VrW3vmz7O2Pxjw/owOlmo6PKEIxRSeZKv/kuL9itnpYA==", | ||||
|       "dev": true, | ||||
|       "license": "MIT", | ||||
|       "bin": { | ||||
|         "ncc": "dist/ncc/cli.js" | ||||
|       } | ||||
|  | ||||
| @ -41,7 +41,7 @@ | ||||
|     "@types/semver": "^7.5.8", | ||||
|     "@typescript-eslint/eslint-plugin": "^5.54.0", | ||||
|     "@typescript-eslint/parser": "^5.54.0", | ||||
|     "@vercel/ncc": "^0.38.0", | ||||
|     "@vercel/ncc": "^0.38.3", | ||||
|     "eslint": "^8.57.0", | ||||
|     "eslint-config-prettier": "^8.6.0", | ||||
|     "eslint-plugin-jest": "^27.9.0", | ||||
|  | ||||
| @ -8,6 +8,7 @@ import * as exec from '@actions/exec'; | ||||
| import fs from 'fs'; | ||||
| 
 | ||||
| import { | ||||
|   IS_LINUX, | ||||
|   IS_WINDOWS, | ||||
|   WINDOWS_PLATFORMS, | ||||
|   IPyPyManifestRelease, | ||||
| @ -246,7 +247,7 @@ export function pypyVersionToSemantic(versionSpec: string) { | ||||
| } | ||||
| 
 | ||||
| export function isArchPresentForWindows(item: any, architecture: string) { | ||||
|   architecture = replaceX32toX86(architecture); | ||||
|   architecture = pypyArchitecture(architecture); | ||||
|   return item.files.some( | ||||
|     (file: any) => | ||||
|       WINDOWS_PLATFORMS.includes(file.platform) && file.arch === architecture | ||||
| @ -258,13 +259,14 @@ export function isArchPresentForMacOrLinux( | ||||
|   architecture: string, | ||||
|   platform: string | ||||
| ) { | ||||
|   architecture = pypyArchitecture(architecture); | ||||
|   return item.files.some( | ||||
|     (file: any) => file.arch === architecture && file.platform === platform | ||||
|   ); | ||||
| } | ||||
| 
 | ||||
| export function findAssetForWindows(releases: any, architecture: string) { | ||||
|   architecture = replaceX32toX86(architecture); | ||||
|   architecture = pypyArchitecture(architecture); | ||||
|   return releases.files.find( | ||||
|     (item: any) => | ||||
|       WINDOWS_PLATFORMS.includes(item.platform) && item.arch === architecture | ||||
| @ -276,15 +278,18 @@ export function findAssetForMacOrLinux( | ||||
|   architecture: string, | ||||
|   platform: string | ||||
| ) { | ||||
|   architecture = pypyArchitecture(architecture); | ||||
|   return releases.files.find( | ||||
|     (item: any) => item.arch === architecture && item.platform === platform | ||||
|   ); | ||||
| } | ||||
| 
 | ||||
| function replaceX32toX86(architecture: string): string { | ||||
|   // convert x32 to x86 because os.arch() returns x32 for 32-bit systems but PyPy releases json has x86 arch value.
 | ||||
|   if (architecture === 'x32') { | ||||
| function pypyArchitecture(architecture: string): string { | ||||
|   if (IS_WINDOWS && architecture === 'x32') { | ||||
|     // convert x32 to x86 because os.arch() returns x32 for 32-bit systems but PyPy releases json has x86 arch value.
 | ||||
|     architecture = 'x86'; | ||||
|   } else if (IS_LINUX && architecture === 'arm64') { | ||||
|     architecture = 'aarch64'; | ||||
|   } | ||||
|   return architecture; | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user