mirror of
				https://gitea.com/actions/setup-python.git
				synced 2025-10-31 07:47:08 +00:00 
			
		
		
		
	Compare commits
	
		
			1 Commits
		
	
	
		
			v4.1.0
			...
			tiwarishub
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | e86dffea3d | 
							
								
								
									
										3
									
								
								.github/workflows/check-dist.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.github/workflows/check-dist.yml
									
									
									
									
										vendored
									
									
								
							| @@ -24,10 +24,9 @@ jobs: | |||||||
|       - uses: actions/checkout@v2 |       - uses: actions/checkout@v2 | ||||||
|  |  | ||||||
|       - name: Set Node.js 16.x |       - name: Set Node.js 16.x | ||||||
|         uses: actions/setup-node@v3 |         uses: actions/setup-node@v1 | ||||||
|         with: |         with: | ||||||
|           node-version: 16.x |           node-version: 16.x | ||||||
|           cache: npm |  | ||||||
|  |  | ||||||
|       - name: Install dependencies |       - name: Install dependencies | ||||||
|         run: npm ci |         run: npm ci | ||||||
|   | |||||||
							
								
								
									
										42
									
								
								.github/workflows/e2e-cache.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										42
									
								
								.github/workflows/e2e-cache.yml
									
									
									
									
										vendored
									
									
								
							| @@ -23,7 +23,7 @@ jobs: | |||||||
|         os: [ubuntu-latest, windows-latest, macos-latest] |         os: [ubuntu-latest, windows-latest, macos-latest] | ||||||
|         python-version: ['3.9', 'pypy-3.7-v7.x'] |         python-version: ['3.9', 'pypy-3.7-v7.x'] | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v3 |       - uses: actions/checkout@v2 | ||||||
|       - name: Setup Python |       - name: Setup Python | ||||||
|         uses: ./ |         uses: ./ | ||||||
|         with: |         with: | ||||||
| @@ -39,26 +39,18 @@ jobs: | |||||||
|       fail-fast: false |       fail-fast: false | ||||||
|       matrix: |       matrix: | ||||||
|         os: [ubuntu-latest, windows-latest, macos-latest] |         os: [ubuntu-latest, windows-latest, macos-latest] | ||||||
|         python-version: ['3.9', 'pypy-3.9-v7.x'] |         python-version: ['3.9', 'pypy-3.7-v7.x'] | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v3 |       - uses: actions/checkout@v2 | ||||||
|       - name: Setup Python |       - name: Setup Python | ||||||
|         uses: ./ |         uses: ./ | ||||||
|         with: |         with: | ||||||
|           python-version: ${{ matrix.python-version }} |           python-version: ${{ matrix.python-version }} | ||||||
|           cache: 'pipenv' |           cache: 'pipenv' | ||||||
|       - name: Install pipenv |       - name: Install pipenv | ||||||
|         run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python |         run: pipx install pipenv | ||||||
|       - name: Install dependencies |       - name: Install dependencies | ||||||
|         shell: pwsh |         run: pipenv install numpy | ||||||
|         run: | |  | ||||||
|           mv ./__tests__/data/Pipfile.lock . |  | ||||||
|           mv ./__tests__/data/Pipfile . |  | ||||||
|           if ("${{ matrix.python-version }}" -Match "pypy") { |  | ||||||
|             pipenv install --keep-outdated --python pypy |  | ||||||
|           } else { |  | ||||||
|             pipenv install --keep-outdated --python ${{ matrix.python-version }} |  | ||||||
|           } |  | ||||||
|  |  | ||||||
|   python-poetry-dependencies-caching: |   python-poetry-dependencies-caching: | ||||||
|     name: Test poetry (Python ${{ matrix.python-version}}, ${{ matrix.os }}) |     name: Test poetry (Python ${{ matrix.python-version}}, ${{ matrix.os }}) | ||||||
| @@ -67,9 +59,9 @@ jobs: | |||||||
|       fail-fast: false |       fail-fast: false | ||||||
|       matrix: |       matrix: | ||||||
|         os: [ubuntu-latest, windows-latest, macos-latest] |         os: [ubuntu-latest, windows-latest, macos-latest] | ||||||
|         python-version: ['3.9', 'pypy-3.8'] |         python-version: ['3.9', 'pypy-3.7-v7.x'] | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v3 |       - uses: actions/checkout@v2 | ||||||
|       - name: Install poetry |       - name: Install poetry | ||||||
|         run: pipx install poetry |         run: pipx install poetry | ||||||
|       - name: Setup Python |       - name: Setup Python | ||||||
| @@ -91,7 +83,7 @@ jobs: | |||||||
|         os: [ubuntu-latest, windows-latest, macos-latest] |         os: [ubuntu-latest, windows-latest, macos-latest] | ||||||
|         python-version: ['3.9', 'pypy-3.7-v7.x'] |         python-version: ['3.9', 'pypy-3.7-v7.x'] | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v3 |       - uses: actions/checkout@v2 | ||||||
|       - name: Setup Python |       - name: Setup Python | ||||||
|         uses: ./ |         uses: ./ | ||||||
|         with: |         with: | ||||||
| @@ -108,24 +100,16 @@ jobs: | |||||||
|       fail-fast: false |       fail-fast: false | ||||||
|       matrix: |       matrix: | ||||||
|         os: [ubuntu-latest, windows-latest, macos-latest] |         os: [ubuntu-latest, windows-latest, macos-latest] | ||||||
|         python-version: ['3.9', 'pypy-3.9-v7.x'] |         python-version: ['3.9', 'pypy-3.7-v7.x'] | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v3 |       - uses: actions/checkout@v2 | ||||||
|       - name: Setup Python |       - name: Setup Python | ||||||
|         uses: ./ |         uses: ./ | ||||||
|         with: |         with: | ||||||
|           python-version: ${{ matrix.python-version }} |           python-version: ${{ matrix.python-version }} | ||||||
|           cache: 'pipenv' |           cache: 'pipenv' | ||||||
|           cache-dependency-path: '**/pipenv-requirements.txt' |           cache-dependency-path: '**/requirements-linux.txt' | ||||||
|       - name: Install pipenv |       - name: Install pipenv | ||||||
|         run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python |         run: pipx install pipenv | ||||||
|       - name: Install dependencies |       - name: Install dependencies | ||||||
|         shell: pwsh |         run: pipenv install numpy | ||||||
|         run: | |  | ||||||
|           mv ./__tests__/data/Pipfile.lock . |  | ||||||
|           mv ./__tests__/data/Pipfile . |  | ||||||
|           if ("${{ matrix.python-version }}" -Match "pypy") { |  | ||||||
|             pipenv install --keep-outdated --python pypy |  | ||||||
|           } else { |  | ||||||
|             pipenv install --keep-outdated --python ${{ matrix.python-version }} |  | ||||||
|           } |  | ||||||
							
								
								
									
										3
									
								
								.github/workflows/licensed.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.github/workflows/licensed.yml
									
									
									
									
										vendored
									
									
								
							| @@ -15,10 +15,9 @@ jobs: | |||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v2 |       - uses: actions/checkout@v2 | ||||||
|       - name: Set Node.js 16.x |       - name: Set Node.js 16.x | ||||||
|         uses: actions/setup-node@v3 |         uses: actions/setup-node@v2 | ||||||
|         with: |         with: | ||||||
|           node-version: 16.x |           node-version: 16.x | ||||||
|           cache: npm |  | ||||||
|       - run: npm ci |       - run: npm ci | ||||||
|       - name: Install licensed |       - name: Install licensed | ||||||
|         run: | |         run: | | ||||||
|   | |||||||
							
								
								
									
										47
									
								
								.github/workflows/test-pypy.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										47
									
								
								.github/workflows/test-pypy.yml
									
									
									
									
										vendored
									
									
								
							| @@ -22,7 +22,6 @@ jobs: | |||||||
|         pypy: |         pypy: | ||||||
|         - 'pypy-2.7' |         - 'pypy-2.7' | ||||||
|         - 'pypy-3.7' |         - 'pypy-3.7' | ||||||
|         - 'pypy3.9' |  | ||||||
|         - 'pypy-2.7-v7.3.4' |         - 'pypy-2.7-v7.3.4' | ||||||
|         - 'pypy-3.7-v7.3.5' |         - 'pypy-3.7-v7.3.5' | ||||||
|         - 'pypy-3.7-v7.3.4' |         - 'pypy-3.7-v7.3.4' | ||||||
| @@ -30,64 +29,18 @@ jobs: | |||||||
|         - 'pypy-3.7-v7.x' |         - 'pypy-3.7-v7.x' | ||||||
|         - 'pypy-2.7-v7.3.4rc1' |         - 'pypy-2.7-v7.3.4rc1' | ||||||
|         - 'pypy-3.7-nightly' |         - 'pypy-3.7-nightly' | ||||||
|         - 'pypy3.8-v7.3.7' |  | ||||||
|  |  | ||||||
|     steps: |     steps: | ||||||
|       - name: Checkout |       - name: Checkout | ||||||
|         uses: actions/checkout@v2 |         uses: actions/checkout@v2 | ||||||
|    |    | ||||||
|       - name: setup-python ${{ matrix.pypy }} |       - name: setup-python ${{ matrix.pypy }} | ||||||
|         id: setup-python |  | ||||||
|         uses: ./ |         uses: ./ | ||||||
|         with: |         with: | ||||||
|           python-version: ${{ matrix.pypy }} |           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 |       - name: PyPy and Python version | ||||||
|         run: python --version |         run: python --version | ||||||
|    |    | ||||||
|       - name: Run simple code |       - name: Run simple code | ||||||
|         run: python -c 'import math; print(math.factorial(5))' |         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 }} |  | ||||||
|     strategy: |  | ||||||
|       fail-fast: false |  | ||||||
|       matrix: |  | ||||||
|         os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-latest] |  | ||||||
|         pypy: ['pypy2.7', 'pypy3.7', 'pypy3.8', 'pypy3.9-nightly'] |  | ||||||
|  |  | ||||||
|     steps: |  | ||||||
|       - name: Checkout |  | ||||||
|         uses: actions/checkout@v3 |  | ||||||
|  |  | ||||||
|       - name: setup-python ${{ matrix.pypy }} |  | ||||||
|         id: setup-python |  | ||||||
|         uses: ./ |  | ||||||
|         with: |  | ||||||
|           python-version: ${{ matrix.pypy }} |  | ||||||
|           update-environment: false |  | ||||||
|  |  | ||||||
|       - name: PyPy and Python version |  | ||||||
|         run: ${{ steps.setup-python.outputs.python-path }} --version |  | ||||||
|  |  | ||||||
|       - name: Run simple code |  | ||||||
|         run: ${{ steps.setup-python.outputs.python-path }} -c 'import math; print(math.factorial(5))' |  | ||||||
|   | |||||||
							
								
								
									
										125
									
								
								.github/workflows/test-python.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										125
									
								
								.github/workflows/test-python.yml
									
									
									
									
										vendored
									
									
								
							| @@ -10,9 +10,28 @@ on: | |||||||
|       - '**.md' |       - '**.md' | ||||||
|   schedule: |   schedule: | ||||||
|     - cron: 30 3 * * * |     - cron: 30 3 * * * | ||||||
|   workflow_dispatch: |  | ||||||
|  |  | ||||||
| jobs: | jobs: | ||||||
|  |   default-version: | ||||||
|  |     name: Setup default version | ||||||
|  |     runs-on: ${{ matrix.os }} | ||||||
|  |     strategy: | ||||||
|  |       fail-fast: false | ||||||
|  |       matrix: | ||||||
|  |         os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04] | ||||||
|  |     steps: | ||||||
|  |     - name: Checkout | ||||||
|  |       uses: actions/checkout@v2 | ||||||
|  |  | ||||||
|  |     - name: setup default python  | ||||||
|  |       uses: ./ | ||||||
|  |  | ||||||
|  |     - name: Validate version | ||||||
|  |       run: python --version | ||||||
|  |  | ||||||
|  |     - name: Run simple python code | ||||||
|  |       run: python -c 'import math; print(math.factorial(5))' | ||||||
|  |  | ||||||
|   setup-versions-from-manifest: |   setup-versions-from-manifest: | ||||||
|     name: Setup ${{ matrix.python }} ${{ matrix.os }} |     name: Setup ${{ matrix.python }} ${{ matrix.os }} | ||||||
|     runs-on: ${{ matrix.os }} |     runs-on: ${{ matrix.os }} | ||||||
| @@ -23,56 +42,13 @@ jobs: | |||||||
|         python: [3.5.4, 3.6.7, 3.7.5, 3.8.1] |         python: [3.5.4, 3.6.7, 3.7.5, 3.8.1] | ||||||
|     steps: |     steps: | ||||||
|     - name: Checkout |     - name: Checkout | ||||||
|       uses: actions/checkout@v3 |       uses: actions/checkout@v2 | ||||||
|  |  | ||||||
|     - name: setup-python ${{ matrix.python }} |     - name: setup-python ${{ matrix.python }} | ||||||
|       id: setup-python |  | ||||||
|       uses: ./ |       uses: ./ | ||||||
|       with: |       with: | ||||||
|         python-version: ${{ matrix.python }} |         python-version: ${{ matrix.python }} | ||||||
|  |  | ||||||
|     - name: Check python-path |  | ||||||
|       run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}' |  | ||||||
|       shell: bash |  | ||||||
|  |  | ||||||
|     - name: Validate version |  | ||||||
|       run: | |  | ||||||
|         $pythonVersion = (python --version) |  | ||||||
|         if ("Python ${{ matrix.python }}" -ne "$pythonVersion"){ |  | ||||||
|           Write-Host "The current version is $pythonVersion; expected version is ${{ matrix.python }}" |  | ||||||
|           exit 1 |  | ||||||
|         } |  | ||||||
|         $pythonVersion |  | ||||||
|       shell: pwsh |  | ||||||
|  |  | ||||||
|     - name: Run simple code |  | ||||||
|       run: python -c 'import math; print(math.factorial(5))' |  | ||||||
|  |  | ||||||
|   setup-versions-from-file: |  | ||||||
|     name: Setup ${{ matrix.python }} ${{ matrix.os }} version file |  | ||||||
|     runs-on: ${{ matrix.os }} |  | ||||||
|     strategy: |  | ||||||
|       fail-fast: false |  | ||||||
|       matrix: |  | ||||||
|         os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04] |  | ||||||
|         python: [3.5.4, 3.6.7, 3.7.5, 3.8.1] |  | ||||||
|     steps: |  | ||||||
|     - name: Checkout |  | ||||||
|       uses: actions/checkout@v3 |  | ||||||
|  |  | ||||||
|     - name: build-version-file ${{ matrix.python }} |  | ||||||
|       run: echo ${{ matrix.python }} > .python-version |  | ||||||
|  |  | ||||||
|     - name: setup-python ${{ matrix.python }} |  | ||||||
|       id: setup-python |  | ||||||
|       uses: ./ |  | ||||||
|       with: |  | ||||||
|         python-version-file: '.python-version' |  | ||||||
|  |  | ||||||
|     - name: Check python-path |  | ||||||
|       run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}' |  | ||||||
|       shell: bash |  | ||||||
|  |  | ||||||
|     - name: Validate version |     - name: Validate version | ||||||
|       run: | |       run: | | ||||||
|         $pythonVersion = (python --version) |         $pythonVersion = (python --version) | ||||||
| @@ -95,18 +71,13 @@ jobs: | |||||||
|         os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04] |         os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04] | ||||||
|     steps: |     steps: | ||||||
|     - name: Checkout |     - name: Checkout | ||||||
|       uses: actions/checkout@v3 |       uses: actions/checkout@v2 | ||||||
|  |  | ||||||
|     - name: setup-python 3.9.0-beta.4 |     - name: setup-python 3.9.0-beta.4 | ||||||
|       id: setup-python |  | ||||||
|       uses: ./ |       uses: ./ | ||||||
|       with: |       with: | ||||||
|         python-version: '3.9.0-beta.4' |         python-version: '3.9.0-beta.4' | ||||||
|  |  | ||||||
|     - name: Check python-path |  | ||||||
|       run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}' |  | ||||||
|       shell: bash |  | ||||||
|  |  | ||||||
|     - name: Validate version |     - name: Validate version | ||||||
|       run: | |       run: | | ||||||
|         $pythonVersion = (python --version) |         $pythonVersion = (python --version) | ||||||
| @@ -120,55 +91,3 @@ jobs: | |||||||
|     - name: Run simple code |     - name: Run simple code | ||||||
|       run: python -c 'import math; print(math.factorial(5))' |       run: python -c 'import math; print(math.factorial(5))' | ||||||
|  |  | ||||||
|   setup-dev-version: |  | ||||||
|     name: Setup 3.9-dev ${{ matrix.os }} |  | ||||||
|     runs-on: ${{ matrix.os }} |  | ||||||
|     strategy: |  | ||||||
|       fail-fast: false |  | ||||||
|       matrix: |  | ||||||
|         os: [macos-latest, windows-latest, ubuntu-latest] |  | ||||||
|     steps: |  | ||||||
|     - name: Checkout |  | ||||||
|       uses: actions/checkout@v3 |  | ||||||
|  |  | ||||||
|     - name: setup-python 3.9-dev |  | ||||||
|       id: setup-python |  | ||||||
|       uses: ./ |  | ||||||
|       with: |  | ||||||
|         python-version: '3.9-dev' |  | ||||||
|  |  | ||||||
|     - name: Check python-path |  | ||||||
|       run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}' |  | ||||||
|       shell: bash |  | ||||||
|  |  | ||||||
|     - name: Validate version |  | ||||||
|       run: ${{ startsWith(steps.setup-python.outputs.python-version, '3.9.') }} |  | ||||||
|       shell: bash |  | ||||||
|  |  | ||||||
|     - name: Run simple code |  | ||||||
|       run: python -c 'import math; print(math.factorial(5))' |  | ||||||
|  |  | ||||||
|   setup-versions-noenv: |  | ||||||
|     name: Setup ${{ matrix.python }} ${{ matrix.os }} (noenv) |  | ||||||
|     runs-on: ${{ matrix.os }} |  | ||||||
|     strategy: |  | ||||||
|       fail-fast: false |  | ||||||
|       matrix: |  | ||||||
|         os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04] |  | ||||||
|         python: ["3.7", "3.8", "3.9", "3.10"] |  | ||||||
|     steps: |  | ||||||
|     - name: Checkout |  | ||||||
|       uses: actions/checkout@v3 |  | ||||||
|  |  | ||||||
|     - name: setup-python ${{ matrix.python }} |  | ||||||
|       id: setup-python |  | ||||||
|       uses: ./ |  | ||||||
|       with: |  | ||||||
|         python-version: ${{ matrix.python }} |  | ||||||
|         update-environment: false |  | ||||||
|  |  | ||||||
|     - name: Python version |  | ||||||
|       run: ${{ steps.setup-python.outputs.python-path }} --version |  | ||||||
|  |  | ||||||
|     - name: Run simple code |  | ||||||
|       run: ${{ steps.setup-python.outputs.python-path }} -c 'import math; print(math.factorial(5))' |  | ||||||
|   | |||||||
							
								
								
									
										13
									
								
								.github/workflows/workflow.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										13
									
								
								.github/workflows/workflow.yml
									
									
									
									
										vendored
									
									
								
							| @@ -20,10 +20,9 @@ jobs: | |||||||
|       uses: actions/checkout@v2 |       uses: actions/checkout@v2 | ||||||
|  |  | ||||||
|     - name: Set Node.js 16.x |     - name: Set Node.js 16.x | ||||||
|       uses: actions/setup-node@v3 |       uses: actions/setup-node@v1 | ||||||
|       with: |       with: | ||||||
|         node-version: 16.x |         node-version: 16.x | ||||||
|         cache: npm |  | ||||||
|  |  | ||||||
|     - name: npm ci |     - name: npm ci | ||||||
|       run: npm ci |       run: npm ci | ||||||
| @@ -89,13 +88,3 @@ jobs: | |||||||
|         python-version: 3.8.1 |         python-version: 3.8.1 | ||||||
|     - name: Verify 3.8.1 |     - name: Verify 3.8.1 | ||||||
|       run: python __tests__/verify-python.py 3.8.1 |       run: python __tests__/verify-python.py 3.8.1 | ||||||
|  |  | ||||||
|     - name: Run with setup-python 3.10 |  | ||||||
|       id: cp310 |  | ||||||
|       uses: ./ |  | ||||||
|       with: |  | ||||||
|         python-version: "3.10" |  | ||||||
|     - name: Verify 3.10 |  | ||||||
|       run: python __tests__/verify-python.py 3.10 |  | ||||||
|     - name: Run python-path sample 3.10 |  | ||||||
|       run: pipx run --python '${{ steps.cp310.outputs.python-path }}' nox --version |  | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								.licenses/npm/@actions/cache.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.licenses/npm/@actions/cache.dep.yml
									
									
									
										generated
									
									
									
								
							| @@ -1,6 +1,6 @@ | |||||||
| --- | --- | ||||||
| name: "@actions/cache" | name: "@actions/cache" | ||||||
| version: 3.0.0 | version: 2.0.0 | ||||||
| type: npm | type: npm | ||||||
| summary: Actions cache lib | summary: Actions cache lib | ||||||
| homepage: https://github.com/actions/toolkit/tree/main/packages/cache | homepage: https://github.com/actions/toolkit/tree/main/packages/cache | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								.licenses/npm/@actions/core.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.licenses/npm/@actions/core.dep.yml
									
									
									
										generated
									
									
									
								
							| @@ -1,6 +1,6 @@ | |||||||
| --- | --- | ||||||
| name: "@actions/core" | name: "@actions/core" | ||||||
| version: 1.7.0 | version: 1.2.6 | ||||||
| type: npm | type: npm | ||||||
| summary: Actions core lib | summary: Actions core lib | ||||||
| homepage: https://github.com/actions/toolkit/tree/main/packages/core | homepage: https://github.com/actions/toolkit/tree/main/packages/core | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| --- | --- | ||||||
| name: "@actions/http-client" | name: "@actions/http-client" | ||||||
| version: 2.0.1 | version: 1.0.8 | ||||||
| type: npm | type: npm | ||||||
| summary: Actions Http Client | summary: Actions Http Client | ||||||
| homepage: https://github.com/actions/http-client#readme | homepage: https://github.com/actions/http-client#readme | ||||||
							
								
								
									
										32
									
								
								.licenses/npm/@actions/http-client.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										32
									
								
								.licenses/npm/@actions/http-client.dep.yml
									
									
									
										generated
									
									
									
								
							| @@ -1,32 +0,0 @@ | |||||||
| --- |  | ||||||
| name: "@actions/http-client" |  | ||||||
| version: 1.0.11 |  | ||||||
| type: npm |  | ||||||
| summary: Actions Http Client |  | ||||||
| homepage: https://github.com/actions/http-client#readme |  | ||||||
| license: mit |  | ||||||
| licenses: |  | ||||||
| - sources: LICENSE |  | ||||||
|   text: | |  | ||||||
|     Actions Http Client for Node.js |  | ||||||
| 
 |  | ||||||
|     Copyright (c) GitHub, Inc. |  | ||||||
| 
 |  | ||||||
|     All rights reserved. |  | ||||||
| 
 |  | ||||||
|     MIT License |  | ||||||
| 
 |  | ||||||
|     Permission is hereby granted, free of charge, to any person obtaining a copy of this software and |  | ||||||
|     associated documentation files (the "Software"), to deal in the Software without restriction, |  | ||||||
|     including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |  | ||||||
|     and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, |  | ||||||
|     subject to the following conditions: |  | ||||||
| 
 |  | ||||||
|     The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |  | ||||||
| 
 |  | ||||||
|     THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT |  | ||||||
|     LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN |  | ||||||
|     NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |  | ||||||
|     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |  | ||||||
|     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |  | ||||||
| notices: [] |  | ||||||
| @@ -1,76 +0,0 @@ | |||||||
| # Contributor Covenant Code of Conduct |  | ||||||
|  |  | ||||||
| ## Our Pledge |  | ||||||
|  |  | ||||||
| In the interest of fostering an open and welcoming environment, we as |  | ||||||
| contributors and maintainers pledge to make participation in our project and |  | ||||||
| our community a harassment-free experience for everyone, regardless of age, body |  | ||||||
| size, disability, ethnicity, sex characteristics, gender identity and expression, |  | ||||||
| level of experience, education, socio-economic status, nationality, personal |  | ||||||
| appearance, race, religion, or sexual identity and orientation. |  | ||||||
|  |  | ||||||
| ## Our Standards |  | ||||||
|  |  | ||||||
| Examples of behavior that contributes to creating a positive environment |  | ||||||
| include: |  | ||||||
|  |  | ||||||
| * Using welcoming and inclusive language |  | ||||||
| * Being respectful of differing viewpoints and experiences |  | ||||||
| * Gracefully accepting constructive criticism |  | ||||||
| * Focusing on what is best for the community |  | ||||||
| * Showing empathy towards other community members |  | ||||||
|  |  | ||||||
| Examples of unacceptable behavior by participants include: |  | ||||||
|  |  | ||||||
| * The use of sexualized language or imagery and unwelcome sexual attention or |  | ||||||
|   advances |  | ||||||
| * Trolling, insulting/derogatory comments, and personal or political attacks |  | ||||||
| * Public or private harassment |  | ||||||
| * Publishing others' private information, such as a physical or electronic |  | ||||||
|   address, without explicit permission |  | ||||||
| * Other conduct which could reasonably be considered inappropriate in a |  | ||||||
|   professional setting |  | ||||||
|  |  | ||||||
| ## Our Responsibilities |  | ||||||
|  |  | ||||||
| Project maintainers are responsible for clarifying the standards of acceptable |  | ||||||
| behavior and are expected to take appropriate and fair corrective action in |  | ||||||
| response to any instances of unacceptable behavior. |  | ||||||
|  |  | ||||||
| Project maintainers have the right and responsibility to remove, edit, or |  | ||||||
| reject comments, commits, code, wiki edits, issues, and other contributions |  | ||||||
| that are not aligned to this Code of Conduct, or to ban temporarily or |  | ||||||
| permanently any contributor for other behaviors that they deem inappropriate, |  | ||||||
| threatening, offensive, or harmful. |  | ||||||
|  |  | ||||||
| ## Scope |  | ||||||
|  |  | ||||||
| This Code of Conduct applies within all project spaces, and it also applies when |  | ||||||
| an individual is representing the project or its community in public spaces. |  | ||||||
| Examples of representing a project or community include using an official |  | ||||||
| project e-mail address, posting via an official social media account, or acting |  | ||||||
| as an appointed representative at an online or offline event. Representation of |  | ||||||
| a project may be further defined and clarified by project maintainers. |  | ||||||
|  |  | ||||||
| ## Enforcement |  | ||||||
|  |  | ||||||
| Instances of abusive, harassing, or otherwise unacceptable behavior may be |  | ||||||
| reported by contacting the project team at opensource+actions/setup-python@github.com. All |  | ||||||
| complaints will be reviewed and investigated and will result in a response that |  | ||||||
| is deemed necessary and appropriate to the circumstances. The project team is |  | ||||||
| obligated to maintain confidentiality with regard to the reporter of an incident. |  | ||||||
| Further details of specific enforcement policies may be posted separately. |  | ||||||
|  |  | ||||||
| Project maintainers who do not follow or enforce the Code of Conduct in good |  | ||||||
| faith may face temporary or permanent repercussions as determined by other |  | ||||||
| members of the project's leadership. |  | ||||||
|  |  | ||||||
| ## Attribution |  | ||||||
|  |  | ||||||
| This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, |  | ||||||
| available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html |  | ||||||
|  |  | ||||||
| [homepage]: https://www.contributor-covenant.org |  | ||||||
|  |  | ||||||
| For answers to common questions about this code of conduct, see |  | ||||||
| https://www.contributor-covenant.org/faq |  | ||||||
							
								
								
									
										157
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										157
									
								
								README.md
									
									
									
									
									
								
							| @@ -1,4 +1,4 @@ | |||||||
| # setup-python V4 | # setup-python V3 | ||||||
|  |  | ||||||
| <p align="left"> | <p align="left"> | ||||||
|   <a href="https://github.com/actions/setup-python"><img alt="GitHub Actions status" src="https://github.com/actions/setup-python/workflows/Main%20workflow/badge.svg"></a> |   <a href="https://github.com/actions/setup-python"><img alt="GitHub Actions status" src="https://github.com/actions/setup-python/workflows/Main%20workflow/badge.svg"></a> | ||||||
| @@ -20,7 +20,6 @@ This action sets up a Python environment for use in actions by: | |||||||
| - Support for pre-release versions of Python. | - Support for pre-release versions of Python. | ||||||
| - Support for installing any version of PyPy on-flight | - Support for installing any version of PyPy on-flight | ||||||
| - Support for built-in caching of pip, pipenv and poetry dependencies | - Support for built-in caching of pip, pipenv and poetry dependencies | ||||||
| - Support for `.python-version` file |  | ||||||
|  |  | ||||||
| # Usage | # Usage | ||||||
|  |  | ||||||
| @@ -30,23 +29,13 @@ Basic: | |||||||
| ```yaml | ```yaml | ||||||
| steps: | steps: | ||||||
| - uses: actions/checkout@v3 | - uses: actions/checkout@v3 | ||||||
| - uses: actions/setup-python@v4 | - uses: actions/setup-python@v3 | ||||||
|   with: |   with: | ||||||
|     python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax |     python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax | ||||||
|     architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified |     architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified | ||||||
| - run: python my_script.py | - run: python my_script.py | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| Read Python version from file: |  | ||||||
| ```yaml |  | ||||||
| steps: |  | ||||||
| - uses: actions/checkout@v3 |  | ||||||
| - uses: actions/setup-python@v4 |  | ||||||
|   with: |  | ||||||
|     python-version-file: '.python-version' # Read python version from a file |  | ||||||
| - run: python my_script.py |  | ||||||
| ``` |  | ||||||
|  |  | ||||||
| Matrix Testing: | Matrix Testing: | ||||||
| ```yaml | ```yaml | ||||||
| jobs: | jobs: | ||||||
| @@ -54,12 +43,12 @@ jobs: | |||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|     strategy: |     strategy: | ||||||
|       matrix: |       matrix: | ||||||
|         python-version: [ '2.x', '3.x', 'pypy2.7', 'pypy3.7', 'pypy3.8' ] |         python-version: [ '2.x', '3.x', 'pypy-2.7', 'pypy-3.7', 'pypy-3.8' ] | ||||||
|     name: Python ${{ matrix.python-version }} sample |     name: Python ${{ matrix.python-version }} sample | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v3 |       - uses: actions/checkout@v3 | ||||||
|       - name: Set up Python |       - name: Set up Python | ||||||
|         uses: actions/setup-python@v4 |         uses: actions/setup-python@v3 | ||||||
|         with: |         with: | ||||||
|           python-version: ${{ matrix.python-version }} |           python-version: ${{ matrix.python-version }} | ||||||
|           architecture: x64 |           architecture: x64 | ||||||
| @@ -74,7 +63,7 @@ jobs: | |||||||
|     strategy: |     strategy: | ||||||
|       matrix: |       matrix: | ||||||
|         os: [ubuntu-latest, macos-latest, windows-latest] |         os: [ubuntu-latest, macos-latest, windows-latest] | ||||||
|         python-version: ['2.7', '3.7', '3.8', '3.9', '3.10', 'pypy2.7', 'pypy3.8'] |         python-version: ['2.7', '3.7', '3.8', '3.9', '3.10', 'pypy-2.7', 'pypy-3.8'] | ||||||
|         exclude: |         exclude: | ||||||
|           - os: macos-latest |           - os: macos-latest | ||||||
|             python-version: '3.8' |             python-version: '3.8' | ||||||
| @@ -83,7 +72,7 @@ jobs: | |||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v3 |       - uses: actions/checkout@v3 | ||||||
|       - name: Set up Python |       - name: Set up Python | ||||||
|         uses: actions/setup-python@v4 |         uses: actions/setup-python@v3 | ||||||
|         with: |         with: | ||||||
|           python-version: ${{ matrix.python-version }} |           python-version: ${{ matrix.python-version }} | ||||||
|       - name: Display Python version |       - name: Display Python version | ||||||
| @@ -101,7 +90,7 @@ jobs: | |||||||
|         python-version: ['3.7.4', '3.8', '3.9', '3.10'] |         python-version: ['3.7.4', '3.8', '3.9', '3.10'] | ||||||
|     steps: |     steps: | ||||||
|     - uses: actions/checkout@v3 |     - uses: actions/checkout@v3 | ||||||
|     - uses: actions/setup-python@v4 |     - uses: actions/setup-python@v3 | ||||||
|       with: |       with: | ||||||
|         python-version: ${{ matrix.python-version }} |         python-version: ${{ matrix.python-version }} | ||||||
|     - run: python my_script.py |     - run: python my_script.py | ||||||
| @@ -111,7 +100,7 @@ Download and set up an accurate pre-release version of Python: | |||||||
| ```yaml | ```yaml | ||||||
| steps: | steps: | ||||||
| - uses: actions/checkout@v3 | - uses: actions/checkout@v3 | ||||||
| - uses: actions/setup-python@v4 | - uses: actions/setup-python@v3 | ||||||
|   with: |   with: | ||||||
|     python-version: '3.11.0-alpha.1' |     python-version: '3.11.0-alpha.1' | ||||||
| - run: python my_script.py | - run: python my_script.py | ||||||
| @@ -121,32 +110,12 @@ Download and set up the latest available version of Python (includes both pre-re | |||||||
| ```yaml | ```yaml | ||||||
| steps: | steps: | ||||||
| - uses: actions/checkout@v3 | - uses: actions/checkout@v3 | ||||||
| - uses: actions/setup-python@v4 | - uses: actions/setup-python@v3 | ||||||
|   with: |   with: | ||||||
|     python-version: '3.11.0-alpha - 3.11.0' # SemVer's version range syntax |     python-version: '3.11.0-alpha - 3.11.0' # SemVer's version range syntax | ||||||
| - run: python my_script.py | - run: python my_script.py | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| Download and set up the latest patch version of Python (for specified major & minor versions): |  | ||||||
| ```yaml |  | ||||||
| steps: |  | ||||||
| - uses: actions/checkout@v3 |  | ||||||
| - uses: actions/setup-python@v4 |  | ||||||
|   with: |  | ||||||
|     python-version: '3.11-dev' |  | ||||||
| - run: python my_script.py |  | ||||||
| ``` |  | ||||||
|  |  | ||||||
| Download and set up the latest stable version of Python (for specified major version): |  | ||||||
| ```yaml |  | ||||||
| steps: |  | ||||||
| - uses: actions/checkout@v3 |  | ||||||
| - uses: actions/setup-python@v4 |  | ||||||
|   with: |  | ||||||
|     python-version: '3.x' |  | ||||||
| - run: python my_script.py |  | ||||||
| ``` |  | ||||||
|  |  | ||||||
| Download and set up PyPy: | Download and set up PyPy: | ||||||
|  |  | ||||||
| ```yaml | ```yaml | ||||||
| @@ -156,34 +125,18 @@ jobs: | |||||||
|     strategy: |     strategy: | ||||||
|       matrix: |       matrix: | ||||||
|         python-version: |         python-version: | ||||||
|         - 'pypy3.7' # the latest available version of PyPy that supports Python 3.7 |         - 'pypy-3.7' # the latest available version of PyPy that supports Python 3.7 | ||||||
|         - 'pypy3.7-v7.3.3' # Python 3.7 and PyPy 7.3.3 |         - 'pypy-3.7-v7.3.3' # Python 3.7 and PyPy 7.3.3 | ||||||
|         - 'pypy3.8' # the latest available version of PyPy that supports Python 3.8 |         - 'pypy-3.8' # the latest available version of PyPy that supports Python 3.8 | ||||||
|     steps: |     steps: | ||||||
|     - uses: actions/checkout@v3 |     - uses: actions/checkout@v3 | ||||||
|     - uses: actions/setup-python@v4 |     - uses: actions/setup-python@v3 | ||||||
|       with: |       with: | ||||||
|         python-version: ${{ matrix.python-version }} |         python-version: ${{ matrix.python-version }} | ||||||
|     - run: python my_script.py |     - run: python my_script.py | ||||||
| ``` | ``` | ||||||
| More details on PyPy syntax and examples of using preview / nightly versions of PyPy can be found in the [Available versions of PyPy](#available-versions-of-pypy) section. | More details on PyPy syntax and examples of using preview / nightly versions of PyPy can be found in the [Available versions of PyPy](#available-versions-of-pypy) section. | ||||||
|  |  | ||||||
| An output is available with the absolute path of the python interpreter executable if you need it: |  | ||||||
| ```yaml |  | ||||||
| jobs: |  | ||||||
|   build: |  | ||||||
|     runs-on: ubuntu-latest |  | ||||||
|     steps: |  | ||||||
|     - uses: actions/checkout@v3 |  | ||||||
|     - uses: actions/setup-python@v4 |  | ||||||
|       id: cp310 |  | ||||||
|       with: |  | ||||||
|         python-version: "3.10" |  | ||||||
|     - run: pipx run --python '${{ steps.cp310.outputs.python-path }}' nox --version |  | ||||||
| ``` |  | ||||||
|  |  | ||||||
| >The environment variable `pythonLocation` also becomes available after Python or PyPy installation. It contains the absolute path to the folder where the desired version of Python or PyPy is installed. |  | ||||||
|  |  | ||||||
| # Getting started with Python + Actions | # Getting started with Python + Actions | ||||||
|  |  | ||||||
| Check out our detailed guide on using [Python with GitHub Actions](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-python-with-github-actions). | Check out our detailed guide on using [Python with GitHub Actions](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-python-with-github-actions). | ||||||
| @@ -197,13 +150,10 @@ Check out our detailed guide on using [Python with GitHub Actions](https://help. | |||||||
|     - For every minor version of Python, expect only the latest patch to be preinstalled. |     - For every minor version of Python, expect only the latest patch to be preinstalled. | ||||||
|     - 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 `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. |     - 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. | ||||||
|     - Use `-dev` instead of a patch number (e.g., `3.11-dev`) to install the latest patch version release for a given minor version, *alpha and beta releases included*. |  | ||||||
| - Downloadable Python versions from GitHub Releases ([actions/python-versions](https://github.com/actions/python-versions/releases)). | - 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/main/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 |     - If there is a specific version of Python that is not available, you can open an issue here | ||||||
|  |  | ||||||
| **Note:** Python versions used in this action are generated in the [python-versions](https://github.com/actions/python-versions) repository. For macOS and Ubuntu images python versions are built from the source code. For Windows the python-versions repository uses installation executable. For more information please refer to the [python-versions](https://github.com/actions/python-versions) repository. |  | ||||||
|  |  | ||||||
|  # Available versions of PyPy |  # Available versions of PyPy | ||||||
|  |  | ||||||
|  `setup-python` is able to configure PyPy from two sources: |  `setup-python` is able to configure PyPy from two sources: | ||||||
| @@ -211,7 +161,7 @@ Check out our detailed guide on using [Python with GitHub Actions](https://help. | |||||||
| - Preinstalled versions of PyPy in the tools cache on GitHub-hosted runners | - Preinstalled versions of PyPy in the tools cache on GitHub-hosted runners | ||||||
|   - For detailed information regarding the available versions of PyPy that are installed, see [Supported software](https://docs.github.com/en/actions/reference/specifications-for-github-hosted-runners#supported-software). |   - For detailed information regarding the available versions of PyPy that are installed, see [Supported software](https://docs.github.com/en/actions/reference/specifications-for-github-hosted-runners#supported-software). | ||||||
|   - For the latest PyPy release, all versions of Python are cached. |   - For the latest PyPy release, all versions of Python are cached. | ||||||
|   - Cache is updated with a 1-2 week delay. If you specify the PyPy version as `pypy3.7` or `pypy-3.7`, the cached version will be used although a newer version is available. If you need to start using the recently released version right after release, you should specify the exact PyPy version using `pypy3.7-v7.3.3` or `pypy-3.7-v7.3.3`. |   - Cache is updated with a 1-2 week delay. If you specify the PyPy version as `pypy-3.7`, the cached version will be used although a newer version is available. If you need to start using the recently released version right after release, you should specify the exact PyPy version using `pypy-3.7-v7.3.3`. | ||||||
|  |  | ||||||
| - Downloadable PyPy versions from the [official PyPy site](https://downloads.python.org/pypy/). | - Downloadable PyPy versions from the [official PyPy site](https://downloads.python.org/pypy/). | ||||||
|   - All available versions that we can download are listed in [versions.json](https://downloads.python.org/pypy/versions.json) file. |   - All available versions that we can download are listed in [versions.json](https://downloads.python.org/pypy/versions.json) file. | ||||||
| @@ -229,8 +179,8 @@ GitHub hosted runners have a tools cache that comes with a few versions of Pytho | |||||||
| |**PyPy Tool Cache**|`RUNNER_TOOL_CACHE/PyPy/*`| | |**PyPy Tool Cache**|`RUNNER_TOOL_CACHE/PyPy/*`| | ||||||
|  |  | ||||||
| GitHub virtual environments are setup in [actions/virtual-environments](https://github.com/actions/virtual-environments). During the setup, the available versions of Python and PyPy are automatically downloaded, setup and documented. | GitHub virtual environments are setup in [actions/virtual-environments](https://github.com/actions/virtual-environments). During the setup, the available versions of Python and PyPy are automatically downloaded, setup and documented. | ||||||
| - Tools cache setup for Ubuntu: [Install-Toolset.ps1](https://github.com/actions/virtual-environments/blob/main/images/linux/scripts/installers/Install-Toolset.ps1) [Configure-Toolset.ps1](https://github.com/actions/virtual-environments/blob/main/images/linux/scripts/installers/Configure-Toolset.ps1) | - [Tools cache setup for Ubuntu](https://github.com/actions/virtual-environments/blob/main/images/linux/scripts/installers/hosted-tool-cache.sh) | ||||||
| - Tools cache setup for Windows: [Install-Toolset.ps1](https://github.com/actions/virtual-environments/blob/main/images/win/scripts/Installers/Install-Toolset.ps1) [Configure-Toolset.ps1](https://github.com/actions/virtual-environments/blob/main/images/win/scripts/Installers/Configure-Toolset.ps1) | - [Tools cache setup for Windows](https://github.com/actions/virtual-environments/blob/main/images/win/scripts/Installers/Download-ToolCache.ps1) | ||||||
|  |  | ||||||
| # Specifying a Python version | # Specifying a Python version | ||||||
|  |  | ||||||
| @@ -244,21 +194,19 @@ You should specify only a major and minor version if you are okay with the most | |||||||
|   - Using the most recent patch version will result in a very quick setup since no downloads will be required since a locally installed version Python on the runner will be used. |   - Using the most recent patch version will result in a very quick setup since no downloads will be required since a locally installed version Python on the runner will be used. | ||||||
|  |  | ||||||
| # Specifying a PyPy version | # Specifying a PyPy version | ||||||
| The version of PyPy should be specified in the format `pypy<python_version>[-v<pypy_version>]` or `pypy-<python_version>[-v<pypy_version>]`. | The version of PyPy should be specified in the format `pypy-<python_version>[-v<pypy_version>]`. | ||||||
| The `<pypy_version>` parameter is optional and can be skipped. The latest version will be used in this case. | The `<pypy_version>` parameter is optional and can be skipped. The latest version will be used in this case. | ||||||
|  |  | ||||||
| ``` | ``` | ||||||
| pypy3.7 or pypy-3.7 # the latest available version of PyPy that supports Python 3.7 | pypy-3.7 # the latest available version of PyPy that supports Python 3.7 | ||||||
| pypy3.8 or pypy-3.8 # the latest available version of PyPy that supports Python 3.8 | pypy-3.8 # the latest available version of PyPy that supports Python 3.8 | ||||||
| pypy2.7 or pypy-2.7 # the latest available version of PyPy that supports Python 2.7 | pypy-2.7 # the latest available version of PyPy that supports Python 2.7 | ||||||
| pypy3.7-v7.3.3 or pypy-3.7-v7.3.3 # Python 3.7 and PyPy 7.3.3 | pypy-3.7-v7.3.3 # Python 3.7 and PyPy 7.3.3 | ||||||
| pypy3.7-v7.x or pypy-3.7-v7.x # Python 3.7 and the latest available PyPy 7.x | pypy-3.7-v7.x # Python 3.7 and the latest available PyPy 7.x | ||||||
| pypy3.7-v7.3.3rc1 or pypy-3.7-v7.3.3rc1 # Python 3.7 and preview version of PyPy | pypy-3.7-v7.3.3rc1 # Python 3.7 and preview version of PyPy | ||||||
| pypy3.7-nightly or pypy-3.7-nightly # Python 3.7 and nightly PyPy | pypy-3.7-nightly # Python 3.7 and nightly PyPy | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| Note: `pypy2` and `pypy3` have been removed in v3. Use the format above instead. |  | ||||||
|  |  | ||||||
| # Caching packages dependencies | # Caching packages dependencies | ||||||
|  |  | ||||||
| The action has built-in functionality for caching and restoring dependencies. It uses [actions/cache](https://github.com/actions/toolkit/tree/main/packages/cache) under the hood for caching dependencies but requires less configuration settings. Supported package managers are `pip`, `pipenv` and `poetry`. The `cache` input is optional, and caching is turned off by default. | The action has built-in functionality for caching and restoring dependencies. It uses [actions/cache](https://github.com/actions/toolkit/tree/main/packages/cache) under the hood for caching dependencies but requires less configuration settings. Supported package managers are `pip`, `pipenv` and `poetry`. The `cache` input is optional, and caching is turned off by default. | ||||||
| @@ -278,7 +226,7 @@ The requirements file format allows to specify dependency versions using logical | |||||||
| ```yaml | ```yaml | ||||||
| steps: | steps: | ||||||
| - uses: actions/checkout@v3 | - uses: actions/checkout@v3 | ||||||
| - uses: actions/setup-python@v4 | - uses: actions/setup-python@v3 | ||||||
|   with: |   with: | ||||||
|     python-version: '3.9' |     python-version: '3.9' | ||||||
|     cache: 'pip' |     cache: 'pip' | ||||||
| @@ -289,22 +237,22 @@ steps: | |||||||
| ```yaml | ```yaml | ||||||
| steps: | steps: | ||||||
| - uses: actions/checkout@v3 | - uses: actions/checkout@v3 | ||||||
| - uses: actions/setup-python@v4 | - name: Install pipenv | ||||||
|  |   run: pipx install pipenv | ||||||
|  | - uses: actions/setup-python@v3 | ||||||
|   with: |   with: | ||||||
|     python-version: '3.9' |     python-version: '3.9' | ||||||
|     cache: 'pipenv' |     cache: 'pipenv' | ||||||
| - name: Install pipenv |  | ||||||
|   run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python |  | ||||||
| - run: pipenv install | - run: pipenv install | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| **Caching poetry dependencies:** | **Caching poetry dependencies:** | ||||||
| ```yaml | ```yaml | ||||||
| steps: | steps: | ||||||
| - uses: actions/checkout@v3 | - uses: actions/checkout@v2 | ||||||
| - name: Install poetry | - name: Install poetry | ||||||
|   run: pipx install poetry |   run: pipx install poetry | ||||||
| - uses: actions/setup-python@v4 | - uses: actions/setup-python@v2 | ||||||
|   with: |   with: | ||||||
|     python-version: '3.9' |     python-version: '3.9' | ||||||
|     cache: 'poetry' |     cache: 'poetry' | ||||||
| @@ -316,7 +264,7 @@ steps: | |||||||
| ```yaml | ```yaml | ||||||
| steps: | steps: | ||||||
| - uses: actions/checkout@v3 | - uses: actions/checkout@v3 | ||||||
| - uses: actions/setup-python@v4 | - uses: actions/setup-python@v3 | ||||||
|   with: |   with: | ||||||
|     python-version: '3.9' |     python-version: '3.9' | ||||||
|     cache: 'pip' |     cache: 'pip' | ||||||
| @@ -328,53 +276,18 @@ steps: | |||||||
| ```yaml | ```yaml | ||||||
| steps: | steps: | ||||||
| - uses: actions/checkout@v3 | - uses: actions/checkout@v3 | ||||||
| - uses: actions/setup-python@v4 | - name: Install pipenv | ||||||
|  |   run: pipx install pipenv | ||||||
|  | - uses: actions/setup-python@v3 | ||||||
|   with: |   with: | ||||||
|     python-version: '3.9' |     python-version: '3.9' | ||||||
|     cache: 'pipenv' |     cache: 'pipenv' | ||||||
|     cache-dependency-path: | |     cache-dependency-path: | | ||||||
|       server/app/Pipfile.lock |       server/app/Pipfile.lock | ||||||
|       __test__/app/Pipfile.lock |       __test__/app/Pipfile.lock | ||||||
| - name: Install pipenv |  | ||||||
|   run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python |  | ||||||
| - run: pipenv install | - run: pipenv install | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| **Using a list of wildcard patterns to cache dependencies** |  | ||||||
| ```yaml |  | ||||||
| steps: |  | ||||||
| - uses: actions/checkout@v3 |  | ||||||
| - uses: actions/setup-python@v4 |  | ||||||
|   with: |  | ||||||
|     python-version: '3.10' |  | ||||||
|     cache: 'pip' |  | ||||||
|     cache-dependency-path: | |  | ||||||
|       **/setup.cfg |  | ||||||
|       **/requirements*.txt |  | ||||||
| - run: pip install -e . -r subdirectory/requirements-dev.txt |  | ||||||
| ``` |  | ||||||
|  |  | ||||||
|  |  | ||||||
| # Environment variables |  | ||||||
|  |  | ||||||
|  The `update-environment` flag defaults to `true`. |  | ||||||
|  With this setting, the action will add/update environment variables (e.g. `PATH`, `PKG_CONFIG_PATH`, `pythonLocation`) for `python` to just work out of the box. |  | ||||||
|  |  | ||||||
|  If `update-environment` is set to `false`, the action will not add/update environment variables. |  | ||||||
|  This can prove useful if you want the only side-effect to be to ensure python is installed and rely on the `python-path` output to run python. |  | ||||||
|  Such a requirement on side-effect could be because you don't want your composite action messing with your user's workflows. |  | ||||||
|  |  | ||||||
|  ```yaml |  | ||||||
|  steps: |  | ||||||
|    - uses: actions/checkout@v3 |  | ||||||
|    - uses: actions/setup-python@v4 |  | ||||||
|      id: cp310 |  | ||||||
|      with: |  | ||||||
|        python-version: '3.10' |  | ||||||
|        update-environment: false |  | ||||||
|    - run: ${{ steps.cp310.outputs.python-path }} my_script.py |  | ||||||
|  ``` |  | ||||||
|  |  | ||||||
| # Using `setup-python` with a self hosted runner | # Using `setup-python` with a self hosted 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. | 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. | ||||||
| @@ -392,7 +305,7 @@ If you are experiencing problems while configuring Python on your self-hosted ru | |||||||
| ### Linux | ### Linux | ||||||
|  |  | ||||||
| - The Python packages that are downloaded from `actions/python-versions` are originally compiled from source in `/opt/hostedtoolcache/` with the [--enable-shared](https://github.com/actions/python-versions/blob/94f04ae6806c6633c82db94c6406a16e17decd5c/builders/ubuntu-python-builder.psm1#L35) flag, which makes them non-relocatable. | - The Python packages that are downloaded from `actions/python-versions` are originally compiled from source in `/opt/hostedtoolcache/` with the [--enable-shared](https://github.com/actions/python-versions/blob/94f04ae6806c6633c82db94c6406a16e17decd5c/builders/ubuntu-python-builder.psm1#L35) flag, which makes them non-relocatable. | ||||||
| - By default runner downloads and install the tools to `/opt/hostedtoolcache`. The environment variable called `AGENT_TOOLSDIRECTORY` can be set to change this location. | - Create an environment variable called `AGENT_TOOLSDIRECTORY` and set it to `/opt/hostedtoolcache`. This controls where the runner downloads and installs tools. | ||||||
|   - In the same shell that your runner is using, type `export AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache`. |   - In the same shell that your runner is using, type `export AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache`. | ||||||
|   - A more permanent way of setting the environment variable is to create a `.env` file in the same directory as your runner and to add `AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache`. This ensures the variable is always set if your runner is configured as a service. |   - A more permanent way of setting the environment variable is to create a `.env` file in the same directory as your runner and to add `AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache`. This ensures the variable is always set if your runner is configured as a service. | ||||||
| - Create a directory called `hostedtoolcache` inside `/opt`. | - Create a directory called `hostedtoolcache` inside `/opt`. | ||||||
|   | |||||||
| @@ -5,7 +5,7 @@ import {getCacheDistributor} from '../src/cache-distributions/cache-factory'; | |||||||
|  |  | ||||||
| describe('restore-cache', () => { | describe('restore-cache', () => { | ||||||
|   const pipFileLockHash = |   const pipFileLockHash = | ||||||
|     'a3bdcc71289e4979ca9e051810d81999cc99823109faf6912e17ff14c8e621a6'; |     '67d817abcde9c72da0ed5b8f235647cb14638b9ff9d742b42e4406d2eb16fe3c'; | ||||||
|   const requirementsHash = |   const requirementsHash = | ||||||
|     'd8110e0006d7fb5ee76365d565eef9d37df1d11598b912d3eb66d398d57a1121'; |     'd8110e0006d7fb5ee76365d565eef9d37df1d11598b912d3eb66d398d57a1121'; | ||||||
|   const requirementsLinuxHash = |   const requirementsLinuxHash = | ||||||
| @@ -27,7 +27,6 @@ virtualenvs.path = "{cache-dir}/virtualenvs"  # /Users/patrick/Library/Caches/py | |||||||
|   let debugSpy: jest.SpyInstance; |   let debugSpy: jest.SpyInstance; | ||||||
|   let saveSatetSpy: jest.SpyInstance; |   let saveSatetSpy: jest.SpyInstance; | ||||||
|   let getStateSpy: jest.SpyInstance; |   let getStateSpy: jest.SpyInstance; | ||||||
|   let setOutputSpy: jest.SpyInstance; |  | ||||||
|  |  | ||||||
|   // cache spy |   // cache spy | ||||||
|   let restoreCacheSpy: jest.SpyInstance; |   let restoreCacheSpy: jest.SpyInstance; | ||||||
| @@ -65,9 +64,6 @@ virtualenvs.path = "{cache-dir}/virtualenvs"  # /Users/patrick/Library/Caches/py | |||||||
|       return {stdout: '', stderr: 'Error occured', exitCode: 2}; |       return {stdout: '', stderr: 'Error occured', exitCode: 2}; | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|     setOutputSpy = jest.spyOn(core, 'setOutput'); |  | ||||||
|     setOutputSpy.mockImplementation(input => undefined); |  | ||||||
|  |  | ||||||
|     restoreCacheSpy = jest.spyOn(cache, 'restoreCache'); |     restoreCacheSpy = jest.spyOn(cache, 'restoreCache'); | ||||||
|     restoreCacheSpy.mockImplementation( |     restoreCacheSpy.mockImplementation( | ||||||
|       (cachePaths: string[], primaryKey: string, restoreKey?: string) => { |       (cachePaths: string[], primaryKey: string, restoreKey?: string) => { | ||||||
| @@ -104,7 +100,7 @@ virtualenvs.path = "{cache-dir}/virtualenvs"  # /Users/patrick/Library/Caches/py | |||||||
|     ])( |     ])( | ||||||
|       'restored dependencies for %s by primaryKey', |       'restored dependencies for %s by primaryKey', | ||||||
|       async (packageManager, pythonVersion, dependencyFile, fileHash) => { |       async (packageManager, pythonVersion, dependencyFile, fileHash) => { | ||||||
|         const cacheDistributor = getCacheDistributor( |         const cacheDistributor = await getCacheDistributor( | ||||||
|           packageManager, |           packageManager, | ||||||
|           pythonVersion, |           pythonVersion, | ||||||
|           dependencyFile |           dependencyFile | ||||||
| @@ -130,7 +126,7 @@ virtualenvs.path = "{cache-dir}/virtualenvs"  # /Users/patrick/Library/Caches/py | |||||||
|         dependencyFile, |         dependencyFile, | ||||||
|         cacheDependencyPath |         cacheDependencyPath | ||||||
|       ) => { |       ) => { | ||||||
|         const cacheDistributor = getCacheDistributor( |         const cacheDistributor = await getCacheDistributor( | ||||||
|           packageManager, |           packageManager, | ||||||
|           pythonVersion, |           pythonVersion, | ||||||
|           dependencyFile |           dependencyFile | ||||||
| @@ -166,7 +162,7 @@ virtualenvs.path = "{cache-dir}/virtualenvs"  # /Users/patrick/Library/Caches/py | |||||||
|             return primaryKey !== fileHash && restoreKey ? pipFileLockHash : ''; |             return primaryKey !== fileHash && restoreKey ? pipFileLockHash : ''; | ||||||
|           } |           } | ||||||
|         ); |         ); | ||||||
|         const cacheDistributor = getCacheDistributor( |         const cacheDistributor = await getCacheDistributor( | ||||||
|           packageManager, |           packageManager, | ||||||
|           pythonVersion, |           pythonVersion, | ||||||
|           dependencyFile |           dependencyFile | ||||||
| @@ -191,38 +187,6 @@ virtualenvs.path = "{cache-dir}/virtualenvs"  # /Users/patrick/Library/Caches/py | |||||||
|     ); |     ); | ||||||
|   }); |   }); | ||||||
|  |  | ||||||
|   describe('Check if handleMatchResult', () => { |  | ||||||
|     it.each([ |  | ||||||
|       ['pip', '3.8.12', 'requirements.txt', 'someKey', 'someKey', true], |  | ||||||
|       ['pipenv', '3.9.1', 'requirements.txt', 'someKey', 'someKey', true], |  | ||||||
|       ['poetry', '3.8.12', 'requirements.txt', 'someKey', 'someKey', true], |  | ||||||
|       ['pip', '3.9.2', 'requirements.txt', undefined, 'someKey', false], |  | ||||||
|       ['pipenv', '3.8.12', 'requirements.txt', undefined, 'someKey', false], |  | ||||||
|       ['poetry', '3.9.12', 'requirements.txt', undefined, 'someKey', false] |  | ||||||
|     ])( |  | ||||||
|       'sets correct outputs', |  | ||||||
|       async ( |  | ||||||
|         packageManager, |  | ||||||
|         pythonVersion, |  | ||||||
|         dependencyFile, |  | ||||||
|         matchedKey, |  | ||||||
|         restoredKey, |  | ||||||
|         expectedOutputValue |  | ||||||
|       ) => { |  | ||||||
|         const cacheDistributor = getCacheDistributor( |  | ||||||
|           packageManager, |  | ||||||
|           pythonVersion, |  | ||||||
|           dependencyFile |  | ||||||
|         ); |  | ||||||
|         cacheDistributor.handleMatchResult(matchedKey, restoredKey); |  | ||||||
|         expect(setOutputSpy).toHaveBeenCalledWith( |  | ||||||
|           'cache-hit', |  | ||||||
|           expectedOutputValue |  | ||||||
|         ); |  | ||||||
|       } |  | ||||||
|     ); |  | ||||||
|   }); |  | ||||||
|  |  | ||||||
|   afterEach(() => { |   afterEach(() => { | ||||||
|     jest.resetAllMocks(); |     jest.resetAllMocks(); | ||||||
|     jest.clearAllMocks(); |     jest.clearAllMocks(); | ||||||
|   | |||||||
| @@ -6,7 +6,7 @@ import {State} from '../src/cache-distributions/cache-distributor'; | |||||||
|  |  | ||||||
| describe('run', () => { | describe('run', () => { | ||||||
|   const pipFileLockHash = |   const pipFileLockHash = | ||||||
|     'd1dd6218299d8a6db5fc2001d988b34a8b31f1e9d0bb4534d377dde7c19f64b3'; |     '67d817abcde9c72da0ed5b8f235647cb14638b9ff9d742b42e4406d2eb16fe3c'; | ||||||
|   const requirementsHash = |   const requirementsHash = | ||||||
|     'd8110e0006d7fb5ee76365d565eef9d37df1d11598b912d3eb66d398d57a1121'; |     'd8110e0006d7fb5ee76365d565eef9d37df1d11598b912d3eb66d398d57a1121'; | ||||||
|   const requirementsLinuxHash = |   const requirementsLinuxHash = | ||||||
| @@ -212,59 +212,6 @@ describe('run', () => { | |||||||
|       ); |       ); | ||||||
|       expect(setFailedSpy).not.toHaveBeenCalled(); |       expect(setFailedSpy).not.toHaveBeenCalled(); | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|     it('saves with -1 cacheId , should not fail workflow', async () => { |  | ||||||
|       inputs['cache'] = 'poetry'; |  | ||||||
|       getStateSpy.mockImplementation((name: string) => { |  | ||||||
|         if (name === State.STATE_CACHE_PRIMARY_KEY) { |  | ||||||
|           return poetryLockHash; |  | ||||||
|         } else if (name === State.CACHE_PATHS) { |  | ||||||
|           return JSON.stringify([__dirname]); |  | ||||||
|         } else { |  | ||||||
|           return requirementsHash; |  | ||||||
|         } |  | ||||||
|       }); |  | ||||||
|  |  | ||||||
|       saveCacheSpy.mockImplementation(() => { |  | ||||||
|         return -1; |  | ||||||
|       }); |  | ||||||
|  |  | ||||||
|       await run(); |  | ||||||
|  |  | ||||||
|       expect(getInputSpy).toHaveBeenCalled(); |  | ||||||
|       expect(getStateSpy).toHaveBeenCalledTimes(3); |  | ||||||
|       expect(infoSpy).not.toHaveBeenCalled(); |  | ||||||
|       expect(saveCacheSpy).toHaveBeenCalled(); |  | ||||||
|       expect(infoSpy).not.toHaveBeenLastCalledWith( |  | ||||||
|         `Cache saved with the key: ${poetryLockHash}` |  | ||||||
|       ); |  | ||||||
|       expect(setFailedSpy).not.toHaveBeenCalled(); |  | ||||||
|     }); |  | ||||||
|  |  | ||||||
|     it('saves with error from toolkit, should fail workflow', async () => { |  | ||||||
|       inputs['cache'] = 'npm'; |  | ||||||
|       getStateSpy.mockImplementation((name: string) => { |  | ||||||
|         if (name === State.STATE_CACHE_PRIMARY_KEY) { |  | ||||||
|           return poetryLockHash; |  | ||||||
|         } else if (name === State.CACHE_PATHS) { |  | ||||||
|           return JSON.stringify([__dirname]); |  | ||||||
|         } else { |  | ||||||
|           return requirementsHash; |  | ||||||
|         } |  | ||||||
|       }); |  | ||||||
|  |  | ||||||
|       saveCacheSpy.mockImplementation(() => { |  | ||||||
|         throw new cache.ValidationError('Validation failed'); |  | ||||||
|       }); |  | ||||||
|  |  | ||||||
|       await run(); |  | ||||||
|  |  | ||||||
|       expect(getInputSpy).toHaveBeenCalled(); |  | ||||||
|       expect(getStateSpy).toHaveBeenCalledTimes(3); |  | ||||||
|       expect(infoSpy).not.toHaveBeenCalledWith(); |  | ||||||
|       expect(saveCacheSpy).toHaveBeenCalled(); |  | ||||||
|       expect(setFailedSpy).toHaveBeenCalled(); |  | ||||||
|     }); |  | ||||||
|   }); |   }); | ||||||
|  |  | ||||||
|   afterEach(() => { |   afterEach(() => { | ||||||
|   | |||||||
| @@ -1,14 +0,0 @@ | |||||||
| #!/bin/bash |  | ||||||
|  |  | ||||||
| set -euo pipefail |  | ||||||
|  |  | ||||||
| PYTHON_PATH="$1" |  | ||||||
| PATH_EXECUTABLE=$(python -c 'import sys; print(sys.executable)') |  | ||||||
| PYTHON_PATH_EXECUTABLE=$("${PYTHON_PATH}" -c 'import sys; print(sys.executable)') |  | ||||||
| if [ "${PATH_EXECUTABLE}" != "${PYTHON_PATH_EXECUTABLE}" ]; then |  | ||||||
|     echo "Executable mismatch." |  | ||||||
|     echo "python in PATH is: ${PATH_EXECUTABLE}" |  | ||||||
|     echo "python-path (${PYTHON_PATH}) is: ${PYTHON_PATH_EXECUTABLE}" |  | ||||||
|     exit 1 |  | ||||||
| fi |  | ||||||
| echo "python-path: ${PYTHON_PATH}" |  | ||||||
| @@ -1,13 +0,0 @@ | |||||||
| [[source]] |  | ||||||
| url = "https://pypi.org/simple" |  | ||||||
| verify_ssl = true |  | ||||||
| name = "pypi" |  | ||||||
|  |  | ||||||
| [packages] |  | ||||||
| flake8 = "==4.0.1" |  | ||||||
| numpy = "==1.23.0" |  | ||||||
|  |  | ||||||
| [dev-packages] |  | ||||||
|  |  | ||||||
| [requires] |  | ||||||
| python_version = "*" |  | ||||||
							
								
								
									
										290
									
								
								__tests__/data/Pipfile.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										290
									
								
								__tests__/data/Pipfile.lock
									
									
									
										generated
									
									
									
								
							| @@ -1,11 +1,11 @@ | |||||||
| { | { | ||||||
|     "_meta": { |     "_meta": { | ||||||
|         "hash": { |         "hash": { | ||||||
|             "sha256": "e9c37110984955621040e2dc8548c026eb8466c23db1b8e69430289b10be8938" |             "sha256": "408f110354c997d8df1e17841d5335ae690f5b25f8c78040d62257f9535c6005" | ||||||
|         }, |         }, | ||||||
|         "pipfile-spec": 6, |         "pipfile-spec": 6, | ||||||
|         "requires": { |         "requires": { | ||||||
|             "python_version": "*" |             "python_version": "3.7" | ||||||
|         }, |         }, | ||||||
|         "sources": [ |         "sources": [ | ||||||
|             { |             { | ||||||
| @@ -16,64 +16,260 @@ | |||||||
|         ] |         ] | ||||||
|     }, |     }, | ||||||
|     "default": { |     "default": { | ||||||
|         "flake8": { |         "altgraph": { | ||||||
|             "hashes": [ |             "hashes": [ | ||||||
|                 "sha256:479b1304f72536a55948cb40a32dce8bb0ffe3501e26eaf292c7e60eb5e0428d", |                 "sha256:743628f2ac6a7c26f5d9223c91ed8ecbba535f506f4b6f558885a8a56a105857", | ||||||
|                 "sha256:806e034dda44114815e23c16ef92f95c91e4c71100ff52813adf7132a6ad870d" |                 "sha256:ebf2269361b47d97b3b88e696439f6e4cbc607c17c51feb1754f90fb79839158" | ||||||
|  |             ], | ||||||
|  |             "version": "==0.17.2" | ||||||
|  |         }, | ||||||
|  |         "certifi": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:5930595817496dd21bb8dc35dad090f1c2cd0adfaf21204bf6732ca5d8ee34d3", | ||||||
|  |                 "sha256:8fc0819f1f30ba15bdb34cceffb9ef04d99f420f68eb75d901e9560b8749fc41" | ||||||
|             ], |             ], | ||||||
|             "index": "pypi", |             "index": "pypi", | ||||||
|             "version": "==4.0.1" |             "version": "==2020.6.20" | ||||||
|         }, |         }, | ||||||
|         "mccabe": { |         "chardet": { | ||||||
|             "hashes": [ |             "hashes": [ | ||||||
|                 "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", |                 "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae", | ||||||
|                 "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f" |                 "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691" | ||||||
|             ], |  | ||||||
|             "version": "==0.6.1" |  | ||||||
|         }, |  | ||||||
|         "numpy": { |  | ||||||
|             "hashes": [ |  | ||||||
|                 "sha256:092f5e6025813e64ad6d1b52b519165d08c730d099c114a9247c9bb635a2a450", |  | ||||||
|                 "sha256:196cd074c3f97c4121601790955f915187736f9cf458d3ee1f1b46aff2b1ade0", |  | ||||||
|                 "sha256:1c29b44905af288b3919803aceb6ec7fec77406d8b08aaa2e8b9e63d0fe2f160", |  | ||||||
|                 "sha256:2b2da66582f3a69c8ce25ed7921dcd8010d05e59ac8d89d126a299be60421171", |  | ||||||
|                 "sha256:5043bcd71fcc458dfb8a0fc5509bbc979da0131b9d08e3d5f50fb0bbb36f169a", |  | ||||||
|                 "sha256:58bfd40eb478f54ff7a5710dd61c8097e169bc36cc68333d00a9bcd8def53b38", |  | ||||||
|                 "sha256:79a506cacf2be3a74ead5467aee97b81fca00c9c4c8b3ba16dbab488cd99ba10", |  | ||||||
|                 "sha256:94b170b4fa0168cd6be4becf37cb5b127bd12a795123984385b8cd4aca9857e5", |  | ||||||
|                 "sha256:97a76604d9b0e79f59baeca16593c711fddb44936e40310f78bfef79ee9a835f", |  | ||||||
|                 "sha256:98e8e0d8d69ff4d3fa63e6c61e8cfe2d03c29b16b58dbef1f9baa175bbed7860", |  | ||||||
|                 "sha256:ac86f407873b952679f5f9e6c0612687e51547af0e14ddea1eedfcb22466babd", |  | ||||||
|                 "sha256:ae8adff4172692ce56233db04b7ce5792186f179c415c37d539c25de7298d25d", |  | ||||||
|                 "sha256:bd3fa4fe2e38533d5336e1272fc4e765cabbbde144309ccee8675509d5cd7b05", |  | ||||||
|                 "sha256:d0d2094e8f4d760500394d77b383a1b06d3663e8892cdf5df3c592f55f3bff66", |  | ||||||
|                 "sha256:d54b3b828d618a19779a84c3ad952e96e2c2311b16384e973e671aa5be1f6187", |  | ||||||
|                 "sha256:d6ca8dabe696c2785d0c8c9b0d8a9b6e5fdbe4f922bde70d57fa1a2848134f95", |  | ||||||
|                 "sha256:d8cc87bed09de55477dba9da370c1679bd534df9baa171dd01accbb09687dac3", |  | ||||||
|                 "sha256:f0f18804df7370571fb65db9b98bf1378172bd4e962482b857e612d1fec0f53e", |  | ||||||
|                 "sha256:f1d88ef79e0a7fa631bb2c3dda1ea46b32b1fe614e10fedd611d3d5398447f2f", |  | ||||||
|                 "sha256:f9c3fc2adf67762c9fe1849c859942d23f8d3e0bee7b5ed3d4a9c3eeb50a2f07", |  | ||||||
|                 "sha256:fc431493df245f3c627c0c05c2bd134535e7929dbe2e602b80e42bf52ff760bc", |  | ||||||
|                 "sha256:fe8b9683eb26d2c4d5db32cd29b38fdcf8381324ab48313b5b69088e0e355379" |  | ||||||
|             ], |             ], | ||||||
|             "index": "pypi", |             "index": "pypi", | ||||||
|             "version": "==1.23.0" |             "version": "==3.0.4" | ||||||
|         }, |         }, | ||||||
|         "pycodestyle": { |         "docutils": { | ||||||
|             "hashes": [ |             "hashes": [ | ||||||
|                 "sha256:720f8b39dde8b293825e7ff02c475f3077124006db4f440dcbc9a20b76548a20", |                 "sha256:0c5b78adfbf7762415433f5515cd5c9e762339e23369dbe8000d84a4bf4ab3af", | ||||||
|                 "sha256:eddd5847ef438ea1c7870ca7eb78a9d47ce0cdb4851a5523949f2601d0cbbe7f" |                 "sha256:c2de3a60e9e7d07be26b7f2b00ca0309c207e06c100f9cc2a94931fc75a478fc" | ||||||
|             ], |             ], | ||||||
|             "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", |             "index": "pypi", | ||||||
|             "version": "==2.8.0" |             "version": "==0.16" | ||||||
|         }, |         }, | ||||||
|         "pyflakes": { |         "future": { | ||||||
|             "hashes": [ |             "hashes": [ | ||||||
|                 "sha256:05a85c2872edf37a4ed30b0cce2f6093e1d0581f8c19d7393122da7e25b2b24c", |                 "sha256:b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d" | ||||||
|                 "sha256:3bb3a3f256f4b7968c9c788781e4ff07dce46bdf12339dcda61053375426ee2e" |  | ||||||
|             ], |             ], | ||||||
|             "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", |             "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2'", | ||||||
|             "version": "==2.4.0" |             "version": "==0.18.2" | ||||||
|  |         }, | ||||||
|  |         "idna": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:7588d1c14ae4c77d74036e8c22ff447b26d0fde8f007354fd48a7814db15b7cb", | ||||||
|  |                 "sha256:a068a21ceac8a4d63dbfd964670474107f541babbd2250d61922f029858365fa" | ||||||
|  |             ], | ||||||
|  |             "index": "pypi", | ||||||
|  |             "version": "==2.9" | ||||||
|  |         }, | ||||||
|  |         "itsdangerous": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:321b033d07f2a4136d3ec762eac9f16a10ccd60f53c0c91af90217ace7ba1f19", | ||||||
|  |                 "sha256:b12271b2047cb23eeb98c8b5622e2e5c5e9abd9784a153e9d8ef9cb4dd09d749" | ||||||
|  |             ], | ||||||
|  |             "index": "pypi", | ||||||
|  |             "version": "==1.1.0" | ||||||
|  |         }, | ||||||
|  |         "kivy": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:090d3ded9835a17477cd93fbdaf0a7c42ff2218981cf198ded5ad8795bc74391", | ||||||
|  |                 "sha256:11e85eaf6efbfa2362a3334ffdad179a1b0ca8d255cca79eaa6a2765560d4982", | ||||||
|  |                 "sha256:1a1ff32f8a95f1e175198cbab81fcd2596783b180d4eafe63e87d171aa7fdb5e", | ||||||
|  |                 "sha256:1d28b198a64c30db8d94a0488e85f3037af60d514ab0d7ad5ab45add3ab77090", | ||||||
|  |                 "sha256:4a5480cbf837d3780c77a4f61b32b56d22ae9f03845e7a89dd3eaef1ae5fd037", | ||||||
|  |                 "sha256:4d0e596f74271e901b551f77661dde238df4765484fce9f5d1c72e8022984e84", | ||||||
|  |                 "sha256:5c3d0f2749522d62e9cce09cd54b2d823bf1b6b644ff1f627be49de6f3e3cba0", | ||||||
|  |                 "sha256:815a5c0b3b72fcd81ca7b2aa0744087163ed03e4cf9ab4e7c9733cea99fc1571", | ||||||
|  |                 "sha256:8819a27a09871af451760cb69486ced52e830c8a0a37480f22ef5e692f12c05b", | ||||||
|  |                 "sha256:a687602d90c4629dd036f577ca39acb76ba581370f9d915f3cab99be818ba8ad", | ||||||
|  |                 "sha256:b7ef6aad43a86d8df3fb865db864e354f2155a748019f8517f69f65c1a29cb64", | ||||||
|  |                 "sha256:b85ccf165050cbf2ee8447671eebbc222b369b40f0e0038dd9547d49a5e37373", | ||||||
|  |                 "sha256:c36652caa7f6c327dee834cfc699d5962d346b7a53e54bd81abc17c314226d89", | ||||||
|  |                 "sha256:ece170514db3f49844a41e4c910ad9ce9bc46da6f47a49158e11266bdcc6e479", | ||||||
|  |                 "sha256:f3bea6e4a21991827885d04127fc6d09a0e974ecfa12da7bf5faae93562ea102", | ||||||
|  |                 "sha256:f835462dd9aa491272552ef079b948a088598e2e95d68bb1d885d2c3f3d4e2c3" | ||||||
|  |             ], | ||||||
|  |             "index": "pypi", | ||||||
|  |             "version": "==1.11.1" | ||||||
|  |         }, | ||||||
|  |         "kivy-deps-angle": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:50605fdd4c9fdbe9f717069734a598a9aba0afe5d3f0412afbe2ecff0326e92d", | ||||||
|  |                 "sha256:64ac7f33c000585dc30194e604aed925972c6b7c3848b5c3b073ae916fb0b55c", | ||||||
|  |                 "sha256:99c40d53582a958748e251dfbd61aa67fb85963e27529ca08a21f2f5eeed04e1", | ||||||
|  |                 "sha256:a2cea09e8a5e899629466403fbd540459f1cdef8d08c6c479b6607b95309be02", | ||||||
|  |                 "sha256:b167e19b3eea55a9a8c606a607bb909ec1bedda88deee40347c780b310155a79", | ||||||
|  |                 "sha256:b9d07976b0bf6bac724a42aa8ed5a8c7caa95609046db30c8f15bb731f8e4d36", | ||||||
|  |                 "sha256:bb4d53f15a093214adbbe205c108ede5cc0f6af6eff104c1b8c468ddaaf6400a", | ||||||
|  |                 "sha256:d0e7b7b9eb9669837a5d70808a7ea45f2b61961b56f9f69a233bad6bd36ce260" | ||||||
|  |             ], | ||||||
|  |             "index": "pypi", | ||||||
|  |             "version": "==0.3.0" | ||||||
|  |         }, | ||||||
|  |         "kivy-deps.glew": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:09f72ee5ef33ff273332e2a229dc97d650d29818a0189339421949e4e0f63d93", | ||||||
|  |                 "sha256:1e28e40017af9d081fc0fc95b4fadaf31d15e9f63478dcee1c4257d67079894e", | ||||||
|  |                 "sha256:45aa7f0e8d9bcf5fc1810c9c38bc20edf7dee61df81ecf62102e0f84153f924a", | ||||||
|  |                 "sha256:6bb435620c3187d2c61054adb9ec277ed487256b457a0a7b1491bc0cb7247e18", | ||||||
|  |                 "sha256:92e72fa2c425887987d1aa861c99537033dc20d68ae1c54864871f0401682586", | ||||||
|  |                 "sha256:ab81783a82bef88a8d2bcf8a93bc21df6b8b0db6ee551eb802727d18f9074b17", | ||||||
|  |                 "sha256:c843104690c0c8f3a58105c53c57f31506f6f90562c18de00bd19317cc1045a7", | ||||||
|  |                 "sha256:cf351aad171796f8051af8e49ec430a9aa128d8557d8643e73f2bb1e5f9c2dab", | ||||||
|  |                 "sha256:ee8ab67abb2c98d84feede657cae472e7723e529af07394244bdd33caafb1a38", | ||||||
|  |                 "sha256:ef1116d99bd9cc737cb8c0e13e676955c17d6e4d6d1af5cfccef089a430071bb" | ||||||
|  |             ], | ||||||
|  |             "index": "pypi", | ||||||
|  |             "version": "==0.1.12" | ||||||
|  |         }, | ||||||
|  |         "kivy-deps.gstreamer": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:0d9598d2d31c0e780adf4b767fa3a691123621fd0ffef94b83cf82c2da84341b", | ||||||
|  |                 "sha256:309eca64dee5939f16f8465e5cbb08bdde7c90ded1af6a00690c7e928326af79", | ||||||
|  |                 "sha256:3d53d2c84c0a997c4cac6c239b1e0a6486e533836321003dc365ec42b97a664b", | ||||||
|  |                 "sha256:4d996377111e854b3dea90846f9b2f98766a44529fd8b72125e18c552381d928", | ||||||
|  |                 "sha256:4f2ddd61d185310258d338ae80a646df7822efdd7d67e57f49dc7b87555c5d7e", | ||||||
|  |                 "sha256:6fa9f76afe600baa221abee31ce7dc63e653d0affe0f6c558bfc4f35af96396f", | ||||||
|  |                 "sha256:739cd331b9f33a822d700273674a79a3157054e9358a01a0d553f094a5f4a8c9", | ||||||
|  |                 "sha256:c29cfc63fe70a58dad889e631f1ba4711c9ea80103f2b2b8d670a97f093076c8", | ||||||
|  |                 "sha256:c4709765e2b17c6c96b46a92207b0457def147544d825654077603eaf0d424de" | ||||||
|  |             ], | ||||||
|  |             "index": "pypi", | ||||||
|  |             "version": "==0.1.17" | ||||||
|  |         }, | ||||||
|  |         "kivy-deps.sdl2": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:053f26e8c05d5545bdbc7eeb8c450b8e4410ee355792e9345af536110fe247e2", | ||||||
|  |                 "sha256:1b987bdd4fbbcb31baf0d7fc9584ad99912179b8968311bb7e30fbeb14e98e0d", | ||||||
|  |                 "sha256:228128cdd8112dc7505ac43027a770476e9ef282e0b84ca68037133cd025960b", | ||||||
|  |                 "sha256:2c2fd5a12a7a9afe3bb962b273561099a180edae91bb9c8f8386b72253fcae4a", | ||||||
|  |                 "sha256:5ce23f1a3286d6288751a12b0eaefd02f947ea101bb807e9781b964e496fc3f3", | ||||||
|  |                 "sha256:7928746eaed51944c10d1bb36fcefebe3d1aff1b97ba32359c2c97ba74707e1b", | ||||||
|  |                 "sha256:9270fa8ed5130074b167a7a3a9c85efc3cfe3c04584ab084cb6ae9e4edfa8168", | ||||||
|  |                 "sha256:92ed97d3247bc8ce98f336cbc940bb889310199326e9ccf251c49ae7e4b80de8", | ||||||
|  |                 "sha256:96e1fa89fd8b5351f2d3c26bbffd50df8d554b03fba4025ecc941d773d241698", | ||||||
|  |                 "sha256:c3ace0ddde0e59cdcaf260eda1daa0c05ca9bf8cd0c4ea404539de25a5dcaec7" | ||||||
|  |             ], | ||||||
|  |             "index": "pypi", | ||||||
|  |             "version": "==0.1.22" | ||||||
|  |         }, | ||||||
|  |         "kivy-garden": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:9b7d9de5efacbcd0c4b3dd873b30622a86093c9965aa47b523c7a32f3eb34610", | ||||||
|  |                 "sha256:c256f42788421273a08fbb0a228f0fb0e80dd86b629fb8c0920507f645be6c72" | ||||||
|  |             ], | ||||||
|  |             "index": "pypi", | ||||||
|  |             "version": "==0.1.4" | ||||||
|  |         }, | ||||||
|  |         "packaging": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:7dc96269f53a4ccec5c0670940a4281106dd0bb343f47b7471f779df49c2fbe7", | ||||||
|  |                 "sha256:c86254f9220d55e31cc94d69bade760f0847da8000def4dfe1c6b872fd14ff14" | ||||||
|  |             ], | ||||||
|  |             "index": "pypi", | ||||||
|  |             "version": "==21.0" | ||||||
|  |         }, | ||||||
|  |         "pdf2image": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:a0d9906f5507192210a8d5d7ead63145e9dec4bccc4564b1fb644e923913c31c" | ||||||
|  |             ], | ||||||
|  |             "index": "pypi", | ||||||
|  |             "version": "==1.12.1" | ||||||
|  |         }, | ||||||
|  |         "pefile": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:344a49e40a94e10849f0fe34dddc80f773a12b40675bf2f7be4b8be578bdd94a" | ||||||
|  |             ], | ||||||
|  |             "markers": "python_full_version >= '3.6.0'", | ||||||
|  |             "version": "==2021.9.3" | ||||||
|  |         }, | ||||||
|  |         "pillow": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:0295442429645fa16d05bd567ef5cff178482439c9aad0411d3f0ce9b88b3a6f", | ||||||
|  |                 "sha256:06aba4169e78c439d528fdeb34762c3b61a70813527a2c57f0540541e9f433a8", | ||||||
|  |                 "sha256:09d7f9e64289cb40c2c8d7ad674b2ed6105f55dc3b09aa8e4918e20a0311e7ad", | ||||||
|  |                 "sha256:0a80dd307a5d8440b0a08bd7b81617e04d870e40a3e46a32d9c246e54705e86f", | ||||||
|  |                 "sha256:1ca594126d3c4def54babee699c055a913efb01e106c309fa6b04405d474d5ae", | ||||||
|  |                 "sha256:25930fadde8019f374400f7986e8404c8b781ce519da27792cbe46eabec00c4d", | ||||||
|  |                 "sha256:431b15cffbf949e89df2f7b48528be18b78bfa5177cb3036284a5508159492b5", | ||||||
|  |                 "sha256:52125833b070791fcb5710fabc640fc1df07d087fc0c0f02d3661f76c23c5b8b", | ||||||
|  |                 "sha256:5e51ee2b8114def244384eda1c82b10e307ad9778dac5c83fb0943775a653cd8", | ||||||
|  |                 "sha256:612cfda94e9c8346f239bf1a4b082fdd5c8143cf82d685ba2dba76e7adeeb233", | ||||||
|  |                 "sha256:6d7741e65835716ceea0fd13a7d0192961212fd59e741a46bbed7a473c634ed6", | ||||||
|  |                 "sha256:6edb5446f44d901e8683ffb25ebdfc26988ee813da3bf91e12252b57ac163727", | ||||||
|  |                 "sha256:725aa6cfc66ce2857d585f06e9519a1cc0ef6d13f186ff3447ab6dff0a09bc7f", | ||||||
|  |                 "sha256:8dad18b69f710bf3a001d2bf3afab7c432785d94fcf819c16b5207b1cfd17d38", | ||||||
|  |                 "sha256:94cf49723928eb6070a892cb39d6c156f7b5a2db4e8971cb958f7b6b104fb4c4", | ||||||
|  |                 "sha256:97f9e7953a77d5a70f49b9a48da7776dc51e9b738151b22dacf101641594a626", | ||||||
|  |                 "sha256:9ad7f865eebde135d526bb3163d0b23ffff365cf87e767c649550964ad72785d", | ||||||
|  |                 "sha256:9c87ef410a58dd54b92424ffd7e28fd2ec65d2f7fc02b76f5e9b2067e355ebf6", | ||||||
|  |                 "sha256:a060cf8aa332052df2158e5a119303965be92c3da6f2d93b6878f0ebca80b2f6", | ||||||
|  |                 "sha256:c79f9c5fb846285f943aafeafda3358992d64f0ef58566e23484132ecd8d7d63", | ||||||
|  |                 "sha256:c92302a33138409e8f1ad16731568c55c9053eee71bb05b6b744067e1b62380f", | ||||||
|  |                 "sha256:d08b23fdb388c0715990cbc06866db554e1822c4bdcf6d4166cf30ac82df8c41", | ||||||
|  |                 "sha256:d350f0f2c2421e65fbc62690f26b59b0bcda1b614beb318c81e38647e0f673a1", | ||||||
|  |                 "sha256:e901964262a56d9ea3c2693df68bc9860b8bdda2b04768821e4c44ae797de117", | ||||||
|  |                 "sha256:ec29604081f10f16a7aea809ad42e27764188fc258b02259a03a8ff7ded3808d", | ||||||
|  |                 "sha256:edf31f1150778abd4322444c393ab9c7bd2af271dd4dafb4208fb613b1f3cdc9", | ||||||
|  |                 "sha256:f7e30c27477dffc3e85c2463b3e649f751789e0f6c8456099eea7ddd53be4a8a", | ||||||
|  |                 "sha256:ffe538682dc19cc542ae7c3e504fdf54ca7f86fb8a135e59dd6bc8627eae6cce" | ||||||
|  |             ], | ||||||
|  |             "index": "pypi", | ||||||
|  |             "version": "==7.2" | ||||||
|  |         }, | ||||||
|  |         "pygments": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:647344a061c249a3b74e230c739f434d7ea4d8b1d5f3721bc0f3558049b38f44", | ||||||
|  |                 "sha256:ff7a40b4860b727ab48fad6360eb351cc1b33cbf9b15a0f689ca5353e9463324" | ||||||
|  |             ], | ||||||
|  |             "index": "pypi", | ||||||
|  |             "version": "==2.6.1" | ||||||
|  |         }, | ||||||
|  |         "pyinstaller": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:3730fa80d088f8bb7084d32480eb87cbb4ddb64123363763cf8f2a1378c1c4b7" | ||||||
|  |             ], | ||||||
|  |             "index": "pypi", | ||||||
|  |             "version": "==3.6" | ||||||
|  |         }, | ||||||
|  |         "pyparsing": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1", | ||||||
|  |                 "sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b" | ||||||
|  |             ], | ||||||
|  |             "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2'", | ||||||
|  |             "version": "==2.4.7" | ||||||
|  |         }, | ||||||
|  |         "pywin32-ctypes": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:24ffc3b341d457d48e8922352130cf2644024a4ff09762a2261fd34c36ee5942", | ||||||
|  |                 "sha256:9dc2d991b3479cc2df15930958b674a48a227d5361d413827a4cfd0b5876fc98" | ||||||
|  |             ], | ||||||
|  |             "version": "==0.2.0" | ||||||
|  |         }, | ||||||
|  |         "requests": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:b3559a131db72c33ee969480840fff4bb6dd111de7dd27c8ee1f820f4f00231b", | ||||||
|  |                 "sha256:fe75cc94a9443b9246fc7049224f75604b113c36acb93f87b80ed42c44cbb898" | ||||||
|  |             ], | ||||||
|  |             "index": "pypi", | ||||||
|  |             "version": "==2.24.0" | ||||||
|  |         }, | ||||||
|  |         "urllib3": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:3018294ebefce6572a474f0604c2021e33b3fd8006ecd11d62107a5d2a963527", | ||||||
|  |                 "sha256:88206b0eb87e6d677d424843ac5209e3fb9d0190d0ee169599165ec25e9d9115" | ||||||
|  |             ], | ||||||
|  |             "index": "pypi", | ||||||
|  |             "version": "==1.25.9" | ||||||
|  |         }, | ||||||
|  |         "xlrd": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:546eb36cee8db40c3eaa46c351e67ffee6eeb5fa2650b71bc4c758a29a1b29b2", | ||||||
|  |                 "sha256:e551fb498759fa3a5384a94ccd4c3c02eb7c00ea424426e212ac0c57be9dfbde" | ||||||
|  |             ], | ||||||
|  |             "index": "pypi", | ||||||
|  |             "version": "==1.2.0" | ||||||
|         } |         } | ||||||
|     }, |     }, | ||||||
|     "develop": {} |     "develop": {} | ||||||
|   | |||||||
| @@ -1,2 +0,0 @@ | |||||||
| numpy==1.22.3 |  | ||||||
| pandas==1.4.2 |  | ||||||
| @@ -5,7 +5,6 @@ import {HttpClient} from '@actions/http-client'; | |||||||
| import * as ifm from '@actions/http-client/interfaces'; | import * as ifm from '@actions/http-client/interfaces'; | ||||||
| import * as tc from '@actions/tool-cache'; | import * as tc from '@actions/tool-cache'; | ||||||
| import * as exec from '@actions/exec'; | import * as exec from '@actions/exec'; | ||||||
| import * as core from '@actions/core'; |  | ||||||
|  |  | ||||||
| import * as path from 'path'; | import * as path from 'path'; | ||||||
| import * as semver from 'semver'; | import * as semver from 'semver'; | ||||||
| @@ -38,34 +37,16 @@ describe('parsePyPyVersion', () => { | |||||||
|     ['pypy-3.6-v7.x', {pythonVersion: '3.6', pypyVersion: 'v7.x'}], |     ['pypy-3.6-v7.x', {pythonVersion: '3.6', pypyVersion: 'v7.x'}], | ||||||
|     ['pypy-3.6', {pythonVersion: '3.6', pypyVersion: 'x'}], |     ['pypy-3.6', {pythonVersion: '3.6', pypyVersion: 'x'}], | ||||||
|     ['pypy-3.6-nightly', {pythonVersion: '3.6', pypyVersion: 'nightly'}], |     ['pypy-3.6-nightly', {pythonVersion: '3.6', pypyVersion: 'nightly'}], | ||||||
|     ['pypy-3.6-v7.3.3rc1', {pythonVersion: '3.6', pypyVersion: 'v7.3.3-rc.1'}], |     ['pypy-3.6-v7.3.3rc1', {pythonVersion: '3.6', pypyVersion: 'v7.3.3-rc.1'}] | ||||||
|     ['pypy3.8-v7.3.7', {pythonVersion: '3.8', pypyVersion: 'v7.3.7'}], |  | ||||||
|     ['pypy3.8-v7.3.x', {pythonVersion: '3.8', pypyVersion: 'v7.3.x'}], |  | ||||||
|     ['pypy3.8-v7.x', {pythonVersion: '3.8', pypyVersion: 'v7.x'}], |  | ||||||
|     ['pypy3.8', {pythonVersion: '3.8', pypyVersion: 'x'}], |  | ||||||
|     ['pypy3.9-nightly', {pythonVersion: '3.9', pypyVersion: 'nightly'}], |  | ||||||
|     ['pypy3.9-v7.3.8rc1', {pythonVersion: '3.9', pypyVersion: 'v7.3.8-rc.1'}] |  | ||||||
|   ])('%s -> %s', (input, expected) => { |   ])('%s -> %s', (input, expected) => { | ||||||
|     expect(finder.parsePyPyVersion(input)).toEqual(expected); |     expect(finder.parsePyPyVersion(input)).toEqual(expected); | ||||||
|   }); |   }); | ||||||
|  |  | ||||||
|   it.each(['', 'pypy-', 'pypy', 'p', 'notpypy-'])( |   it('throw on invalid input', () => { | ||||||
|     'throw on invalid input "%s"', |     expect(() => finder.parsePyPyVersion('pypy-')).toThrowError( | ||||||
|     input => { |       "Invalid 'version' property for PyPy. PyPy version should be specified as 'pypy-<python-version>'. See README for examples and documentation." | ||||||
|       expect(() => finder.parsePyPyVersion(input)).toThrowError( |  | ||||||
|         "Invalid 'version' property for PyPy. PyPy version should be specified as 'pypy<python-version>' or 'pypy-<python-version>'. See README for examples and documentation." |  | ||||||
|       ); |  | ||||||
|     } |  | ||||||
|   ); |  | ||||||
|  |  | ||||||
|   it.each(['pypy-2', 'pypy-3', 'pypy2', 'pypy3', 'pypy3.x', 'pypy3.8.10'])( |  | ||||||
|     'throw on invalid input "%s"', |  | ||||||
|     input => { |  | ||||||
|       expect(() => finder.parsePyPyVersion(input)).toThrowError( |  | ||||||
|         "Invalid format of Python version for PyPy. Python version should be specified in format 'x.y'. See README for examples and documentation." |  | ||||||
|       ); |  | ||||||
|     } |  | ||||||
|     ); |     ); | ||||||
|  |   }); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| describe('getPyPyVersionFromPath', () => { | describe('getPyPyVersionFromPath', () => { | ||||||
| @@ -149,13 +130,8 @@ describe('findPyPyVersion', () => { | |||||||
|   let spyWriteExactPyPyVersionFile: jest.SpyInstance; |   let spyWriteExactPyPyVersionFile: jest.SpyInstance; | ||||||
|   let spyCacheDir: jest.SpyInstance; |   let spyCacheDir: jest.SpyInstance; | ||||||
|   let spyChmodSync: jest.SpyInstance; |   let spyChmodSync: jest.SpyInstance; | ||||||
|   let spyCoreAddPath: jest.SpyInstance; |  | ||||||
|   let spyCoreExportVariable: jest.SpyInstance; |  | ||||||
|   const env = process.env; |  | ||||||
|  |  | ||||||
|   beforeEach(() => { |   beforeEach(() => { | ||||||
|     jest.resetModules(); |  | ||||||
|     process.env = {...env}; |  | ||||||
|     tcFind = jest.spyOn(tc, 'find'); |     tcFind = jest.spyOn(tc, 'find'); | ||||||
|     tcFind.mockImplementation((tool: string, version: string) => { |     tcFind.mockImplementation((tool: string, version: string) => { | ||||||
|       const semverRange = new semver.Range(version); |       const semverRange = new semver.Range(version); | ||||||
| @@ -207,46 +183,32 @@ describe('findPyPyVersion', () => { | |||||||
|  |  | ||||||
|     spyExistsSync = jest.spyOn(fs, 'existsSync'); |     spyExistsSync = jest.spyOn(fs, 'existsSync'); | ||||||
|     spyExistsSync.mockReturnValue(true); |     spyExistsSync.mockReturnValue(true); | ||||||
|  |  | ||||||
|     spyCoreAddPath = jest.spyOn(core, 'addPath'); |  | ||||||
|  |  | ||||||
|     spyCoreExportVariable = jest.spyOn(core, 'exportVariable'); |  | ||||||
|   }); |   }); | ||||||
|  |  | ||||||
|   afterEach(() => { |   afterEach(() => { | ||||||
|     jest.resetAllMocks(); |     jest.resetAllMocks(); | ||||||
|     jest.clearAllMocks(); |     jest.clearAllMocks(); | ||||||
|     jest.restoreAllMocks(); |     jest.restoreAllMocks(); | ||||||
|     process.env = env; |  | ||||||
|   }); |   }); | ||||||
|  |  | ||||||
|   it('found PyPy in toolcache', async () => { |   it('found PyPy in toolcache', async () => { | ||||||
|     await expect( |     await expect( | ||||||
|       finder.findPyPyVersion('pypy-3.6-v7.3.x', architecture, true) |       finder.findPyPyVersion('pypy-3.6-v7.3.x', architecture) | ||||||
|     ).resolves.toEqual({ |     ).resolves.toEqual({ | ||||||
|       resolvedPythonVersion: '3.6.12', |       resolvedPythonVersion: '3.6.12', | ||||||
|       resolvedPyPyVersion: '7.3.3' |       resolvedPyPyVersion: '7.3.3' | ||||||
|     }); |     }); | ||||||
|     expect(spyCoreAddPath).toHaveBeenCalled(); |  | ||||||
|     expect(spyCoreExportVariable).toHaveBeenCalledWith( |  | ||||||
|       'pythonLocation', |  | ||||||
|       expect.anything() |  | ||||||
|     ); |  | ||||||
|     expect(spyCoreExportVariable).toHaveBeenCalledWith( |  | ||||||
|       'PKG_CONFIG_PATH', |  | ||||||
|       expect.anything() |  | ||||||
|     ); |  | ||||||
|   }); |   }); | ||||||
|  |  | ||||||
|   it('throw on invalid input format', async () => { |   it('throw on invalid input format', async () => { | ||||||
|     await expect( |     await expect( | ||||||
|       finder.findPyPyVersion('pypy3.7-v7.3.x', architecture, true) |       finder.findPyPyVersion('pypy3.7-v7.3.x', architecture) | ||||||
|     ).rejects.toThrow(); |     ).rejects.toThrow(); | ||||||
|   }); |   }); | ||||||
|  |  | ||||||
|   it('throw on invalid input format pypy3.7-7.3.x', async () => { |   it('throw on invalid input format pypy3.7-7.3.x', async () => { | ||||||
|     await expect( |     await expect( | ||||||
|       finder.findPyPyVersion('pypy3.7-v7.3.x', architecture, true) |       finder.findPyPyVersion('pypy3.7-v7.3.x', architecture) | ||||||
|     ).rejects.toThrow(); |     ).rejects.toThrow(); | ||||||
|   }); |   }); | ||||||
|  |  | ||||||
| @@ -258,42 +220,16 @@ describe('findPyPyVersion', () => { | |||||||
|     spyChmodSync = jest.spyOn(fs, 'chmodSync'); |     spyChmodSync = jest.spyOn(fs, 'chmodSync'); | ||||||
|     spyChmodSync.mockImplementation(() => undefined); |     spyChmodSync.mockImplementation(() => undefined); | ||||||
|     await expect( |     await expect( | ||||||
|       finder.findPyPyVersion('pypy-3.7-v7.3.x', architecture, true) |       finder.findPyPyVersion('pypy-3.7-v7.3.x', architecture) | ||||||
|     ).resolves.toEqual({ |     ).resolves.toEqual({ | ||||||
|       resolvedPythonVersion: '3.7.9', |       resolvedPythonVersion: '3.7.9', | ||||||
|       resolvedPyPyVersion: '7.3.3' |       resolvedPyPyVersion: '7.3.3' | ||||||
|     }); |     }); | ||||||
|     expect(spyCoreAddPath).toHaveBeenCalled(); |  | ||||||
|     expect(spyCoreExportVariable).toHaveBeenCalledWith( |  | ||||||
|       'pythonLocation', |  | ||||||
|       expect.anything() |  | ||||||
|     ); |  | ||||||
|     expect(spyCoreExportVariable).toHaveBeenCalledWith( |  | ||||||
|       'PKG_CONFIG_PATH', |  | ||||||
|       expect.anything() |  | ||||||
|     ); |  | ||||||
|   }); |  | ||||||
|  |  | ||||||
|   it('found and install successfully without environment update', async () => { |  | ||||||
|     spyCacheDir = jest.spyOn(tc, 'cacheDir'); |  | ||||||
|     spyCacheDir.mockImplementation(() => |  | ||||||
|       path.join(toolDir, 'PyPy', '3.7.7', architecture) |  | ||||||
|     ); |  | ||||||
|     spyChmodSync = jest.spyOn(fs, 'chmodSync'); |  | ||||||
|     spyChmodSync.mockImplementation(() => undefined); |  | ||||||
|     await expect( |  | ||||||
|       finder.findPyPyVersion('pypy-3.7-v7.3.x', architecture, false) |  | ||||||
|     ).resolves.toEqual({ |  | ||||||
|       resolvedPythonVersion: '3.7.9', |  | ||||||
|       resolvedPyPyVersion: '7.3.3' |  | ||||||
|     }); |  | ||||||
|     expect(spyCoreAddPath).not.toHaveBeenCalled(); |  | ||||||
|     expect(spyCoreExportVariable).not.toHaveBeenCalled(); |  | ||||||
|   }); |   }); | ||||||
|  |  | ||||||
|   it('throw if release is not found', async () => { |   it('throw if release is not found', async () => { | ||||||
|     await expect( |     await expect( | ||||||
|       finder.findPyPyVersion('pypy-3.7-v7.5.x', architecture, true) |       finder.findPyPyVersion('pypy-3.7-v7.5.x', architecture) | ||||||
|     ).rejects.toThrowError( |     ).rejects.toThrowError( | ||||||
|       `PyPy version 3.7 (v7.5.x) with arch ${architecture} not found` |       `PyPy version 3.7 (v7.5.x) with arch ${architecture} not found` | ||||||
|     ); |     ); | ||||||
|   | |||||||
| @@ -19,29 +19,15 @@ process.env['RUNNER_TOOL_CACHE'] = toolDir; | |||||||
| process.env['RUNNER_TEMP'] = tempDir; | process.env['RUNNER_TEMP'] = tempDir; | ||||||
|  |  | ||||||
| import * as tc from '@actions/tool-cache'; | import * as tc from '@actions/tool-cache'; | ||||||
| import * as core from '@actions/core'; |  | ||||||
| import * as finder from '../src/find-python'; | import * as finder from '../src/find-python'; | ||||||
| import * as installer from '../src/install-python'; | import * as installer from '../src/install-python'; | ||||||
|  |  | ||||||
| const manifestData = require('./data/versions-manifest.json'); | const manifestData = require('./data/versions-manifest.json'); | ||||||
|  |  | ||||||
| describe('Finder tests', () => { | describe('Finder tests', () => { | ||||||
|   let spyCoreAddPath: jest.SpyInstance; |  | ||||||
|   let spyCoreExportVariable: jest.SpyInstance; |  | ||||||
|   const env = process.env; |  | ||||||
|  |  | ||||||
|   beforeEach(() => { |  | ||||||
|     jest.resetModules(); |  | ||||||
|     process.env = {...env}; |  | ||||||
|     spyCoreAddPath = jest.spyOn(core, 'addPath'); |  | ||||||
|     spyCoreExportVariable = jest.spyOn(core, 'exportVariable'); |  | ||||||
|   }); |  | ||||||
|  |  | ||||||
|   afterEach(() => { |   afterEach(() => { | ||||||
|     jest.resetAllMocks(); |     jest.resetAllMocks(); | ||||||
|     jest.clearAllMocks(); |     jest.clearAllMocks(); | ||||||
|     jest.restoreAllMocks(); |  | ||||||
|     process.env = env; |  | ||||||
|   }); |   }); | ||||||
|  |  | ||||||
|   it('Finds Python if it is installed', async () => { |   it('Finds Python if it is installed', async () => { | ||||||
| @@ -49,26 +35,7 @@ describe('Finder tests', () => { | |||||||
|     await io.mkdirP(pythonDir); |     await io.mkdirP(pythonDir); | ||||||
|     fs.writeFileSync(`${pythonDir}.complete`, 'hello'); |     fs.writeFileSync(`${pythonDir}.complete`, 'hello'); | ||||||
|     // This will throw if it doesn't find it in the cache and in the manifest (because no such version exists) |     // This will throw if it doesn't find it in the cache and in the manifest (because no such version exists) | ||||||
|     await finder.useCpythonVersion('3.x', 'x64', true); |     await finder.useCpythonVersion('3.x', 'x64'); | ||||||
|     expect(spyCoreAddPath).toHaveBeenCalled(); |  | ||||||
|     expect(spyCoreExportVariable).toHaveBeenCalledWith( |  | ||||||
|       'pythonLocation', |  | ||||||
|       expect.anything() |  | ||||||
|     ); |  | ||||||
|     expect(spyCoreExportVariable).toHaveBeenCalledWith( |  | ||||||
|       'PKG_CONFIG_PATH', |  | ||||||
|       expect.anything() |  | ||||||
|     ); |  | ||||||
|   }); |  | ||||||
|  |  | ||||||
|   it('Finds Python if it is installed without environment update', async () => { |  | ||||||
|     const pythonDir: string = path.join(toolDir, 'Python', '3.0.0', 'x64'); |  | ||||||
|     await io.mkdirP(pythonDir); |  | ||||||
|     fs.writeFileSync(`${pythonDir}.complete`, 'hello'); |  | ||||||
|     // This will throw if it doesn't find it in the cache and in the manifest (because no such version exists) |  | ||||||
|     await finder.useCpythonVersion('3.x', 'x64', false); |  | ||||||
|     expect(spyCoreAddPath).not.toHaveBeenCalled(); |  | ||||||
|     expect(spyCoreExportVariable).not.toHaveBeenCalled(); |  | ||||||
|   }); |   }); | ||||||
|  |  | ||||||
|   it('Finds stable Python version if it is not installed, but exists in the manifest', async () => { |   it('Finds stable Python version if it is not installed, but exists in the manifest', async () => { | ||||||
| @@ -85,16 +52,7 @@ describe('Finder tests', () => { | |||||||
|       fs.writeFileSync(`${pythonDir}.complete`, 'hello'); |       fs.writeFileSync(`${pythonDir}.complete`, 'hello'); | ||||||
|     }); |     }); | ||||||
|     // This will throw if it doesn't find it in the cache and in the manifest (because no such version exists) |     // This will throw if it doesn't find it in the cache and in the manifest (because no such version exists) | ||||||
|     await finder.useCpythonVersion('1.2.3', 'x64', true); |     await finder.useCpythonVersion('1.2.3', 'x64'); | ||||||
|     expect(spyCoreAddPath).toHaveBeenCalled(); |  | ||||||
|     expect(spyCoreExportVariable).toHaveBeenCalledWith( |  | ||||||
|       'pythonLocation', |  | ||||||
|       expect.anything() |  | ||||||
|     ); |  | ||||||
|     expect(spyCoreExportVariable).toHaveBeenCalledWith( |  | ||||||
|       'PKG_CONFIG_PATH', |  | ||||||
|       expect.anything() |  | ||||||
|     ); |  | ||||||
|   }); |   }); | ||||||
|  |  | ||||||
|   it('Finds pre-release Python version in the manifest', async () => { |   it('Finds pre-release Python version in the manifest', async () => { | ||||||
| @@ -116,28 +74,17 @@ describe('Finder tests', () => { | |||||||
|       fs.writeFileSync(`${pythonDir}.complete`, 'hello'); |       fs.writeFileSync(`${pythonDir}.complete`, 'hello'); | ||||||
|     }); |     }); | ||||||
|     // This will throw if it doesn't find it in the manifest (because no such version exists) |     // This will throw if it doesn't find it in the manifest (because no such version exists) | ||||||
|     await finder.useCpythonVersion('1.2.3-beta.2', 'x64', true); |     await finder.useCpythonVersion('1.2.3-beta.2', 'x64'); | ||||||
|     expect(spyCoreAddPath).toHaveBeenCalled(); |  | ||||||
|     expect(spyCoreExportVariable).toHaveBeenCalledWith( |  | ||||||
|       'pythonLocation', |  | ||||||
|       expect.anything() |  | ||||||
|     ); |  | ||||||
|     expect(spyCoreExportVariable).toHaveBeenCalledWith( |  | ||||||
|       'PKG_CONFIG_PATH', |  | ||||||
|       expect.anything() |  | ||||||
|     ); |  | ||||||
|   }); |   }); | ||||||
|  |  | ||||||
|   it('Errors if Python is not installed', async () => { |   it('Errors if Python is not installed', async () => { | ||||||
|     // This will throw if it doesn't find it in the cache and in the manifest (because no such version exists) |     // This will throw if it doesn't find it in the cache and in the manifest (because no such version exists) | ||||||
|     let thrown = false; |     let thrown = false; | ||||||
|     try { |     try { | ||||||
|       await finder.useCpythonVersion('3.300000', 'x64', true); |       await finder.useCpythonVersion('3.300000', 'x64'); | ||||||
|     } catch { |     } catch { | ||||||
|       thrown = true; |       thrown = true; | ||||||
|     } |     } | ||||||
|     expect(thrown).toBeTruthy(); |     expect(thrown).toBeTruthy(); | ||||||
|     expect(spyCoreAddPath).not.toHaveBeenCalled(); |  | ||||||
|     expect(spyCoreExportVariable).not.toHaveBeenCalled(); |  | ||||||
|   }); |   }); | ||||||
| }); | }); | ||||||
|   | |||||||
							
								
								
									
										12
									
								
								action.yml
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								action.yml
									
									
									
									
									
								
							| @@ -4,9 +4,8 @@ description: 'Set up a specific version of Python and add the command-line tools | |||||||
| author: 'GitHub' | author: 'GitHub' | ||||||
| inputs: | inputs: | ||||||
|   python-version: |   python-version: | ||||||
|     description: "Version range or exact version of Python to use, using SemVer's version range syntax. Reads from .python-version if unset." |     description: "Version range or exact version of a Python version to use, using SemVer's version range syntax." | ||||||
|   python-version-file: |     default: '3.x' | ||||||
|     description: "File containing the Python version to use. Example: .python-version" |  | ||||||
|   cache: |   cache: | ||||||
|     description: 'Used to specify a package manager for caching in the default directory. Supported values: pip, pipenv, poetry.' |     description: 'Used to specify a package manager for caching in the default directory. Supported values: pip, pipenv, poetry.' | ||||||
|     required: false |     required: false | ||||||
| @@ -17,16 +16,9 @@ inputs: | |||||||
|     default: ${{ github.token }} |     default: ${{ github.token }} | ||||||
|   cache-dependency-path: |   cache-dependency-path: | ||||||
|     description: 'Used to specify the path to dependency files. Supports wildcards or a list of file names for caching multiple dependencies.' |     description: 'Used to specify the path to dependency files. Supports wildcards or a list of file names for caching multiple dependencies.' | ||||||
|   update-environment: |  | ||||||
|     description: 'Set this option if you want the action to update environment variables.' |  | ||||||
|     default: true |  | ||||||
| outputs: | outputs: | ||||||
|   python-version: |   python-version: | ||||||
|     description: "The installed python version. Useful when given a version range as input." |     description: "The installed python version. Useful when given a version range as input." | ||||||
|   cache-hit: |  | ||||||
|     description: 'A boolean value to indicate a cache entry was found' |  | ||||||
|   python-path: |  | ||||||
|     description: "The absolute path to the Python executable." |  | ||||||
| runs: | runs: | ||||||
|   using: 'node16' |   using: 'node16' | ||||||
|   main: 'dist/setup/index.js' |   main: 'dist/setup/index.js' | ||||||
|   | |||||||
							
								
								
									
										52647
									
								
								dist/cache-save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										52647
									
								
								dist/cache-save/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										65237
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										65237
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -45,8 +45,8 @@ We won't pursue the goal to provide wide customization of caching in the scope o | |||||||
|  |  | ||||||
| ``` | ``` | ||||||
| steps: | steps: | ||||||
| - uses: actions/checkout@v3 | - uses: actions/checkout@v2 | ||||||
| - uses: actions/setup-python@v4 | - uses: actions/setup-python@v2 | ||||||
|   with: |   with: | ||||||
|     python-version: 3.9 |     python-version: 3.9 | ||||||
|     cache: pip |     cache: pip | ||||||
| @@ -56,8 +56,8 @@ steps: | |||||||
|  |  | ||||||
| ``` | ``` | ||||||
| steps: | steps: | ||||||
| - uses: actions/checkout@v3 | - uses: actions/checkout@v2 | ||||||
| - uses: actions/setup-python@v4 | - uses: actions/setup-python@v2 | ||||||
|   with: |   with: | ||||||
|     python-version: 3.9 |     python-version: 3.9 | ||||||
|     cache: pipenv |     cache: pipenv | ||||||
| @@ -66,8 +66,8 @@ steps: | |||||||
|  |  | ||||||
| ``` | ``` | ||||||
| steps: | steps: | ||||||
| - uses: actions/checkout@v3 | - uses: actions/checkout@v2 | ||||||
| - uses: actions/setup-python@v4 | - uses: actions/setup-python@v2 | ||||||
|   with: |   with: | ||||||
|     python-version: 3.9 |     python-version: 3.9 | ||||||
|     cache: pip |     cache: pip | ||||||
| @@ -80,8 +80,8 @@ steps: | |||||||
|  |  | ||||||
| ``` | ``` | ||||||
| steps: | steps: | ||||||
| - uses: actions/checkout@v3 | - uses: actions/checkout@v2 | ||||||
| - uses: actions/setup-python@v4 | - uses: actions/setup-python@v2 | ||||||
|   with: |   with: | ||||||
|     python-version: 3.9 |     python-version: 3.9 | ||||||
|     cache: pip |     cache: pip | ||||||
|   | |||||||
							
								
								
									
										89
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										89
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @@ -1,16 +1,16 @@ | |||||||
| { | { | ||||||
|   "name": "setup-python", |   "name": "setup-python", | ||||||
|   "version": "4.0.0", |   "version": "3.1.0", | ||||||
|   "lockfileVersion": 2, |   "lockfileVersion": 2, | ||||||
|   "requires": true, |   "requires": true, | ||||||
|   "packages": { |   "packages": { | ||||||
|     "": { |     "": { | ||||||
|       "name": "setup-python", |       "name": "setup-python", | ||||||
|       "version": "4.0.0", |       "version": "3.1.0", | ||||||
|       "license": "MIT", |       "license": "MIT", | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "@actions/cache": "^3.0.0", |         "@actions/cache": "^2.0.0", | ||||||
|         "@actions/core": "^1.7.0", |         "@actions/core": "^1.2.3", | ||||||
|         "@actions/exec": "^1.1.0", |         "@actions/exec": "^1.1.0", | ||||||
|         "@actions/glob": "^0.2.0", |         "@actions/glob": "^0.2.0", | ||||||
|         "@actions/io": "^1.0.2", |         "@actions/io": "^1.0.2", | ||||||
| @@ -21,7 +21,7 @@ | |||||||
|         "@types/jest": "^27.0.2", |         "@types/jest": "^27.0.2", | ||||||
|         "@types/node": "^16.11.25", |         "@types/node": "^16.11.25", | ||||||
|         "@types/semver": "^7.1.0", |         "@types/semver": "^7.1.0", | ||||||
|         "@vercel/ncc": "^0.33.4", |         "@zeit/ncc": "^0.22.0", | ||||||
|         "husky": "^7.0.2", |         "husky": "^7.0.2", | ||||||
|         "jest": "^27.2.5", |         "jest": "^27.2.5", | ||||||
|         "jest-circus": "^27.2.5", |         "jest-circus": "^27.2.5", | ||||||
| @@ -31,14 +31,14 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/@actions/cache": { |     "node_modules/@actions/cache": { | ||||||
|       "version": "3.0.0", |       "version": "2.0.0", | ||||||
|       "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.0.0.tgz", |       "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-2.0.0.tgz", | ||||||
|       "integrity": "sha512-GL9CT1Fnu+pqs8TTB621q8Xa8Cilw2n9MwvbgMedetH7L1q2n6jY61gzbwGbKgtVbp3gVJ12aNMi4osSGXx3KQ==", |       "integrity": "sha512-d7n8ul6HjWX6oDrNEPoqn8ZvqyyDhp9Uek6WOxALyxGVsXU+8+ND+viD3UfrXVWfs/GQiqI5Eq4cOozZj0yRFQ==", | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "@actions/core": "^1.2.6", |         "@actions/core": "^1.2.6", | ||||||
|         "@actions/exec": "^1.0.1", |         "@actions/exec": "^1.0.1", | ||||||
|         "@actions/glob": "^0.1.0", |         "@actions/glob": "^0.1.0", | ||||||
|         "@actions/http-client": "^2.0.1", |         "@actions/http-client": "^1.0.9", | ||||||
|         "@actions/io": "^1.0.1", |         "@actions/io": "^1.0.1", | ||||||
|         "@azure/ms-rest-js": "^2.6.0", |         "@azure/ms-rest-js": "^2.6.0", | ||||||
|         "@azure/storage-blob": "^12.8.0", |         "@azure/storage-blob": "^12.8.0", | ||||||
| @@ -56,11 +56,11 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/@actions/cache/node_modules/@actions/http-client": { |     "node_modules/@actions/cache/node_modules/@actions/http-client": { | ||||||
|       "version": "2.0.1", |       "version": "1.0.11", | ||||||
|       "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz", |       "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz", | ||||||
|       "integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==", |       "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==", | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "tunnel": "^0.0.6" |         "tunnel": "0.0.6" | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/@actions/cache/node_modules/semver": { |     "node_modules/@actions/cache/node_modules/semver": { | ||||||
| @@ -72,12 +72,9 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/@actions/core": { |     "node_modules/@actions/core": { | ||||||
|       "version": "1.7.0", |       "version": "1.2.6", | ||||||
|       "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.7.0.tgz", |       "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz", | ||||||
|       "integrity": "sha512-7fPSS7yKOhTpgLMbw7lBLc1QJWvJBBAgyTX2PEhagWcKK8t0H8AKCoPMfnrHqIm5cRYH4QFPqD1/ruhuUE7YcQ==", |       "integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA==" | ||||||
|       "dependencies": { |  | ||||||
|         "@actions/http-client": "^1.0.11" |  | ||||||
|       } |  | ||||||
|     }, |     }, | ||||||
|     "node_modules/@actions/exec": { |     "node_modules/@actions/exec": { | ||||||
|       "version": "1.1.0", |       "version": "1.1.0", | ||||||
| @@ -97,9 +94,9 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/@actions/http-client": { |     "node_modules/@actions/http-client": { | ||||||
|       "version": "1.0.11", |       "version": "1.0.8", | ||||||
|       "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz", |       "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.8.tgz", | ||||||
|       "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==", |       "integrity": "sha512-G4JjJ6f9Hb3Zvejj+ewLLKLf99ZC+9v+yCxoYf9vSyH+WkzPLB2LuUtRMGNkooMqdugGBFStIKXOuvH1W+EctA==", | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "tunnel": "0.0.6" |         "tunnel": "0.0.6" | ||||||
|       } |       } | ||||||
| @@ -3926,10 +3923,11 @@ | |||||||
|       "integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==", |       "integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==", | ||||||
|       "dev": true |       "dev": true | ||||||
|     }, |     }, | ||||||
|     "node_modules/@vercel/ncc": { |     "node_modules/@zeit/ncc": { | ||||||
|       "version": "0.33.4", |       "version": "0.22.0", | ||||||
|       "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.33.4.tgz", |       "resolved": "https://registry.npmjs.org/@zeit/ncc/-/ncc-0.22.0.tgz", | ||||||
|       "integrity": "sha512-ln18hs7dMffelP47tpkaR+V5Tj6coykNyxJrlcmCormPqRQjB/Gv4cu2FfBG+PMzIfdZp2CLDsrrB1NPU22Qhg==", |       "integrity": "sha512-zaS6chwztGSLSEzsTJw9sLTYxQt57bPFBtsYlVtbqGvmDUsfW7xgXPYofzFa1kB9ur2dRop6IxCwPnWLBVCrbQ==", | ||||||
|  |       "deprecated": "@zeit/ncc is no longer maintained. Please use @vercel/ncc instead.", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "bin": { |       "bin": { | ||||||
|         "ncc": "dist/ncc/cli.js" |         "ncc": "dist/ncc/cli.js" | ||||||
| @@ -11340,14 +11338,14 @@ | |||||||
|   }, |   }, | ||||||
|   "dependencies": { |   "dependencies": { | ||||||
|     "@actions/cache": { |     "@actions/cache": { | ||||||
|       "version": "3.0.0", |       "version": "2.0.0", | ||||||
|       "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.0.0.tgz", |       "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-2.0.0.tgz", | ||||||
|       "integrity": "sha512-GL9CT1Fnu+pqs8TTB621q8Xa8Cilw2n9MwvbgMedetH7L1q2n6jY61gzbwGbKgtVbp3gVJ12aNMi4osSGXx3KQ==", |       "integrity": "sha512-d7n8ul6HjWX6oDrNEPoqn8ZvqyyDhp9Uek6WOxALyxGVsXU+8+ND+viD3UfrXVWfs/GQiqI5Eq4cOozZj0yRFQ==", | ||||||
|       "requires": { |       "requires": { | ||||||
|         "@actions/core": "^1.2.6", |         "@actions/core": "^1.2.6", | ||||||
|         "@actions/exec": "^1.0.1", |         "@actions/exec": "^1.0.1", | ||||||
|         "@actions/glob": "^0.1.0", |         "@actions/glob": "^0.1.0", | ||||||
|         "@actions/http-client": "^2.0.1", |         "@actions/http-client": "^1.0.9", | ||||||
|         "@actions/io": "^1.0.1", |         "@actions/io": "^1.0.1", | ||||||
|         "@azure/ms-rest-js": "^2.6.0", |         "@azure/ms-rest-js": "^2.6.0", | ||||||
|         "@azure/storage-blob": "^12.8.0", |         "@azure/storage-blob": "^12.8.0", | ||||||
| @@ -11365,11 +11363,11 @@ | |||||||
|           } |           } | ||||||
|         }, |         }, | ||||||
|         "@actions/http-client": { |         "@actions/http-client": { | ||||||
|           "version": "2.0.1", |           "version": "1.0.11", | ||||||
|           "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz", |           "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz", | ||||||
|           "integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==", |           "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==", | ||||||
|           "requires": { |           "requires": { | ||||||
|             "tunnel": "^0.0.6" |             "tunnel": "0.0.6" | ||||||
|           } |           } | ||||||
|         }, |         }, | ||||||
|         "semver": { |         "semver": { | ||||||
| @@ -11380,12 +11378,9 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "@actions/core": { |     "@actions/core": { | ||||||
|       "version": "1.7.0", |       "version": "1.2.6", | ||||||
|       "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.7.0.tgz", |       "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz", | ||||||
|       "integrity": "sha512-7fPSS7yKOhTpgLMbw7lBLc1QJWvJBBAgyTX2PEhagWcKK8t0H8AKCoPMfnrHqIm5cRYH4QFPqD1/ruhuUE7YcQ==", |       "integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA==" | ||||||
|       "requires": { |  | ||||||
|         "@actions/http-client": "^1.0.11" |  | ||||||
|       } |  | ||||||
|     }, |     }, | ||||||
|     "@actions/exec": { |     "@actions/exec": { | ||||||
|       "version": "1.1.0", |       "version": "1.1.0", | ||||||
| @@ -11405,9 +11400,9 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "@actions/http-client": { |     "@actions/http-client": { | ||||||
|       "version": "1.0.11", |       "version": "1.0.8", | ||||||
|       "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz", |       "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.8.tgz", | ||||||
|       "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==", |       "integrity": "sha512-G4JjJ6f9Hb3Zvejj+ewLLKLf99ZC+9v+yCxoYf9vSyH+WkzPLB2LuUtRMGNkooMqdugGBFStIKXOuvH1W+EctA==", | ||||||
|       "requires": { |       "requires": { | ||||||
|         "tunnel": "0.0.6" |         "tunnel": "0.0.6" | ||||||
|       } |       } | ||||||
| @@ -14517,10 +14512,10 @@ | |||||||
|       "integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==", |       "integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==", | ||||||
|       "dev": true |       "dev": true | ||||||
|     }, |     }, | ||||||
|     "@vercel/ncc": { |     "@zeit/ncc": { | ||||||
|       "version": "0.33.4", |       "version": "0.22.0", | ||||||
|       "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.33.4.tgz", |       "resolved": "https://registry.npmjs.org/@zeit/ncc/-/ncc-0.22.0.tgz", | ||||||
|       "integrity": "sha512-ln18hs7dMffelP47tpkaR+V5Tj6coykNyxJrlcmCormPqRQjB/Gv4cu2FfBG+PMzIfdZp2CLDsrrB1NPU22Qhg==", |       "integrity": "sha512-zaS6chwztGSLSEzsTJw9sLTYxQt57bPFBtsYlVtbqGvmDUsfW7xgXPYofzFa1kB9ur2dRop6IxCwPnWLBVCrbQ==", | ||||||
|       "dev": true |       "dev": true | ||||||
|     }, |     }, | ||||||
|     "abab": { |     "abab": { | ||||||
|   | |||||||
							
								
								
									
										10
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								package.json
									
									
									
									
									
								
							| @@ -1,6 +1,6 @@ | |||||||
| { | { | ||||||
|   "name": "setup-python", |   "name": "setup-python", | ||||||
|   "version": "4.0.0", |   "version": "3.1.0", | ||||||
|   "private": true, |   "private": true, | ||||||
|   "description": "Setup python action", |   "description": "Setup python action", | ||||||
|   "main": "dist/index.js", |   "main": "dist/index.js", | ||||||
| @@ -9,7 +9,7 @@ | |||||||
|     "format": "prettier --write \"{,!(node_modules)/**/}*.ts\"", |     "format": "prettier --write \"{,!(node_modules)/**/}*.ts\"", | ||||||
|     "format-check": "prettier --check \"{,!(node_modules)/**/}*.ts\"", |     "format-check": "prettier --check \"{,!(node_modules)/**/}*.ts\"", | ||||||
|     "release": "ncc build -o dist/setup src/setup-python.ts && ncc build -o dist/cache-save src/cache-save.ts && git add -f dist/", |     "release": "ncc build -o dist/setup src/setup-python.ts && ncc build -o dist/cache-save src/cache-save.ts && git add -f dist/", | ||||||
|     "test": "jest --coverage" |     "test": "jest" | ||||||
|   }, |   }, | ||||||
|   "repository": { |   "repository": { | ||||||
|     "type": "git", |     "type": "git", | ||||||
| @@ -23,8 +23,8 @@ | |||||||
|   "author": "GitHub", |   "author": "GitHub", | ||||||
|   "license": "MIT", |   "license": "MIT", | ||||||
|   "dependencies": { |   "dependencies": { | ||||||
|     "@actions/cache": "^3.0.0", |     "@actions/cache": "^2.0.0", | ||||||
|     "@actions/core": "^1.7.0", |     "@actions/core": "^1.2.3", | ||||||
|     "@actions/exec": "^1.1.0", |     "@actions/exec": "^1.1.0", | ||||||
|     "@actions/glob": "^0.2.0", |     "@actions/glob": "^0.2.0", | ||||||
|     "@actions/io": "^1.0.2", |     "@actions/io": "^1.0.2", | ||||||
| @@ -35,7 +35,7 @@ | |||||||
|     "@types/jest": "^27.0.2", |     "@types/jest": "^27.0.2", | ||||||
|     "@types/node": "^16.11.25", |     "@types/node": "^16.11.25", | ||||||
|     "@types/semver": "^7.1.0", |     "@types/semver": "^7.1.0", | ||||||
|     "@vercel/ncc": "^0.33.4", |     "@zeit/ncc": "^0.22.0", | ||||||
|     "husky": "^7.0.2", |     "husky": "^7.0.2", | ||||||
|     "jest": "^27.2.5", |     "jest": "^27.2.5", | ||||||
|     "jest-circus": "^27.2.5", |     "jest-circus": "^27.2.5", | ||||||
|   | |||||||
| @@ -41,17 +41,12 @@ abstract class CacheDistributor { | |||||||
|       restoreKey |       restoreKey | ||||||
|     ); |     ); | ||||||
|  |  | ||||||
|     this.handleMatchResult(matchedKey, primaryKey); |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   public handleMatchResult(matchedKey: string | undefined, primaryKey: string) { |  | ||||||
|     if (matchedKey) { |     if (matchedKey) { | ||||||
|       core.saveState(State.CACHE_MATCHED_KEY, matchedKey); |       core.saveState(State.CACHE_MATCHED_KEY, matchedKey); | ||||||
|       core.info(`Cache restored from key: ${matchedKey}`); |       core.info(`Cache restored from key: ${matchedKey}`); | ||||||
|     } else { |     } else { | ||||||
|       core.info(`${this.packageManager} cache is not found`); |       core.info(`${this.packageManager} cache is not found`); | ||||||
|     } |     } | ||||||
|     core.setOutput('cache-hit', matchedKey === primaryKey); |  | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -58,7 +58,7 @@ class PoetryCache extends CacheDistributor { | |||||||
|     const config: any = {}; |     const config: any = {}; | ||||||
|  |  | ||||||
|     for (let line of lines) { |     for (let line of lines) { | ||||||
|       line = line.replace(/#.*$/gm, ''); |       line = line.replace(/#.*$/, ''); | ||||||
|  |  | ||||||
|       const [key, value] = line.split('=').map(part => part.trim()); |       const [key, value] = line.split('=').map(part => part.trim()); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -43,11 +43,17 @@ async function saveCache(packageManager: string) { | |||||||
|     return; |     return; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   const cacheId = await cache.saveCache(cachePaths, primaryKey); |   try { | ||||||
|   if (cacheId == -1) { |     await cache.saveCache(cachePaths, primaryKey); | ||||||
|     return; |  | ||||||
|   } |  | ||||||
|     core.info(`Cache saved with the key: ${primaryKey}`); |     core.info(`Cache saved with the key: ${primaryKey}`); | ||||||
|  |   } catch (error) { | ||||||
|  |     const err = error as Error; | ||||||
|  |     if (err.name === cache.ReserveCacheError.name) { | ||||||
|  |       core.info(err.message); | ||||||
|  |     } else { | ||||||
|  |       throw error; | ||||||
|  |     } | ||||||
|  |   } | ||||||
| } | } | ||||||
|  |  | ||||||
| function isCacheDirectoryExists(cacheDirectory: string[]) { | function isCacheDirectoryExists(cacheDirectory: string[]) { | ||||||
|   | |||||||
| @@ -20,8 +20,7 @@ interface IPyPyVersionSpec { | |||||||
|  |  | ||||||
| export async function findPyPyVersion( | export async function findPyPyVersion( | ||||||
|   versionSpec: string, |   versionSpec: string, | ||||||
|   architecture: string, |   architecture: string | ||||||
|   updateEnvironment: boolean |  | ||||||
| ): Promise<{resolvedPyPyVersion: string; resolvedPythonVersion: string}> { | ): Promise<{resolvedPyPyVersion: string; resolvedPythonVersion: string}> { | ||||||
|   let resolvedPyPyVersion = ''; |   let resolvedPyPyVersion = ''; | ||||||
|   let resolvedPythonVersion = ''; |   let resolvedPythonVersion = ''; | ||||||
| @@ -49,26 +48,10 @@ export async function findPyPyVersion( | |||||||
|  |  | ||||||
|   const pipDir = IS_WINDOWS ? 'Scripts' : 'bin'; |   const pipDir = IS_WINDOWS ? 'Scripts' : 'bin'; | ||||||
|   const _binDir = path.join(installDir, pipDir); |   const _binDir = path.join(installDir, pipDir); | ||||||
|   const binaryExtension = IS_WINDOWS ? '.exe' : ''; |  | ||||||
|   const pythonPath = path.join( |  | ||||||
|     IS_WINDOWS ? installDir : _binDir, |  | ||||||
|     `python${binaryExtension}` |  | ||||||
|   ); |  | ||||||
|   const pythonLocation = pypyInstall.getPyPyBinaryPath(installDir); |   const pythonLocation = pypyInstall.getPyPyBinaryPath(installDir); | ||||||
|   if (updateEnvironment) { |   core.exportVariable('pythonLocation', pythonLocation); | ||||||
|     core.exportVariable('pythonLocation', installDir); |  | ||||||
|     // https://cmake.org/cmake/help/latest/module/FindPython.html#module:FindPython |  | ||||||
|     core.exportVariable('Python_ROOT_DIR', installDir); |  | ||||||
|     // https://cmake.org/cmake/help/latest/module/FindPython2.html#module:FindPython2 |  | ||||||
|     core.exportVariable('Python2_ROOT_DIR', installDir); |  | ||||||
|     // https://cmake.org/cmake/help/latest/module/FindPython3.html#module:FindPython3 |  | ||||||
|     core.exportVariable('Python3_ROOT_DIR', installDir); |  | ||||||
|     core.exportVariable('PKG_CONFIG_PATH', pythonLocation + '/lib/pkgconfig'); |  | ||||||
|   core.addPath(pythonLocation); |   core.addPath(pythonLocation); | ||||||
|   core.addPath(_binDir); |   core.addPath(_binDir); | ||||||
|   } |  | ||||||
|   core.setOutput('python-version', 'pypy' + resolvedPyPyVersion.trim()); |  | ||||||
|   core.setOutput('python-path', pythonPath); |  | ||||||
|  |  | ||||||
|   return {resolvedPyPyVersion, resolvedPythonVersion}; |   return {resolvedPyPyVersion, resolvedPythonVersion}; | ||||||
| } | } | ||||||
| @@ -113,14 +96,9 @@ export function findPyPyToolCache( | |||||||
| export function parsePyPyVersion(versionSpec: string): IPyPyVersionSpec { | export function parsePyPyVersion(versionSpec: string): IPyPyVersionSpec { | ||||||
|   const versions = versionSpec.split('-').filter(item => !!item); |   const versions = versionSpec.split('-').filter(item => !!item); | ||||||
|  |  | ||||||
|   if (/^(pypy)(.+)/.test(versions[0])) { |  | ||||||
|     let pythonVersion = versions[0].replace('pypy', ''); |  | ||||||
|     versions.splice(0, 1, 'pypy', pythonVersion); |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   if (versions.length < 2 || versions[0] != 'pypy') { |   if (versions.length < 2 || versions[0] != 'pypy') { | ||||||
|     throw new Error( |     throw new Error( | ||||||
|       "Invalid 'version' property for PyPy. PyPy version should be specified as 'pypy<python-version>' or 'pypy-<python-version>'. See README for examples and documentation." |       "Invalid 'version' property for PyPy. PyPy version should be specified as 'pypy-<python-version>'. See README for examples and documentation." | ||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -32,8 +32,7 @@ function binDir(installDir: string): string { | |||||||
|  |  | ||||||
| export async function useCpythonVersion( | export async function useCpythonVersion( | ||||||
|   version: string, |   version: string, | ||||||
|   architecture: string, |   architecture: string | ||||||
|   updateEnvironment: boolean |  | ||||||
| ): Promise<InstalledVersion> { | ): Promise<InstalledVersion> { | ||||||
|   const desugaredVersionSpec = desugarDevVersion(version); |   const desugaredVersionSpec = desugarDevVersion(version); | ||||||
|   const semanticVersionSpec = pythonVersionToSemantic(desugaredVersionSpec); |   const semanticVersionSpec = pythonVersionToSemantic(desugaredVersionSpec); | ||||||
| @@ -70,23 +69,7 @@ export async function useCpythonVersion( | |||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   const _binDir = binDir(installDir); |  | ||||||
|   const binaryExtension = IS_WINDOWS ? '.exe' : ''; |  | ||||||
|   const pythonPath = path.join( |  | ||||||
|     IS_WINDOWS ? installDir : _binDir, |  | ||||||
|     `python${binaryExtension}` |  | ||||||
|   ); |  | ||||||
|   if (updateEnvironment) { |  | ||||||
|   core.exportVariable('pythonLocation', installDir); |   core.exportVariable('pythonLocation', installDir); | ||||||
|     core.exportVariable('PKG_CONFIG_PATH', installDir + '/lib/pkgconfig'); |  | ||||||
|     core.exportVariable('pythonLocation', installDir); |  | ||||||
|     // https://cmake.org/cmake/help/latest/module/FindPython.html#module:FindPython |  | ||||||
|     core.exportVariable('Python_ROOT_DIR', installDir); |  | ||||||
|     // https://cmake.org/cmake/help/latest/module/FindPython2.html#module:FindPython2 |  | ||||||
|     core.exportVariable('Python2_ROOT_DIR', installDir); |  | ||||||
|     // https://cmake.org/cmake/help/latest/module/FindPython3.html#module:FindPython3 |  | ||||||
|     core.exportVariable('Python3_ROOT_DIR', installDir); |  | ||||||
|     core.exportVariable('PKG_CONFIG_PATH', installDir + '/lib/pkgconfig'); |  | ||||||
|  |  | ||||||
|   if (IS_LINUX) { |   if (IS_LINUX) { | ||||||
|     const libPath = process.env.LD_LIBRARY_PATH |     const libPath = process.env.LD_LIBRARY_PATH | ||||||
| @@ -98,8 +81,9 @@ export async function useCpythonVersion( | |||||||
|       core.exportVariable('LD_LIBRARY_PATH', pyLibPath + libPath); |       core.exportVariable('LD_LIBRARY_PATH', pyLibPath + libPath); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   core.addPath(installDir); |   core.addPath(installDir); | ||||||
|     core.addPath(_binDir); |   core.addPath(binDir(installDir)); | ||||||
|  |  | ||||||
|   if (IS_WINDOWS) { |   if (IS_WINDOWS) { | ||||||
|     // Add --user directory |     // Add --user directory | ||||||
| @@ -118,19 +102,21 @@ export async function useCpythonVersion( | |||||||
|     core.addPath(userScriptsDir); |     core.addPath(userScriptsDir); | ||||||
|   } |   } | ||||||
|   // On Linux and macOS, pip will create the --user directory and add it to PATH as needed. |   // On Linux and macOS, pip will create the --user directory and add it to PATH as needed. | ||||||
|   } |  | ||||||
|  |  | ||||||
|   const installed = versionFromPath(installDir); |   const installed = versionFromPath(installDir); | ||||||
|   core.setOutput('python-version', installed); |   core.setOutput('python-version', installed); | ||||||
|   core.setOutput('python-path', pythonPath); |  | ||||||
|  |  | ||||||
|   return {impl: 'CPython', version: installed}; |   return {impl: 'CPython', version: installed}; | ||||||
| } | } | ||||||
|  |  | ||||||
| /** Convert versions like `3.8-dev` to a version like `~3.8.0-0`. */ | /** Convert versions like `3.8-dev` to a version like `>= 3.8.0-a0`. */ | ||||||
| function desugarDevVersion(versionSpec: string) { | function desugarDevVersion(versionSpec: string) { | ||||||
|   const devVersion = /^(\d+)\.(\d+)-dev$/; |   if (versionSpec.endsWith('-dev')) { | ||||||
|   return versionSpec.replace(devVersion, '~$1.$2.0-0'); |     const versionRoot = versionSpec.slice(0, -'-dev'.length); | ||||||
|  |     return `>= ${versionRoot}.0-a0`; | ||||||
|  |   } else { | ||||||
|  |     return versionSpec; | ||||||
|  |   } | ||||||
| } | } | ||||||
|  |  | ||||||
| /** Extracts python version from install path from hosted tool cache as described in README.md */ | /** Extracts python version from install path from hosted tool cache as described in README.md */ | ||||||
|   | |||||||
| @@ -98,9 +98,7 @@ async function createPyPySymlink( | |||||||
| ) { | ) { | ||||||
|   const version = semver.coerce(pythonVersion)!; |   const version = semver.coerce(pythonVersion)!; | ||||||
|   const pythonBinaryPostfix = semver.major(version); |   const pythonBinaryPostfix = semver.major(version); | ||||||
|   const pythonMinor = semver.minor(version); |  | ||||||
|   const pypyBinaryPostfix = pythonBinaryPostfix === 2 ? '' : '3'; |   const pypyBinaryPostfix = pythonBinaryPostfix === 2 ? '' : '3'; | ||||||
|   const pypyMajorMinorBinaryPostfix = `${pythonBinaryPostfix}.${pythonMinor}`; |  | ||||||
|   let binaryExtension = IS_WINDOWS ? '.exe' : ''; |   let binaryExtension = IS_WINDOWS ? '.exe' : ''; | ||||||
|  |  | ||||||
|   core.info('Creating symlinks...'); |   core.info('Creating symlinks...'); | ||||||
| @@ -117,13 +115,6 @@ async function createPyPySymlink( | |||||||
|     `python${binaryExtension}`, |     `python${binaryExtension}`, | ||||||
|     true |     true | ||||||
|   ); |   ); | ||||||
|  |  | ||||||
|   createSymlinkInFolder( |  | ||||||
|     pypyBinaryPath, |  | ||||||
|     `pypy${pypyBinaryPostfix}${binaryExtension}`, |  | ||||||
|     `pypy${pypyMajorMinorBinaryPostfix}${binaryExtension}`, |  | ||||||
|     true |  | ||||||
|   ); |  | ||||||
| } | } | ||||||
|  |  | ||||||
| async function installPip(pythonLocation: string) { | async function installPip(pythonLocation: string) { | ||||||
|   | |||||||
| @@ -3,12 +3,11 @@ import * as finder from './find-python'; | |||||||
| import * as finderPyPy from './find-pypy'; | import * as finderPyPy from './find-pypy'; | ||||||
| import * as path from 'path'; | import * as path from 'path'; | ||||||
| import * as os from 'os'; | import * as os from 'os'; | ||||||
| import fs from 'fs'; |  | ||||||
| import {getCacheDistributor} from './cache-distributions/cache-factory'; | import {getCacheDistributor} from './cache-distributions/cache-factory'; | ||||||
| import {isCacheFeatureAvailable, IS_LINUX, IS_WINDOWS} from './utils'; | import {isCacheFeatureAvailable} from './utils'; | ||||||
|  |  | ||||||
| function isPyPyVersion(versionSpec: string) { | function isPyPyVersion(versionSpec: string) { | ||||||
|   return versionSpec.startsWith('pypy'); |   return versionSpec.startsWith('pypy-'); | ||||||
| } | } | ||||||
|  |  | ||||||
| async function cacheDependencies(cache: string, pythonVersion: string) { | async function cacheDependencies(cache: string, pythonVersion: string) { | ||||||
| @@ -22,89 +21,28 @@ async function cacheDependencies(cache: string, pythonVersion: string) { | |||||||
|   await cacheDistributor.restoreCache(); |   await cacheDistributor.restoreCache(); | ||||||
| } | } | ||||||
|  |  | ||||||
| function resolveVersionInput(): string { |  | ||||||
|   let version = core.getInput('python-version'); |  | ||||||
|   let versionFile = core.getInput('python-version-file'); |  | ||||||
|  |  | ||||||
|   if (version && versionFile) { |  | ||||||
|     core.warning( |  | ||||||
|       'Both python-version and python-version-file inputs are specified, only python-version will be used.' |  | ||||||
|     ); |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   if (version) { |  | ||||||
|     return version; |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   if (versionFile) { |  | ||||||
|     if (!fs.existsSync(versionFile)) { |  | ||||||
|       logWarning( |  | ||||||
|         `The specified python version file at: ${versionFile} doesn't exist. Attempting to find .python-version file.` |  | ||||||
|       ); |  | ||||||
|       versionFile = '.python-version'; |  | ||||||
|       if (!fs.existsSync(versionFile)) { |  | ||||||
|         throw new Error(`The ${versionFile} doesn't exist.`); |  | ||||||
|       } |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     version = fs.readFileSync(versionFile, 'utf8'); |  | ||||||
|     core.info(`Resolved ${versionFile} as ${version}`); |  | ||||||
|  |  | ||||||
|     return version; |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   core.warning( |  | ||||||
|     "Neither 'python-version' nor 'python-version-file' inputs were supplied." |  | ||||||
|   ); |  | ||||||
|  |  | ||||||
|   return version; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| async function run() { | async function run() { | ||||||
|   // According to the README windows binaries do not require to be installed |  | ||||||
|   // in the specific location, but Mac and Linux do |  | ||||||
|   if (!IS_WINDOWS && !process.env.AGENT_TOOLSDIRECTORY?.trim()) { |  | ||||||
|     if (IS_LINUX) process.env['AGENT_TOOLSDIRECTORY'] = '/opt/hostedtoolcache'; |  | ||||||
|     else process.env['AGENT_TOOLSDIRECTORY'] = '/Users/runner/hostedtoolcache'; |  | ||||||
|     process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY']; |  | ||||||
|   } |  | ||||||
|   core.debug( |  | ||||||
|     `Python is expected to be installed into RUNNER_TOOL_CACHE=${process.env['RUNNER_TOOL_CACHE']}` |  | ||||||
|   ); |  | ||||||
|   try { |   try { | ||||||
|     const version = resolveVersionInput(); |     const version = core.getInput('python-version'); | ||||||
|     if (version) { |     if (version) { | ||||||
|       let pythonVersion: string; |       let pythonVersion: string; | ||||||
|       const arch: string = core.getInput('architecture') || os.arch(); |       const arch: string = core.getInput('architecture') || os.arch(); | ||||||
|       const updateEnvironment = core.getBooleanInput('update-environment'); |  | ||||||
|       if (isPyPyVersion(version)) { |       if (isPyPyVersion(version)) { | ||||||
|         const installed = await finderPyPy.findPyPyVersion( |         const installed = await finderPyPy.findPyPyVersion(version, arch); | ||||||
|           version, |  | ||||||
|           arch, |  | ||||||
|           updateEnvironment |  | ||||||
|         ); |  | ||||||
|         pythonVersion = `${installed.resolvedPyPyVersion}-${installed.resolvedPythonVersion}`; |         pythonVersion = `${installed.resolvedPyPyVersion}-${installed.resolvedPythonVersion}`; | ||||||
|         core.info( |         core.info( | ||||||
|           `Successfully set up PyPy ${installed.resolvedPyPyVersion} with Python (${installed.resolvedPythonVersion})` |           `Successfully setup PyPy ${installed.resolvedPyPyVersion} with Python (${installed.resolvedPythonVersion})` | ||||||
|         ); |         ); | ||||||
|       } else { |       } else { | ||||||
|         const installed = await finder.useCpythonVersion( |         const installed = await finder.useCpythonVersion(version, arch); | ||||||
|           version, |  | ||||||
|           arch, |  | ||||||
|           updateEnvironment |  | ||||||
|         ); |  | ||||||
|         pythonVersion = installed.version; |         pythonVersion = installed.version; | ||||||
|         core.info(`Successfully set up ${installed.impl} (${pythonVersion})`); |         core.info(`Successfully setup ${installed.impl} (${pythonVersion})`); | ||||||
|       } |       } | ||||||
|  |  | ||||||
|       const cache = core.getInput('cache'); |       const cache = core.getInput('cache'); | ||||||
|       if (cache && isCacheFeatureAvailable()) { |       if (cache && isCacheFeatureAvailable()) { | ||||||
|         await cacheDependencies(cache, pythonVersion); |         await cacheDependencies(cache, pythonVersion); | ||||||
|       } |       } | ||||||
|     } else { |  | ||||||
|       core.warning( |  | ||||||
|         'The `python-version` input is not set.  The version of Python currently in `PATH` will be used.' |  | ||||||
|       ); |  | ||||||
|     } |     } | ||||||
|     const matchersPath = path.join(__dirname, '../..', '.github'); |     const matchersPath = path.join(__dirname, '../..', '.github'); | ||||||
|     core.info(`##[add-matcher]${path.join(matchersPath, 'python.json')}`); |     core.info(`##[add-matcher]${path.join(matchersPath, 'python.json')}`); | ||||||
| @@ -113,9 +51,4 @@ async function run() { | |||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
| export function logWarning(message: string): void { |  | ||||||
|   const warningPrefix = '[warning]'; |  | ||||||
|   core.info(`${warningPrefix}${message}`); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| run(); | run(); | ||||||
|   | |||||||
| @@ -25,7 +25,7 @@ export interface IPyPyManifestRelease { | |||||||
|   files: IPyPyManifestAsset[]; |   files: IPyPyManifestAsset[]; | ||||||
| } | } | ||||||
|  |  | ||||||
| /** create Symlinks for downloaded PyPy | /** create Symlinks for downflfoaded PyPy | ||||||
|  *  It should be executed only for downloaded versions in runtime, because |  *  It should be executed only for downloaded versions in runtime, because | ||||||
|  *  toolcache versions have this setup. |  *  toolcache versions have this setup. | ||||||
|  */ |  */ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user