Compare commits
No commits in common. "main" and "v4.6.1" have entirely different histories.
69 changed files with 23001 additions and 71995 deletions
2
.github/workflows/basic-validation.yml
vendored
2
.github/workflows/basic-validation.yml
vendored
|
@ -13,5 +13,3 @@ jobs:
|
|||
call-basic-validation:
|
||||
name: Basic validation
|
||||
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main
|
||||
with:
|
||||
node-version: '20.x'
|
||||
|
|
2
.github/workflows/check-dist.yml
vendored
2
.github/workflows/check-dist.yml
vendored
|
@ -15,5 +15,3 @@ jobs:
|
|||
call-check-dist:
|
||||
name: Check dist/
|
||||
uses: actions/reusable-workflows/.github/workflows/check-dist.yml@main
|
||||
with:
|
||||
node-version: '20.x'
|
||||
|
|
38
.github/workflows/e2e-cache.yml
vendored
38
.github/workflows/e2e-cache.yml
vendored
|
@ -23,7 +23,7 @@ jobs:
|
|||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
python-version: ['3.9', 'pypy-3.7-v7.x']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup Python
|
||||
uses: ./
|
||||
with:
|
||||
|
@ -41,32 +41,24 @@ jobs:
|
|||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
python-version: ['3.9', 'pypy-3.9-v7.x']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup Python
|
||||
id: cache-pipenv
|
||||
uses: ./
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: 'pipenv'
|
||||
- name: Install pipenv
|
||||
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
|
||||
- name: Prepare environment
|
||||
- name: Install dependencies
|
||||
shell: pwsh
|
||||
run: |
|
||||
mv ./__tests__/data/Pipfile.lock .
|
||||
mv ./__tests__/data/Pipfile .
|
||||
mv ./__tests__/test-pipenv.py .
|
||||
- name: Install dependencies
|
||||
shell: pwsh
|
||||
if: steps.cache-pipenv.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
if ("${{ matrix.python-version }}" -Match "pypy") {
|
||||
pipenv install --python pypy # --keep-outdated
|
||||
pipenv install --keep-outdated --python pypy
|
||||
} else {
|
||||
pipenv install --python ${{ matrix.python-version }} # --keep-outdated
|
||||
pipenv install --keep-outdated --python ${{ matrix.python-version }}
|
||||
}
|
||||
- name: Run Python Script
|
||||
run: pipenv run python test-pipenv.py
|
||||
|
||||
python-poetry-dependencies-caching:
|
||||
name: Test poetry (Python ${{ matrix.python-version}}, ${{ matrix.os }})
|
||||
|
@ -77,7 +69,7 @@ jobs:
|
|||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
python-version: ['3.9', 'pypy-3.8']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install poetry
|
||||
run: pipx install poetry
|
||||
- name: Init pyproject.toml
|
||||
|
@ -99,7 +91,7 @@ jobs:
|
|||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
python-version: ['3.9', 'pypy-3.7-v7.x']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup Python
|
||||
uses: ./
|
||||
with:
|
||||
|
@ -118,9 +110,8 @@ jobs:
|
|||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
python-version: ['3.9', 'pypy-3.9-v7.x']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup Python
|
||||
id: cache-pipenv
|
||||
uses: ./
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
@ -128,20 +119,13 @@ jobs:
|
|||
cache-dependency-path: '**/pipenv-requirements.txt'
|
||||
- name: Install pipenv
|
||||
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
|
||||
- name: Prepare environment
|
||||
- name: Install dependencies
|
||||
shell: pwsh
|
||||
run: |
|
||||
mv ./__tests__/data/Pipfile.lock .
|
||||
mv ./__tests__/data/Pipfile .
|
||||
mv ./__tests__/test-pipenv.py .
|
||||
- name: Install dependencies
|
||||
shell: pwsh
|
||||
if: steps.cache-pipenv.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
if ("${{ matrix.python-version }}" -Match "pypy") {
|
||||
pipenv install --python pypy # --keep-outdated
|
||||
pipenv install --keep-outdated --python pypy
|
||||
} else {
|
||||
pipenv install --python ${{ matrix.python-version }} # --keep-outdated
|
||||
pipenv install --keep-outdated --python ${{ matrix.python-version }}
|
||||
}
|
||||
- name: Run Python Script
|
||||
run: pipenv run python test-pipenv.py
|
||||
|
|
23
.github/workflows/e2e-tests.yml
vendored
23
.github/workflows/e2e-tests.yml
vendored
|
@ -19,7 +19,14 @@ jobs:
|
|||
operating-system: [ubuntu-20.04, windows-latest]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Run with setup-python 2.7
|
||||
uses: ./
|
||||
with:
|
||||
python-version: 2.7
|
||||
- name: Verify 2.7
|
||||
run: python __tests__/verify-python.py 2.7
|
||||
|
||||
- name: Run with setup-python 3.5
|
||||
uses: ./
|
||||
|
@ -79,17 +86,3 @@ jobs:
|
|||
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
|
||||
|
||||
- name: Run with setup-python ==3.8
|
||||
uses: ./
|
||||
with:
|
||||
python-version: '==3.8'
|
||||
- name: Verify ==3.8
|
||||
run: python __tests__/verify-python.py 3.8
|
||||
|
||||
- name: Run with setup-python <3.11
|
||||
uses: ./
|
||||
with:
|
||||
python-version: '<3.11'
|
||||
- name: Verify <3.11
|
||||
run: python __tests__/verify-python.py 3.10
|
||||
|
|
116
.github/workflows/test-graalpy.yml
vendored
116
.github/workflows/test-graalpy.yml
vendored
|
@ -1,116 +0,0 @@
|
|||
name: Validate GraalPy e2e
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
|
||||
jobs:
|
||||
setup-graalpy:
|
||||
name: Setup GraalPy ${{ matrix.graalpy }} ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest, ubuntu-20.04, ubuntu-latest]
|
||||
graalpy:
|
||||
- 'graalpy-23.0'
|
||||
- 'graalpy-22.3'
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: setup-python ${{ matrix.graalpy }}
|
||||
id: setup-python
|
||||
uses: ./
|
||||
with:
|
||||
python-version: ${{ matrix.graalpy }}
|
||||
|
||||
- name: Check python-path
|
||||
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
||||
shell: bash
|
||||
|
||||
- name: GraalPy and Python version
|
||||
run: python --version
|
||||
|
||||
- name: Run simple code
|
||||
run: python -c 'import math; print(math.factorial(5))'
|
||||
|
||||
- name: Assert GraalPy is running
|
||||
run: |
|
||||
import platform
|
||||
assert platform.python_implementation().lower() == "graalvm"
|
||||
shell: python
|
||||
|
||||
- name: Assert expected binaries (or symlinks) are present
|
||||
run: |
|
||||
EXECUTABLE=${{ matrix.graalpy }}
|
||||
EXECUTABLE=${EXECUTABLE/graalpy-/graalpy} # remove the first '-' in "graalpy-X.Y" -> "graalpyX.Y" to match executable name
|
||||
EXECUTABLE=${EXECUTABLE%%-*} # remove any -* suffixe
|
||||
${EXECUTABLE} --version
|
||||
shell: bash
|
||||
|
||||
setup-graalpy-noenv:
|
||||
name: Setup GraalPy ${{ matrix.graalpy }} ${{ matrix.os }} (noenv)
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest, ubuntu-20.04, ubuntu-latest]
|
||||
graalpy: ['graalpy23.0', 'graalpy22.3']
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: setup-python ${{ matrix.graalpy }}
|
||||
id: setup-python
|
||||
uses: ./
|
||||
with:
|
||||
python-version: ${{ matrix.graalpy }}
|
||||
update-environment: false
|
||||
|
||||
- name: GraalPy 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))'
|
||||
|
||||
check-latest:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup GraalPy and check latest
|
||||
uses: ./
|
||||
id: graalpy
|
||||
with:
|
||||
python-version: 'graalpy-23.x'
|
||||
check-latest: true
|
||||
- name: GraalPy and Python version
|
||||
run: python --version
|
||||
|
||||
- name: Run simple code
|
||||
run: python -c 'import math; print(math.factorial(5))'
|
||||
|
||||
- name: Assert GraalPy is running
|
||||
run: |
|
||||
import platform
|
||||
assert platform.python_implementation().lower() == "graalvm"
|
||||
shell: python
|
||||
|
||||
- name: Assert expected binaries (or symlinks) are present
|
||||
run: |
|
||||
EXECUTABLE='${{ steps.graalpy.outputs.python-version }}'
|
||||
EXECUTABLE="${EXECUTABLE%.*}"
|
||||
${EXECUTABLE} --version
|
||||
shell: bash
|
8
.github/workflows/test-pypy.yml
vendored
8
.github/workflows/test-pypy.yml
vendored
|
@ -35,7 +35,7 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: setup-python ${{ matrix.pypy }}
|
||||
id: setup-python
|
||||
|
@ -78,7 +78,7 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: setup-python ${{ matrix.pypy }}
|
||||
id: setup-python
|
||||
|
@ -100,7 +100,7 @@ jobs:
|
|||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup PyPy and check latest
|
||||
uses: ./
|
||||
with:
|
||||
|
@ -133,7 +133,7 @@ jobs:
|
|||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup PyPy and check latest
|
||||
uses: ./
|
||||
with:
|
||||
|
|
163
.github/workflows/test-python.yml
vendored
163
.github/workflows/test-python.yml
vendored
|
@ -33,7 +33,7 @@ jobs:
|
|||
python: 3.8.15
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: setup-python ${{ matrix.python }}
|
||||
id: setup-python
|
||||
|
@ -77,7 +77,7 @@ jobs:
|
|||
python: 3.8.15
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: build-version-file ${{ matrix.python }}
|
||||
run: echo ${{ matrix.python }} > .python-version
|
||||
|
@ -86,152 +86,7 @@ jobs:
|
|||
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
|
||||
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-without-parameter:
|
||||
name: Setup ${{ matrix.python }} ${{ matrix.os }} version file without parameter
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest, windows-latest, ubuntu-20.04, ubuntu-22.04]
|
||||
python: [3.5.4, 3.6.7, 3.7.5, 3.8.15, 3.9.13]
|
||||
exclude:
|
||||
- os: ubuntu-22.04
|
||||
python: 3.5.4
|
||||
- os: ubuntu-22.04
|
||||
python: 3.6.7
|
||||
- os: ubuntu-22.04
|
||||
python: 3.7.5
|
||||
- os: windows-latest
|
||||
python: 3.8.15
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: build-version-file ${{ matrix.python }}
|
||||
run: echo ${{ matrix.python }} > .python-version
|
||||
|
||||
- name: setup-python ${{ matrix.python }}
|
||||
id: setup-python
|
||||
uses: ./
|
||||
|
||||
- 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-standard-pyproject-file:
|
||||
name: Setup ${{ matrix.python }} ${{ matrix.os }} standard pyproject file
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest, windows-latest, ubuntu-20.04, ubuntu-22.04]
|
||||
python: [3.5.4, 3.6.7, 3.7.5, 3.8.15, 3.9.13, '==3.10.10']
|
||||
exclude:
|
||||
- os: ubuntu-22.04
|
||||
python: 3.5.4
|
||||
- os: ubuntu-22.04
|
||||
python: 3.6.7
|
||||
- os: ubuntu-22.04
|
||||
python: 3.7.5
|
||||
- os: windows-latest
|
||||
python: 3.8.15
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: build-version-file ${{ matrix.python }}
|
||||
run: |
|
||||
echo '[project]
|
||||
requires-python = "${{ matrix.python }}"
|
||||
' > pyproject.toml
|
||||
|
||||
- name: setup-python ${{ matrix.python }}
|
||||
id: setup-python
|
||||
uses: ./
|
||||
with:
|
||||
python-version-file: pyproject.toml
|
||||
|
||||
- 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 }}".replace("==", "") -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-poetry-pyproject-file:
|
||||
name: Setup ${{ matrix.python }} ${{ matrix.os }} poetry pyproject file
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest, windows-latest, ubuntu-20.04, ubuntu-22.04]
|
||||
python: [3.5.4, 3.6.7, 3.7.5, 3.8.15, 3.9.13]
|
||||
exclude:
|
||||
- os: ubuntu-22.04
|
||||
python: 3.5.4
|
||||
- os: ubuntu-22.04
|
||||
python: 3.6.7
|
||||
- os: ubuntu-22.04
|
||||
python: 3.7.5
|
||||
- os: windows-latest
|
||||
python: 3.8.15
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: build-version-file ${{ matrix.python }}
|
||||
run: |
|
||||
echo '[tool.poetry.dependencies]
|
||||
python = "${{ matrix.python }}"
|
||||
' > pyproject.toml
|
||||
|
||||
- name: setup-python ${{ matrix.python }}
|
||||
id: setup-python
|
||||
uses: ./
|
||||
with:
|
||||
python-version-file: pyproject.toml
|
||||
python-version-file: '.python-version'
|
||||
|
||||
- name: Check python-path
|
||||
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
||||
|
@ -259,7 +114,7 @@ jobs:
|
|||
os: [macos-latest, windows-latest, ubuntu-20.04]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: setup-python 3.9.0-beta.4
|
||||
id: setup-python
|
||||
|
@ -293,7 +148,7 @@ jobs:
|
|||
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: setup-python 3.9-dev
|
||||
id: setup-python
|
||||
|
@ -321,7 +176,7 @@ jobs:
|
|||
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: setup-python 3.12
|
||||
id: setup-python
|
||||
|
@ -351,7 +206,7 @@ jobs:
|
|||
python: ['3.7', '3.8', '3.9', '3.10']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: setup-python ${{ matrix.python }}
|
||||
id: setup-python
|
||||
|
@ -374,7 +229,7 @@ jobs:
|
|||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
python-version: ['3.8', '3.9', '3.10']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup Python and check latest
|
||||
uses: ./
|
||||
with:
|
||||
|
@ -397,7 +252,7 @@ jobs:
|
|||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup Python and check latest
|
||||
uses: ./
|
||||
with:
|
||||
|
|
2
.licenses/npm/@actions/cache.dep.yml
generated
2
.licenses/npm/@actions/cache.dep.yml
generated
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: "@actions/cache"
|
||||
version: 3.2.2
|
||||
version: 3.1.4
|
||||
type: npm
|
||||
summary: Actions cache lib
|
||||
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"
|
||||
version: 1.10.1
|
||||
version: 1.10.0
|
||||
type: npm
|
||||
summary: Actions core lib
|
||||
homepage: https://github.com/actions/toolkit/tree/main/packages/core
|
||||
|
|
2
.licenses/npm/@actions/exec.dep.yml
generated
2
.licenses/npm/@actions/exec.dep.yml
generated
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: "@actions/exec"
|
||||
version: 1.1.1
|
||||
version: 1.1.0
|
||||
type: npm
|
||||
summary: Actions exec lib
|
||||
homepage: https://github.com/actions/toolkit/tree/main/packages/exec
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: "@actions/glob"
|
||||
version: 0.4.0
|
||||
version: 0.2.0
|
||||
type: npm
|
||||
summary: Actions glob lib
|
||||
homepage: https://github.com/actions/toolkit/tree/main/packages/glob
|
32
.licenses/npm/@actions/http-client-1.0.11.dep.yml
generated
Normal file
32
.licenses/npm/@actions/http-client-1.0.11.dep.yml
generated
Normal file
|
@ -0,0 +1,32 @@
|
|||
---
|
||||
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,6 +1,6 @@
|
|||
---
|
||||
name: "@actions/http-client"
|
||||
version: 2.2.0
|
||||
version: 2.1.0
|
||||
type: npm
|
||||
summary: Actions Http Client
|
||||
homepage: https://github.com/actions/toolkit/tree/main/packages/http-client
|
30
.licenses/npm/@actions/io.dep.yml
generated
30
.licenses/npm/@actions/io.dep.yml
generated
|
@ -1,20 +1,30 @@
|
|||
---
|
||||
name: "@actions/io"
|
||||
version: 1.1.3
|
||||
version: 1.0.2
|
||||
type: npm
|
||||
summary: Actions io lib
|
||||
homepage: https://github.com/actions/toolkit/tree/main/packages/io
|
||||
homepage: https://github.com/actions/toolkit/tree/master/packages/io
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE.md
|
||||
text: |-
|
||||
The MIT License (MIT)
|
||||
- sources: Auto-generated MIT license text
|
||||
text: |
|
||||
MIT License
|
||||
|
||||
Copyright 2019 GitHub
|
||||
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:
|
||||
|
||||
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 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.
|
||||
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: []
|
||||
|
|
30
.licenses/npm/@actions/tool-cache.dep.yml
generated
30
.licenses/npm/@actions/tool-cache.dep.yml
generated
|
@ -1,20 +1,30 @@
|
|||
---
|
||||
name: "@actions/tool-cache"
|
||||
version: 2.0.1
|
||||
version: 1.5.5
|
||||
type: npm
|
||||
summary: Actions tool-cache lib
|
||||
homepage: https://github.com/actions/toolkit/tree/main/packages/tool-cache
|
||||
homepage: https://github.com/actions/toolkit/tree/master/packages/tool-cache
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE.md
|
||||
text: |-
|
||||
The MIT License (MIT)
|
||||
- sources: Auto-generated MIT license text
|
||||
text: |
|
||||
MIT License
|
||||
|
||||
Copyright 2019 GitHub
|
||||
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:
|
||||
|
||||
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 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.
|
||||
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: []
|
||||
|
|
32
.licenses/npm/@azure/core-asynciterator-polyfill.dep.yml
generated
Normal file
32
.licenses/npm/@azure/core-asynciterator-polyfill.dep.yml
generated
Normal file
|
@ -0,0 +1,32 @@
|
|||
---
|
||||
name: "@azure/core-asynciterator-polyfill"
|
||||
version: 1.0.0
|
||||
type: npm
|
||||
summary: Polyfill for IE/Node 8 for Symbol.asyncIterator
|
||||
homepage: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/core-asynciterator-polyfill
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
text: |2
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
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: []
|
2
.licenses/npm/@azure/core-auth.dep.yml
generated
2
.licenses/npm/@azure/core-auth.dep.yml
generated
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: "@azure/core-auth"
|
||||
version: 1.5.0
|
||||
version: 1.3.2
|
||||
type: npm
|
||||
summary: Provides low-level interfaces and helper methods for authentication in Azure
|
||||
SDK
|
||||
|
|
2
.licenses/npm/@azure/core-http.dep.yml
generated
2
.licenses/npm/@azure/core-http.dep.yml
generated
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: "@azure/core-http"
|
||||
version: 3.0.4
|
||||
version: 3.0.1
|
||||
type: npm
|
||||
summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client
|
||||
libraries generated using AutoRest
|
||||
|
|
2
.licenses/npm/@azure/core-lro.dep.yml
generated
2
.licenses/npm/@azure/core-lro.dep.yml
generated
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: "@azure/core-lro"
|
||||
version: 2.5.4
|
||||
version: 2.2.1
|
||||
type: npm
|
||||
summary: Isomorphic client library for supporting long-running operations in node.js
|
||||
and browser.
|
||||
|
|
2
.licenses/npm/@azure/core-paging.dep.yml
generated
2
.licenses/npm/@azure/core-paging.dep.yml
generated
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: "@azure/core-paging"
|
||||
version: 1.5.0
|
||||
version: 1.2.0
|
||||
type: npm
|
||||
summary: Core types for paging async iterable iterators
|
||||
homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-paging/README.md
|
||||
|
|
2
.licenses/npm/@azure/core-util.dep.yml
generated
2
.licenses/npm/@azure/core-util.dep.yml
generated
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: "@azure/core-util"
|
||||
version: 1.6.1
|
||||
version: 1.3.1
|
||||
type: npm
|
||||
summary: Core library for shared utility methods
|
||||
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-util/
|
||||
|
|
2
.licenses/npm/@azure/logger.dep.yml
generated
2
.licenses/npm/@azure/logger.dep.yml
generated
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: "@azure/logger"
|
||||
version: 1.0.4
|
||||
version: 1.0.3
|
||||
type: npm
|
||||
summary: Microsoft Azure SDK for JavaScript - Logger
|
||||
homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger/README.md
|
||||
|
|
2
.licenses/npm/@azure/ms-rest-js.dep.yml
generated
2
.licenses/npm/@azure/ms-rest-js.dep.yml
generated
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: "@azure/ms-rest-js"
|
||||
version: 2.7.0
|
||||
version: 2.6.6
|
||||
type: npm
|
||||
summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client
|
||||
libraries generated using AutoRest
|
||||
|
|
2
.licenses/npm/@azure/storage-blob.dep.yml
generated
2
.licenses/npm/@azure/storage-blob.dep.yml
generated
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: "@azure/storage-blob"
|
||||
version: 12.17.0
|
||||
version: 12.14.0
|
||||
type: npm
|
||||
summary: Microsoft Azure Storage SDK for JavaScript - Blob
|
||||
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storage/storage-blob/
|
||||
|
|
30
.licenses/npm/@fastify/busboy.dep.yml
generated
30
.licenses/npm/@fastify/busboy.dep.yml
generated
|
@ -1,30 +0,0 @@
|
|||
---
|
||||
name: "@fastify/busboy"
|
||||
version: 2.1.0
|
||||
type: npm
|
||||
summary: A streaming parser for HTML form data for node.js
|
||||
homepage:
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
text: |-
|
||||
Copyright Brian White. All rights reserved.
|
||||
|
||||
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: []
|
26
.licenses/npm/@iarna/toml.dep.yml
generated
26
.licenses/npm/@iarna/toml.dep.yml
generated
|
@ -1,26 +0,0 @@
|
|||
---
|
||||
name: "@iarna/toml"
|
||||
version: 2.2.5
|
||||
type: npm
|
||||
summary: Better TOML parsing and stringifying all in that familiar JSON interface.
|
||||
homepage: https://github.com/iarna/iarna-toml#readme
|
||||
license: isc
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
text: |+
|
||||
Copyright (c) 2016, Rebecca Turner <me@re-becca.org>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
notices: []
|
||||
...
|
16
.licenses/npm/@opentelemetry/api.dep.yml
generated
16
.licenses/npm/@opentelemetry/api.dep.yml
generated
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
name: "@opentelemetry/api"
|
||||
version: 1.7.0
|
||||
version: 1.0.3
|
||||
type: npm
|
||||
summary: Public API for OpenTelemetry
|
||||
homepage: https://github.com/open-telemetry/opentelemetry-js/tree/main/api
|
||||
homepage: https://github.com/open-telemetry/opentelemetry-js-api#readme
|
||||
license: apache-2.0
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
|
@ -216,8 +216,14 @@ licenses:
|
|||
[opentelemetry-js]: https://github.com/open-telemetry/opentelemetry-js
|
||||
|
||||
[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions
|
||||
[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/main/api/LICENSE
|
||||
[license-url]: https://github.com/open-telemetry/opentelemetry-js-api/blob/main/LICENSE
|
||||
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
|
||||
[docs-tracing]: https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/tracing.md
|
||||
[docs-sdk-registration]: https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/sdk-registration.md
|
||||
[dependencies-image]: https://status.david-dm.org/gh/open-telemetry/opentelemetry-js-api.svg
|
||||
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js-api
|
||||
[devDependencies-image]: https://status.david-dm.org/gh/open-telemetry/opentelemetry-js-api.svg?type=dev
|
||||
[devDependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js-api?type=dev
|
||||
[npm-url]: https://www.npmjs.com/package/@opentelemetry/api
|
||||
[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fapi.svg
|
||||
[docs-tracing]: https://github.com/open-telemetry/opentelemetry-js-api/blob/main/docs/tracing.md
|
||||
[docs-sdk-registration]: https://github.com/open-telemetry/opentelemetry-js-api/blob/main/docs/sdk-registration.md
|
||||
notices: []
|
||||
|
|
2
.licenses/npm/@types/node-fetch.dep.yml
generated
2
.licenses/npm/@types/node-fetch.dep.yml
generated
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: "@types/node-fetch"
|
||||
version: 2.6.9
|
||||
version: 2.6.3
|
||||
type: npm
|
||||
summary: TypeScript definitions for node-fetch
|
||||
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-fetch
|
||||
|
|
4
.licenses/npm/@types/node.dep.yml
generated
4
.licenses/npm/@types/node.dep.yml
generated
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
name: "@types/node"
|
||||
version: 20.9.1
|
||||
version: 16.11.25
|
||||
type: npm
|
||||
summary: TypeScript definitions for node
|
||||
summary: TypeScript definitions for Node.js
|
||||
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node
|
||||
license: mit
|
||||
licenses:
|
||||
|
|
33
.licenses/npm/form-data-3.0.1.dep.yml
generated
Normal file
33
.licenses/npm/form-data-3.0.1.dep.yml
generated
Normal file
|
@ -0,0 +1,33 @@
|
|||
---
|
||||
name: form-data
|
||||
version: 3.0.1
|
||||
type: npm
|
||||
summary: A library to create readable "multipart/form-data" streams. Can be used to
|
||||
submit forms and file uploads to other web applications.
|
||||
homepage: https://github.com/form-data/form-data#readme
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: License
|
||||
text: |
|
||||
Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors
|
||||
|
||||
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.
|
||||
- sources: Readme.md
|
||||
text: Form-Data is released under the [MIT](License) license.
|
||||
notices: []
|
|
@ -1,16 +1,16 @@
|
|||
---
|
||||
name: undici
|
||||
version: 5.27.2
|
||||
name: ip-regex
|
||||
version: 2.1.0
|
||||
type: npm
|
||||
summary: An HTTP/1.1 client, written from scratch for Node.js
|
||||
homepage: https://undici.nodejs.org
|
||||
summary: Regular expression for matching IP addresses (IPv4 & IPv6)
|
||||
homepage: https://github.com/sindresorhus/ip-regex#readme
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
- sources: license
|
||||
text: |
|
||||
MIT License
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Matteo Collina and Undici contributors
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -19,16 +19,16 @@ licenses:
|
|||
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 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.
|
||||
- sources: README.md
|
||||
text: MIT
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
- sources: readme.md
|
||||
text: MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
notices: []
|
43
.licenses/npm/mime-db.dep.yml
generated
43
.licenses/npm/mime-db.dep.yml
generated
|
@ -1,34 +1,33 @@
|
|||
---
|
||||
name: mime-db
|
||||
version: 1.52.0
|
||||
version: 1.50.0
|
||||
type: npm
|
||||
summary: Media Type Database
|
||||
homepage:
|
||||
homepage: https://github.com/jshttp/mime-db#readme
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
text: |
|
||||
(The MIT License)
|
||||
text: |2
|
||||
|
||||
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
|
||||
Copyright (c) 2015-2022 Douglas Christopher Wilson <doug@somethingdoug.com>
|
||||
The MIT License (MIT)
|
||||
|
||||
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:
|
||||
Copyright (c) 2014 Jonathan Ong me@jongleberry.com
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
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 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.
|
||||
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: []
|
||||
|
|
6
.licenses/npm/mime-types.dep.yml
generated
6
.licenses/npm/mime-types.dep.yml
generated
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
name: mime-types
|
||||
version: 2.1.35
|
||||
version: 2.1.33
|
||||
type: npm
|
||||
summary: The ultimate javascript content-type utility.
|
||||
homepage:
|
||||
homepage: https://github.com/jshttp/mime-types#readme
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
|
@ -36,7 +36,7 @@ licenses:
|
|||
[MIT](LICENSE)
|
||||
|
||||
[ci-image]: https://badgen.net/github/checks/jshttp/mime-types/master?label=ci
|
||||
[ci-url]: https://github.com/jshttp/mime-types/actions/workflows/ci.yml
|
||||
[ci-url]: https://github.com/jshttp/mime-types/actions?query=workflow%3Aci
|
||||
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-types/master
|
||||
[coveralls-url]: https://coveralls.io/r/jshttp/mime-types?branch=master
|
||||
[node-version-image]: https://badgen.net/npm/node/mime-types
|
||||
|
|
2
.licenses/npm/node-fetch.dep.yml
generated
2
.licenses/npm/node-fetch.dep.yml
generated
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: node-fetch
|
||||
version: 2.7.0
|
||||
version: 2.6.7
|
||||
type: npm
|
||||
summary: A light-weight module that brings window.fetch to node.js
|
||||
homepage: https://github.com/bitinn/node-fetch
|
||||
|
|
43
.licenses/npm/psl.dep.yml
generated
Normal file
43
.licenses/npm/psl.dep.yml
generated
Normal file
|
@ -0,0 +1,43 @@
|
|||
---
|
||||
name: psl
|
||||
version: 1.8.0
|
||||
type: npm
|
||||
summary: Domain name parser based on the Public Suffix List
|
||||
homepage: https://github.com/lupomontero/psl#readme
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
text: |
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 Lupo Montero lupomontero@gmail.com
|
||||
|
||||
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.
|
||||
- sources: README.md
|
||||
text: |-
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 Lupo Montero <lupomontero@gmail.com>
|
||||
|
||||
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: []
|
34
.licenses/npm/punycode.dep.yml
generated
Normal file
34
.licenses/npm/punycode.dep.yml
generated
Normal file
|
@ -0,0 +1,34 @@
|
|||
---
|
||||
name: punycode
|
||||
version: 2.1.1
|
||||
type: npm
|
||||
summary: A robust Punycode converter that fully complies to RFC 3492 and RFC 5891,
|
||||
and works on nearly all JavaScript platforms.
|
||||
homepage: https://mths.be/punycode
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE-MIT.txt
|
||||
text: |
|
||||
Copyright Mathias Bynens <https://mathiasbynens.be/>
|
||||
|
||||
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.
|
||||
- sources: README.md
|
||||
text: Punycode.js is available under the [MIT](https://mths.be/mit) license.
|
||||
notices: []
|
8
.licenses/npm/sax.dep.yml
generated
8
.licenses/npm/sax.dep.yml
generated
|
@ -1,16 +1,16 @@
|
|||
---
|
||||
name: sax
|
||||
version: 1.3.0
|
||||
version: 1.2.4
|
||||
type: npm
|
||||
summary: An evented streaming XML parser in JavaScript
|
||||
homepage:
|
||||
homepage: https://github.com/isaacs/sax-js#readme
|
||||
license: isc
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
text: |
|
||||
The ISC License
|
||||
|
||||
Copyright (c) 2010-2022 Isaac Z. Schlueter and Contributors
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -29,7 +29,7 @@ licenses:
|
|||
`String.fromCodePoint` by Mathias Bynens used according to terms of MIT
|
||||
License, as follows:
|
||||
|
||||
Copyright (c) 2010-2022 Mathias Bynens <https://mathiasbynens.be/>
|
||||
Copyright Mathias Bynens <https://mathiasbynens.be/>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
name: semver
|
||||
version: 7.5.4
|
||||
version: 6.3.0
|
||||
type: npm
|
||||
summary: The semantic version parser used by npm.
|
||||
homepage:
|
||||
homepage: https://github.com/npm/node-semver#readme
|
||||
license: isc
|
||||
licenses:
|
||||
- sources: LICENSE
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: semver
|
||||
version: 6.3.1
|
||||
version: 7.3.8
|
||||
type: npm
|
||||
summary: The semantic version parser used by npm.
|
||||
homepage:
|
23
.licenses/npm/tough-cookie.dep.yml
generated
Normal file
23
.licenses/npm/tough-cookie.dep.yml
generated
Normal file
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
name: tough-cookie
|
||||
version: 3.0.1
|
||||
type: npm
|
||||
summary: RFC6265 Cookies and Cookie Jar for node.js
|
||||
homepage: https://github.com/salesforce/tough-cookie
|
||||
license: bsd-3-clause
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
text: |
|
||||
Copyright (c) 2015, Salesforce.com, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
notices: []
|
31
.licenses/npm/tslib-2.3.1.dep.yml
generated
Normal file
31
.licenses/npm/tslib-2.3.1.dep.yml
generated
Normal file
|
@ -0,0 +1,31 @@
|
|||
---
|
||||
name: tslib
|
||||
version: 2.3.1
|
||||
type: npm
|
||||
summary: Runtime library for TypeScript helper functions
|
||||
homepage: https://www.typescriptlang.org/
|
||||
license: 0bsd
|
||||
licenses:
|
||||
- sources: LICENSE.txt
|
||||
text: "Copyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify,
|
||||
and/or distribute this software for any\r\npurpose with or without fee is hereby
|
||||
granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL
|
||||
WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
|
||||
RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
|
||||
USE OR\r\nPERFORMANCE OF THIS SOFTWARE."
|
||||
notices:
|
||||
- sources: CopyrightNotice.txt
|
||||
text: "/*! *****************************************************************************\r\nCopyright
|
||||
(c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute
|
||||
this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE
|
||||
SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD
|
||||
TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS.
|
||||
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE,
|
||||
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS
|
||||
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS
|
||||
SOFTWARE.\r\n*****************************************************************************
|
||||
*/"
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: tslib
|
||||
version: 2.6.2
|
||||
version: 2.5.0
|
||||
type: npm
|
||||
summary: Runtime library for TypeScript helper functions
|
||||
homepage: https://www.typescriptlang.org/
|
30
.licenses/npm/undici-types.dep.yml
generated
30
.licenses/npm/undici-types.dep.yml
generated
|
@ -1,30 +0,0 @@
|
|||
---
|
||||
name: undici-types
|
||||
version: 5.26.5
|
||||
type: npm
|
||||
summary: A stand-alone types package for Undici
|
||||
homepage: https://undici.nodejs.org
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: Auto-generated MIT license text
|
||||
text: |
|
||||
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: []
|
25
README.md
25
README.md
|
@ -18,8 +18,8 @@ See [action.yml](action.yml)
|
|||
**Python**
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- run: python my_script.py
|
||||
|
@ -28,23 +28,12 @@ steps:
|
|||
**PyPy**
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 'pypy3.9'
|
||||
- run: python my_script.py
|
||||
```
|
||||
|
||||
**GraalPy**
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 'graalpy-22.3'
|
||||
- run: python my_script.py
|
||||
```
|
||||
|
||||
The `python-version` input is optional. If not supplied, the action will try to resolve the version from the default `.python-version` file. If the `.python-version` file doesn't exist Python or PyPy version from the PATH will be used. The default version of Python or PyPy in PATH varies between runners and can be changed unexpectedly so we recommend always setting Python version explicitly using the `python-version` or `python-version-file` inputs.
|
||||
|
||||
The action will first check the local [tool cache](docs/advanced-usage.md#hosted-tool-cache) for a [semver](https://github.com/npm/node-semver#versions) match. If unable to find a specific version in the tool cache, the action will attempt to download a version of Python from [GitHub Releases](https://github.com/actions/python-versions/releases) and for PyPy from the official [PyPy's dist](https://downloads.python.org/pypy/).
|
||||
|
@ -73,8 +62,8 @@ The action defaults to searching for a dependency file (`requirements.txt` or `p
|
|||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.9'
|
||||
cache: 'pip' # caching pip dependencies
|
||||
|
@ -93,7 +82,7 @@ See examples of using `cache` and `cache-dependency-path` for `pipenv` and `poet
|
|||
- [Check latest version](docs/advanced-usage.md#check-latest-version)
|
||||
- [Caching packages](docs/advanced-usage.md#caching-packages)
|
||||
- [Outputs and environment variables](docs/advanced-usage.md#outputs-and-environment-variables)
|
||||
- [Available versions of Python, PyPy and GraalPy](docs/advanced-usage.md#available-versions-of-python-pypy-and-graalpy)
|
||||
- [Available versions of Python and PyPy](docs/advanced-usage.md#available-versions-of-python-and-pypy)
|
||||
- [Hosted tool cache](docs/advanced-usage.md#hosted-tool-cache)
|
||||
- [Using `setup-python` with a self-hosted runner](docs/advanced-usage.md#using-setup-python-with-a-self-hosted-runner)
|
||||
- [Using `setup-python` on GHES](docs/advanced-usage.md#using-setup-python-on-ghes)
|
||||
|
|
|
@ -8,7 +8,7 @@ import {State} from '../src/cache-distributions/cache-distributor';
|
|||
|
||||
describe('restore-cache', () => {
|
||||
const pipFileLockHash =
|
||||
'f8428d7cf00ea53a5c3702f0a9cb3cc467f76cd86a34723009350c4e4b32751a';
|
||||
'a3bdcc71289e4979ca9e051810d81999cc99823109faf6912e17ff14c8e621a6';
|
||||
const requirementsHash =
|
||||
'd8110e0006d7fb5ee76365d565eef9d37df1d11598b912d3eb66d398d57a1121';
|
||||
const requirementsLinuxHash =
|
||||
|
|
|
@ -4,8 +4,8 @@ verify_ssl = true
|
|||
name = "pypi"
|
||||
|
||||
[packages]
|
||||
flake8 = "==6.0.0"
|
||||
numpy = "==1.25.1"
|
||||
flake8 = "==4.0.1"
|
||||
numpy = "==1.23.0"
|
||||
|
||||
[dev-packages]
|
||||
|
||||
|
|
80
__tests__/data/Pipfile.lock
generated
80
__tests__/data/Pipfile.lock
generated
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"_meta": {
|
||||
"hash": {
|
||||
"sha256": "dcea65dabfe8442466b5e9280ecab72cfa7bf555791ee0ad55b6e7255dca1f43"
|
||||
"sha256": "e9c37110984955621040e2dc8548c026eb8466c23db1b8e69430289b10be8938"
|
||||
},
|
||||
"pipfile-spec": 6,
|
||||
"requires": {
|
||||
|
@ -18,66 +18,62 @@
|
|||
"default": {
|
||||
"flake8": {
|
||||
"hashes": [
|
||||
"sha256:3833794e27ff64ea4e9cf5d410082a8b97ff1a06c16aa3d2027339cd0f1195c7",
|
||||
"sha256:c61007e76655af75e6785a931f452915b371dc48f56efd765247c8fe68f2b181"
|
||||
"sha256:479b1304f72536a55948cb40a32dce8bb0ffe3501e26eaf292c7e60eb5e0428d",
|
||||
"sha256:806e034dda44114815e23c16ef92f95c91e4c71100ff52813adf7132a6ad870d"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==6.0.0"
|
||||
"version": "==4.0.1"
|
||||
},
|
||||
"mccabe": {
|
||||
"hashes": [
|
||||
"sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325",
|
||||
"sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"
|
||||
"sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42",
|
||||
"sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"
|
||||
],
|
||||
"markers": "python_version >= '3.6'",
|
||||
"version": "==0.7.0"
|
||||
"version": "==0.6.1"
|
||||
},
|
||||
"numpy": {
|
||||
"hashes": [
|
||||
"sha256:012097b5b0d00a11070e8f2e261128c44157a8689f7dedcf35576e525893f4fe",
|
||||
"sha256:0d3fe3dd0506a28493d82dc3cf254be8cd0d26f4008a417385cbf1ae95b54004",
|
||||
"sha256:0def91f8af6ec4bb94c370e38c575855bf1d0be8a8fbfba42ef9c073faf2cf19",
|
||||
"sha256:1a180429394f81c7933634ae49b37b472d343cccb5bb0c4a575ac8bbc433722f",
|
||||
"sha256:1d5d3c68e443c90b38fdf8ef40e60e2538a27548b39b12b73132456847f4b631",
|
||||
"sha256:20e1266411120a4f16fad8efa8e0454d21d00b8c7cee5b5ccad7565d95eb42dd",
|
||||
"sha256:247d3ffdd7775bdf191f848be8d49100495114c82c2bd134e8d5d075fb386a1c",
|
||||
"sha256:35a9527c977b924042170a0887de727cd84ff179e478481404c5dc66b4170009",
|
||||
"sha256:38eb6548bb91c421261b4805dc44def9ca1a6eef6444ce35ad1669c0f1a3fc5d",
|
||||
"sha256:3d7abcdd85aea3e6cdddb59af2350c7ab1ed764397f8eec97a038ad244d2d105",
|
||||
"sha256:41a56b70e8139884eccb2f733c2f7378af06c82304959e174f8e7370af112e09",
|
||||
"sha256:4a90725800caeaa160732d6b31f3f843ebd45d6b5f3eec9e8cc287e30f2805bf",
|
||||
"sha256:6b82655dd8efeea69dbf85d00fca40013d7f503212bc5259056244961268b66e",
|
||||
"sha256:6c6c9261d21e617c6dc5eacba35cb68ec36bb72adcff0dee63f8fbc899362588",
|
||||
"sha256:77d339465dff3eb33c701430bcb9c325b60354698340229e1dff97745e6b3efa",
|
||||
"sha256:791f409064d0a69dd20579345d852c59822c6aa087f23b07b1b4e28ff5880fcb",
|
||||
"sha256:9a3a9f3a61480cc086117b426a8bd86869c213fc4072e606f01c4e4b66eb92bf",
|
||||
"sha256:c1516db588987450b85595586605742879e50dcce923e8973f79529651545b57",
|
||||
"sha256:c40571fe966393b212689aa17e32ed905924120737194b5d5c1b20b9ed0fb171",
|
||||
"sha256:d412c1697c3853c6fc3cb9751b4915859c7afe6a277c2bf00acf287d56c4e625",
|
||||
"sha256:d5154b1a25ec796b1aee12ac1b22f414f94752c5f94832f14d8d6c9ac40bcca6",
|
||||
"sha256:d736b75c3f2cb96843a5c7f8d8ccc414768d34b0a75f466c05f3a739b406f10b",
|
||||
"sha256:e8f6049c4878cb16960fbbfb22105e49d13d752d4d8371b55110941fb3b17800",
|
||||
"sha256:f76aebc3358ade9eacf9bc2bb8ae589863a4f911611694103af05346637df1b7",
|
||||
"sha256:fd67b306320dcadea700a8f79b9e671e607f8696e98ec255915c0c6d6b818503"
|
||||
"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",
|
||||
"version": "==1.25.1"
|
||||
"version": "==1.23.0"
|
||||
},
|
||||
"pycodestyle": {
|
||||
"hashes": [
|
||||
"sha256:347187bdb476329d98f695c213d7295a846d1152ff4fe9bacb8a9590b8ee7053",
|
||||
"sha256:8a4eaf0d0495c7395bdab3589ac2db602797d76207242c17d470186815706610"
|
||||
"sha256:720f8b39dde8b293825e7ff02c475f3077124006db4f440dcbc9a20b76548a20",
|
||||
"sha256:eddd5847ef438ea1c7870ca7eb78a9d47ce0cdb4851a5523949f2601d0cbbe7f"
|
||||
],
|
||||
"markers": "python_version >= '3.6'",
|
||||
"version": "==2.10.0"
|
||||
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'",
|
||||
"version": "==2.8.0"
|
||||
},
|
||||
"pyflakes": {
|
||||
"hashes": [
|
||||
"sha256:ec55bf7fe21fff7f1ad2f7da62363d749e2a470500eab1b555334b67aa1ef8cf",
|
||||
"sha256:ec8b276a6b60bd80defed25add7e439881c19e64850afd9b346283d4165fd0fd"
|
||||
"sha256:05a85c2872edf37a4ed30b0cce2f6093e1d0581f8c19d7393122da7e25b2b24c",
|
||||
"sha256:3bb3a3f256f4b7968c9c788781e4ff07dce46bdf12339dcda61053375426ee2e"
|
||||
],
|
||||
"markers": "python_version >= '3.6'",
|
||||
"version": "==3.0.1"
|
||||
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
|
||||
"version": "==2.4.0"
|
||||
}
|
||||
},
|
||||
"develop": {}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,2 +1,2 @@
|
|||
numpy==1.22.3
|
||||
flake8==6.0.0
|
||||
pandas==1.4.2
|
|
@ -1,378 +0,0 @@
|
|||
import fs from 'fs';
|
||||
|
||||
import {HttpClient} from '@actions/http-client';
|
||||
import * as ifm from '@actions/http-client/lib/interfaces';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
import * as exec from '@actions/exec';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
import * as path from 'path';
|
||||
import * as semver from 'semver';
|
||||
|
||||
import * as finder from '../src/find-graalpy';
|
||||
import {IGraalPyManifestRelease, IS_WINDOWS} from '../src/utils';
|
||||
|
||||
import manifestData from './data/graalpy.json';
|
||||
|
||||
const architecture = 'x64';
|
||||
|
||||
const toolDir = path.join(__dirname, 'runner', 'tools');
|
||||
const tempDir = path.join(__dirname, 'runner', 'temp');
|
||||
|
||||
/* GraalPy doesn't have a windows release yet */
|
||||
const describeSkipOnWindows = IS_WINDOWS ? describe.skip : describe;
|
||||
|
||||
describe('parseGraalPyVersion', () => {
|
||||
it.each([
|
||||
['graalpy-23', '23'],
|
||||
['graalpy-23.0', '23.0'],
|
||||
['graalpy23.0', '23.0']
|
||||
])('%s -> %s', (input, expected) => {
|
||||
expect(finder.parseGraalPyVersion(input)).toEqual(expected);
|
||||
});
|
||||
|
||||
it.each(['', 'graalpy-', 'graalpy', 'p', 'notgraalpy-'])(
|
||||
'throw on invalid input "%s"',
|
||||
input => {
|
||||
expect(() => finder.parseGraalPyVersion(input)).toThrow(
|
||||
"Invalid 'version' property for GraalPy. GraalPy version should be specified as 'graalpy<python-version>' or 'graalpy-<python-version>'. See README for examples and documentation."
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
describe('findGraalPyToolCache', () => {
|
||||
const actualGraalPyVersion = '23.0.0';
|
||||
const graalpyPath = path.join('GraalPy', actualGraalPyVersion, architecture);
|
||||
let tcFind: jest.SpyInstance;
|
||||
let infoSpy: jest.SpyInstance;
|
||||
let warningSpy: jest.SpyInstance;
|
||||
let debugSpy: jest.SpyInstance;
|
||||
let addPathSpy: jest.SpyInstance;
|
||||
let exportVariableSpy: jest.SpyInstance;
|
||||
let setOutputSpy: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
tcFind = jest.spyOn(tc, 'find');
|
||||
tcFind.mockImplementation((toolname: string, pythonVersion: string) => {
|
||||
const semverVersion = new semver.Range(pythonVersion);
|
||||
return semver.satisfies(actualGraalPyVersion, semverVersion)
|
||||
? graalpyPath
|
||||
: '';
|
||||
});
|
||||
|
||||
infoSpy = jest.spyOn(core, 'info');
|
||||
infoSpy.mockImplementation(() => null);
|
||||
|
||||
warningSpy = jest.spyOn(core, 'warning');
|
||||
warningSpy.mockImplementation(() => null);
|
||||
|
||||
debugSpy = jest.spyOn(core, 'debug');
|
||||
debugSpy.mockImplementation(() => null);
|
||||
|
||||
addPathSpy = jest.spyOn(core, 'addPath');
|
||||
addPathSpy.mockImplementation(() => null);
|
||||
|
||||
exportVariableSpy = jest.spyOn(core, 'exportVariable');
|
||||
exportVariableSpy.mockImplementation(() => null);
|
||||
|
||||
setOutputSpy = jest.spyOn(core, 'setOutput');
|
||||
setOutputSpy.mockImplementation(() => null);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.resetAllMocks();
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('GraalPy exists on the path and versions are satisfied', () => {
|
||||
expect(finder.findGraalPyToolCache('23.0.0', architecture)).toEqual({
|
||||
installDir: graalpyPath,
|
||||
resolvedGraalPyVersion: actualGraalPyVersion
|
||||
});
|
||||
});
|
||||
|
||||
it('GraalPy exists on the path and versions are satisfied with semver', () => {
|
||||
expect(finder.findGraalPyToolCache('23.0', architecture)).toEqual({
|
||||
installDir: graalpyPath,
|
||||
resolvedGraalPyVersion: actualGraalPyVersion
|
||||
});
|
||||
});
|
||||
|
||||
it("GraalPy exists on the path, but version doesn't match", () => {
|
||||
expect(finder.findGraalPyToolCache('22.3', architecture)).toEqual({
|
||||
installDir: '',
|
||||
resolvedGraalPyVersion: ''
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describeSkipOnWindows('findGraalPyVersion', () => {
|
||||
let getBooleanInputSpy: jest.SpyInstance;
|
||||
let warningSpy: jest.SpyInstance;
|
||||
let debugSpy: jest.SpyInstance;
|
||||
let infoSpy: jest.SpyInstance;
|
||||
let addPathSpy: jest.SpyInstance;
|
||||
let exportVariableSpy: jest.SpyInstance;
|
||||
let setOutputSpy: jest.SpyInstance;
|
||||
let tcFind: jest.SpyInstance;
|
||||
let spyExtractZip: jest.SpyInstance;
|
||||
let spyExtractTar: jest.SpyInstance;
|
||||
let spyHttpClient: jest.SpyInstance;
|
||||
let spyExistsSync: jest.SpyInstance;
|
||||
let spyExec: jest.SpyInstance;
|
||||
let spySymlinkSync: jest.SpyInstance;
|
||||
let spyDownloadTool: jest.SpyInstance;
|
||||
let spyFsReadDir: jest.SpyInstance;
|
||||
let spyCacheDir: jest.SpyInstance;
|
||||
let spyChmodSync: jest.SpyInstance;
|
||||
let spyCoreAddPath: jest.SpyInstance;
|
||||
let spyCoreExportVariable: jest.SpyInstance;
|
||||
const env = process.env;
|
||||
|
||||
beforeEach(() => {
|
||||
getBooleanInputSpy = jest.spyOn(core, 'getBooleanInput');
|
||||
getBooleanInputSpy.mockImplementation(() => false);
|
||||
|
||||
infoSpy = jest.spyOn(core, 'info');
|
||||
infoSpy.mockImplementation(() => {});
|
||||
|
||||
warningSpy = jest.spyOn(core, 'warning');
|
||||
warningSpy.mockImplementation(() => null);
|
||||
|
||||
debugSpy = jest.spyOn(core, 'debug');
|
||||
debugSpy.mockImplementation(() => null);
|
||||
|
||||
addPathSpy = jest.spyOn(core, 'addPath');
|
||||
addPathSpy.mockImplementation(() => null);
|
||||
|
||||
exportVariableSpy = jest.spyOn(core, 'exportVariable');
|
||||
exportVariableSpy.mockImplementation(() => null);
|
||||
|
||||
setOutputSpy = jest.spyOn(core, 'setOutput');
|
||||
setOutputSpy.mockImplementation(() => null);
|
||||
|
||||
jest.resetModules();
|
||||
process.env = {...env};
|
||||
tcFind = jest.spyOn(tc, 'find');
|
||||
tcFind.mockImplementation((tool: string, version: string) => {
|
||||
const semverRange = new semver.Range(version);
|
||||
let graalpyPath = '';
|
||||
if (semver.satisfies('23.0.0', semverRange)) {
|
||||
graalpyPath = path.join(toolDir, 'GraalPy', '23.0.0', architecture);
|
||||
}
|
||||
return graalpyPath;
|
||||
});
|
||||
|
||||
spyDownloadTool = jest.spyOn(tc, 'downloadTool');
|
||||
spyDownloadTool.mockImplementation(() => path.join(tempDir, 'GraalPy'));
|
||||
|
||||
spyExtractZip = jest.spyOn(tc, 'extractZip');
|
||||
spyExtractZip.mockImplementation(() => tempDir);
|
||||
|
||||
spyExtractTar = jest.spyOn(tc, 'extractTar');
|
||||
spyExtractTar.mockImplementation(() => tempDir);
|
||||
|
||||
spyFsReadDir = jest.spyOn(fs, 'readdirSync');
|
||||
spyFsReadDir.mockImplementation((directory: string) => ['GraalPyTest']);
|
||||
|
||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||
spyHttpClient.mockImplementation(
|
||||
async (): Promise<ifm.TypedResponse<IGraalPyManifestRelease[]>> => {
|
||||
const result = JSON.stringify(manifestData);
|
||||
return {
|
||||
statusCode: 200,
|
||||
headers: {},
|
||||
result: JSON.parse(result) as IGraalPyManifestRelease[]
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
spyExec = jest.spyOn(exec, 'exec');
|
||||
spyExec.mockImplementation(() => undefined);
|
||||
|
||||
spySymlinkSync = jest.spyOn(fs, 'symlinkSync');
|
||||
spySymlinkSync.mockImplementation(() => undefined);
|
||||
|
||||
spyExistsSync = jest.spyOn(fs, 'existsSync');
|
||||
spyExistsSync.mockReturnValue(true);
|
||||
|
||||
spyCoreAddPath = jest.spyOn(core, 'addPath');
|
||||
|
||||
spyCoreExportVariable = jest.spyOn(core, 'exportVariable');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.resetAllMocks();
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
process.env = env;
|
||||
});
|
||||
|
||||
it('found GraalPy in toolcache', async () => {
|
||||
await expect(
|
||||
finder.findGraalPyVersion(
|
||||
'graalpy-23.0',
|
||||
architecture,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
)
|
||||
).resolves.toEqual('23.0.0');
|
||||
expect(spyCoreAddPath).toHaveBeenCalled();
|
||||
expect(spyCoreExportVariable).toHaveBeenCalledWith(
|
||||
'pythonLocation',
|
||||
expect.anything()
|
||||
);
|
||||
expect(spyCoreExportVariable).toHaveBeenCalledWith(
|
||||
'PKG_CONFIG_PATH',
|
||||
expect.anything()
|
||||
);
|
||||
});
|
||||
|
||||
it('throw on invalid input format', async () => {
|
||||
await expect(
|
||||
finder.findGraalPyVersion('graalpy-x23', architecture, true, false, false)
|
||||
).rejects.toThrow();
|
||||
});
|
||||
|
||||
it('found and install successfully', async () => {
|
||||
spyCacheDir = jest.spyOn(tc, 'cacheDir');
|
||||
spyCacheDir.mockImplementation(() =>
|
||||
path.join(toolDir, 'GraalPy', '23.0.0', architecture)
|
||||
);
|
||||
spyChmodSync = jest.spyOn(fs, 'chmodSync');
|
||||
spyChmodSync.mockImplementation(() => undefined);
|
||||
await expect(
|
||||
finder.findGraalPyVersion(
|
||||
'graalpy-23.0.0',
|
||||
architecture,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
)
|
||||
).resolves.toEqual('23.0.0');
|
||||
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, 'GraalPy', '23.0.0', architecture)
|
||||
);
|
||||
spyChmodSync = jest.spyOn(fs, 'chmodSync');
|
||||
spyChmodSync.mockImplementation(() => undefined);
|
||||
await expect(
|
||||
finder.findGraalPyVersion(
|
||||
'graalpy-23.0.0',
|
||||
architecture,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
)
|
||||
).resolves.toEqual('23.0.0');
|
||||
expect(spyCoreAddPath).not.toHaveBeenCalled();
|
||||
expect(spyCoreExportVariable).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('throw if release is not found', async () => {
|
||||
await expect(
|
||||
finder.findGraalPyVersion(
|
||||
'graalpy-19.0.0',
|
||||
architecture,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
)
|
||||
).rejects.toThrow(
|
||||
`GraalPy version 19.0.0 with arch ${architecture} not found`
|
||||
);
|
||||
});
|
||||
|
||||
it('check-latest enabled version found and used from toolcache', async () => {
|
||||
await expect(
|
||||
finder.findGraalPyVersion(
|
||||
'graalpy-23.0.0',
|
||||
architecture,
|
||||
false,
|
||||
true,
|
||||
false
|
||||
)
|
||||
).resolves.toEqual('23.0.0');
|
||||
|
||||
expect(infoSpy).toHaveBeenCalledWith('Resolved as GraalPy 23.0.0');
|
||||
});
|
||||
|
||||
it('check-latest enabled version found and install successfully', async () => {
|
||||
spyCacheDir = jest.spyOn(tc, 'cacheDir');
|
||||
spyCacheDir.mockImplementation(() =>
|
||||
path.join(toolDir, 'GraalPy', '23.0.0', architecture)
|
||||
);
|
||||
spyChmodSync = jest.spyOn(fs, 'chmodSync');
|
||||
spyChmodSync.mockImplementation(() => undefined);
|
||||
await expect(
|
||||
finder.findGraalPyVersion(
|
||||
'graalpy-23.0.0',
|
||||
architecture,
|
||||
false,
|
||||
true,
|
||||
false
|
||||
)
|
||||
).resolves.toEqual('23.0.0');
|
||||
expect(infoSpy).toHaveBeenCalledWith('Resolved as GraalPy 23.0.0');
|
||||
});
|
||||
|
||||
it('check-latest enabled version is not found and used from toolcache', async () => {
|
||||
tcFind.mockImplementationOnce((tool: string, version: string) => {
|
||||
const semverRange = new semver.Range(version);
|
||||
let graalpyPath = '';
|
||||
if (semver.satisfies('22.3.4', semverRange)) {
|
||||
graalpyPath = path.join(toolDir, 'GraalPy', '22.3.4', architecture);
|
||||
}
|
||||
return graalpyPath;
|
||||
});
|
||||
await expect(
|
||||
finder.findGraalPyVersion(
|
||||
'graalpy-22.3.4',
|
||||
architecture,
|
||||
false,
|
||||
true,
|
||||
false
|
||||
)
|
||||
).resolves.toEqual('22.3.4');
|
||||
|
||||
expect(infoSpy).toHaveBeenCalledWith(
|
||||
'Failed to resolve GraalPy 22.3.4 from manifest'
|
||||
);
|
||||
});
|
||||
|
||||
it('found and install successfully, pre-release fallback', async () => {
|
||||
spyCacheDir = jest.spyOn(tc, 'cacheDir');
|
||||
spyCacheDir.mockImplementation(() =>
|
||||
path.join(toolDir, 'GraalPy', '23.1', architecture)
|
||||
);
|
||||
spyChmodSync = jest.spyOn(fs, 'chmodSync');
|
||||
spyChmodSync.mockImplementation(() => undefined);
|
||||
await expect(
|
||||
finder.findGraalPyVersion(
|
||||
'graalpy23.1',
|
||||
architecture,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
)
|
||||
).rejects.toThrow();
|
||||
await expect(
|
||||
finder.findGraalPyVersion('graalpy23.1', architecture, false, false, true)
|
||||
).resolves.toEqual('23.1.0-a.1');
|
||||
});
|
||||
});
|
|
@ -2,7 +2,7 @@ import fs from 'fs';
|
|||
|
||||
import * as utils from '../src/utils';
|
||||
import {HttpClient} from '@actions/http-client';
|
||||
import * as ifm from '@actions/http-client/lib/interfaces';
|
||||
import * as ifm from '@actions/http-client/interfaces';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
import * as exec from '@actions/exec';
|
||||
import * as core from '@actions/core';
|
||||
|
@ -240,7 +240,7 @@ describe('findPyPyVersion', () => {
|
|||
|
||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||
spyHttpClient.mockImplementation(
|
||||
async (): Promise<ifm.TypedResponse<IPyPyManifestRelease[]>> => {
|
||||
async (): Promise<ifm.ITypedResponse<IPyPyManifestRelease[]>> => {
|
||||
const result = JSON.stringify(manifestData);
|
||||
return {
|
||||
statusCode: 200,
|
||||
|
|
|
@ -1,256 +0,0 @@
|
|||
import fs from 'fs';
|
||||
|
||||
import {HttpClient} from '@actions/http-client';
|
||||
import * as ifm from '@actions/http-client/lib/interfaces';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
import * as exec from '@actions/exec';
|
||||
import * as core from '@actions/core';
|
||||
import * as path from 'path';
|
||||
|
||||
import * as installer from '../src/install-graalpy';
|
||||
import {
|
||||
IGraalPyManifestRelease,
|
||||
IGraalPyManifestAsset,
|
||||
IS_WINDOWS
|
||||
} from '../src/utils';
|
||||
|
||||
import manifestData from './data/graalpy.json';
|
||||
|
||||
const architecture = 'x64';
|
||||
|
||||
const toolDir = path.join(__dirname, 'runner', 'tools');
|
||||
const tempDir = path.join(__dirname, 'runner', 'temp');
|
||||
|
||||
/* GraalPy doesn't have a windows release yet */
|
||||
const describeSkipOnWindows = IS_WINDOWS ? describe.skip : describe;
|
||||
|
||||
describe('graalpyVersionToSemantic', () => {
|
||||
it.each([
|
||||
['23.0.0a1', '23.0.0a1'],
|
||||
['23.0.0', '23.0.0'],
|
||||
['23.0.x', '23.0.x'],
|
||||
['23.x', '23.x']
|
||||
])('%s -> %s', (input, expected) => {
|
||||
expect(installer.graalPyTagToVersion(input)).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
||||
describeSkipOnWindows('findRelease', () => {
|
||||
const result = JSON.stringify(manifestData);
|
||||
const releases = JSON.parse(result) as IGraalPyManifestRelease[];
|
||||
const extension = 'tar.gz';
|
||||
const arch = installer.toGraalPyArchitecture(architecture);
|
||||
const platform = installer.toGraalPyPlatform(process.platform);
|
||||
const extensionName = `${platform}-${arch}.${extension}`;
|
||||
const files: IGraalPyManifestAsset = {
|
||||
name: `graalpython-23.0.0-${extensionName}`,
|
||||
browser_download_url: `https://github.com/oracle/graalpython/releases/download/graal-23.0.0/graalpython-23.0.0-${extensionName}`
|
||||
};
|
||||
const filesRC1: IGraalPyManifestAsset = {
|
||||
name: `graalpython-23.1.0a1-${extensionName}`,
|
||||
browser_download_url: `https://github.com/oracle/graalpython/releases/download/graal-23.1.0a1/graalpython-23.1.0a1-${extensionName}`
|
||||
};
|
||||
|
||||
let warningSpy: jest.SpyInstance;
|
||||
let debugSpy: jest.SpyInstance;
|
||||
let infoSpy: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
infoSpy = jest.spyOn(core, 'info');
|
||||
infoSpy.mockImplementation(() => {});
|
||||
|
||||
warningSpy = jest.spyOn(core, 'warning');
|
||||
warningSpy.mockImplementation(() => null);
|
||||
|
||||
debugSpy = jest.spyOn(core, 'debug');
|
||||
debugSpy.mockImplementation(() => null);
|
||||
});
|
||||
|
||||
it("GraalPy version doesn't match", () => {
|
||||
const graalpyVersion = '12.0.0';
|
||||
expect(
|
||||
installer.findRelease(releases, graalpyVersion, architecture, false)
|
||||
).toEqual(null);
|
||||
});
|
||||
|
||||
it('GraalPy version matches', () => {
|
||||
const graalpyVersion = '23.0.0';
|
||||
expect(
|
||||
installer.findRelease(releases, graalpyVersion, architecture, false)
|
||||
).toMatchObject({
|
||||
foundAsset: files,
|
||||
resolvedGraalPyVersion: graalpyVersion
|
||||
});
|
||||
});
|
||||
|
||||
it('Preview version of GraalPy is found', () => {
|
||||
const graalpyVersion = installer.graalPyTagToVersion('vm-23.1.0a1');
|
||||
expect(
|
||||
installer.findRelease(releases, graalpyVersion, architecture, false)
|
||||
).toMatchObject({
|
||||
foundAsset: {
|
||||
name: `graalpython-23.1.0a1-${extensionName}`,
|
||||
browser_download_url: `https://github.com/oracle/graalpython/releases/download/graal-23.1.0a1/graalpython-23.1.0a1-${extensionName}`
|
||||
},
|
||||
resolvedGraalPyVersion: '23.1.0-a.1'
|
||||
});
|
||||
});
|
||||
|
||||
it('Latest GraalPy is found', () => {
|
||||
const graalpyVersion = 'x';
|
||||
expect(
|
||||
installer.findRelease(releases, graalpyVersion, architecture, false)
|
||||
).toMatchObject({
|
||||
foundAsset: files,
|
||||
resolvedGraalPyVersion: '23.0.0'
|
||||
});
|
||||
});
|
||||
|
||||
it('GraalPy version matches semver (pre-release)', () => {
|
||||
const graalpyVersion = '23.1.x';
|
||||
expect(
|
||||
installer.findRelease(releases, graalpyVersion, architecture, false)
|
||||
).toBeNull();
|
||||
expect(
|
||||
installer.findRelease(releases, graalpyVersion, architecture, true)
|
||||
).toMatchObject({
|
||||
foundAsset: filesRC1,
|
||||
resolvedGraalPyVersion: '23.1.0-a.1'
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describeSkipOnWindows('installGraalPy', () => {
|
||||
let tcFind: jest.SpyInstance;
|
||||
let warningSpy: jest.SpyInstance;
|
||||
let debugSpy: jest.SpyInstance;
|
||||
let infoSpy: jest.SpyInstance;
|
||||
let spyExtractZip: jest.SpyInstance;
|
||||
let spyExtractTar: jest.SpyInstance;
|
||||
let spyFsReadDir: jest.SpyInstance;
|
||||
let spyFsWriteFile: jest.SpyInstance;
|
||||
let spyHttpClient: jest.SpyInstance;
|
||||
let spyExistsSync: jest.SpyInstance;
|
||||
let spyExec: jest.SpyInstance;
|
||||
let spySymlinkSync: jest.SpyInstance;
|
||||
let spyDownloadTool: jest.SpyInstance;
|
||||
let spyCacheDir: jest.SpyInstance;
|
||||
let spyChmodSync: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
tcFind = jest.spyOn(tc, 'find');
|
||||
tcFind.mockImplementation(() =>
|
||||
path.join('GraalPy', '3.6.12', architecture)
|
||||
);
|
||||
|
||||
spyDownloadTool = jest.spyOn(tc, 'downloadTool');
|
||||
spyDownloadTool.mockImplementation(() => path.join(tempDir, 'GraalPy'));
|
||||
|
||||
spyExtractZip = jest.spyOn(tc, 'extractZip');
|
||||
spyExtractZip.mockImplementation(() => tempDir);
|
||||
|
||||
spyExtractTar = jest.spyOn(tc, 'extractTar');
|
||||
spyExtractTar.mockImplementation(() => tempDir);
|
||||
|
||||
infoSpy = jest.spyOn(core, 'info');
|
||||
infoSpy.mockImplementation(() => {});
|
||||
|
||||
warningSpy = jest.spyOn(core, 'warning');
|
||||
warningSpy.mockImplementation(() => null);
|
||||
|
||||
debugSpy = jest.spyOn(core, 'debug');
|
||||
debugSpy.mockImplementation(() => null);
|
||||
|
||||
spyFsReadDir = jest.spyOn(fs, 'readdirSync');
|
||||
spyFsReadDir.mockImplementation(() => ['GraalPyTest']);
|
||||
|
||||
spyFsWriteFile = jest.spyOn(fs, 'writeFileSync');
|
||||
spyFsWriteFile.mockImplementation(() => undefined);
|
||||
|
||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||
spyHttpClient.mockImplementation(
|
||||
async (): Promise<ifm.TypedResponse<IGraalPyManifestRelease[]>> => {
|
||||
const result = JSON.stringify(manifestData);
|
||||
return {
|
||||
statusCode: 200,
|
||||
headers: {},
|
||||
result: JSON.parse(result) as IGraalPyManifestRelease[]
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
spyExec = jest.spyOn(exec, 'exec');
|
||||
spyExec.mockImplementation(() => undefined);
|
||||
|
||||
spySymlinkSync = jest.spyOn(fs, 'symlinkSync');
|
||||
spySymlinkSync.mockImplementation(() => undefined);
|
||||
|
||||
spyExistsSync = jest.spyOn(fs, 'existsSync');
|
||||
spyExistsSync.mockImplementation(() => false);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.resetAllMocks();
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('throw if release is not found', async () => {
|
||||
await expect(
|
||||
installer.installGraalPy('7.3.3', architecture, false, undefined)
|
||||
).rejects.toThrow(
|
||||
`GraalPy version 7.3.3 with arch ${architecture} not found`
|
||||
);
|
||||
|
||||
expect(spyHttpClient).toHaveBeenCalled();
|
||||
expect(spyDownloadTool).not.toHaveBeenCalled();
|
||||
expect(spyExec).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('found and install GraalPy', async () => {
|
||||
spyCacheDir = jest.spyOn(tc, 'cacheDir');
|
||||
spyCacheDir.mockImplementation(() =>
|
||||
path.join(toolDir, 'GraalPy', '21.3.0', architecture)
|
||||
);
|
||||
|
||||
spyChmodSync = jest.spyOn(fs, 'chmodSync');
|
||||
spyChmodSync.mockImplementation(() => undefined);
|
||||
|
||||
await expect(
|
||||
installer.installGraalPy('21.x', architecture, false, undefined)
|
||||
).resolves.toEqual({
|
||||
installDir: path.join(toolDir, 'GraalPy', '21.3.0', architecture),
|
||||
resolvedGraalPyVersion: '21.3.0'
|
||||
});
|
||||
|
||||
expect(spyHttpClient).toHaveBeenCalled();
|
||||
expect(spyDownloadTool).toHaveBeenCalled();
|
||||
expect(spyCacheDir).toHaveBeenCalled();
|
||||
expect(spyExec).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('found and install GraalPy, pre-release fallback', async () => {
|
||||
spyCacheDir = jest.spyOn(tc, 'cacheDir');
|
||||
spyCacheDir.mockImplementation(() =>
|
||||
path.join(toolDir, 'GraalPy', '23.1.0', architecture)
|
||||
);
|
||||
|
||||
spyChmodSync = jest.spyOn(fs, 'chmodSync');
|
||||
spyChmodSync.mockImplementation(() => undefined);
|
||||
|
||||
await expect(
|
||||
installer.installGraalPy('23.1.x', architecture, false, undefined)
|
||||
).rejects.toThrow();
|
||||
await expect(
|
||||
installer.installGraalPy('23.1.x', architecture, true, undefined)
|
||||
).resolves.toEqual({
|
||||
installDir: path.join(toolDir, 'GraalPy', '23.1.0', architecture),
|
||||
resolvedGraalPyVersion: '23.1.0-a.1'
|
||||
});
|
||||
|
||||
expect(spyHttpClient).toHaveBeenCalled();
|
||||
expect(spyDownloadTool).toHaveBeenCalled();
|
||||
expect(spyCacheDir).toHaveBeenCalled();
|
||||
expect(spyExec).toHaveBeenCalled();
|
||||
});
|
||||
});
|
|
@ -1,7 +1,7 @@
|
|||
import fs from 'fs';
|
||||
|
||||
import {HttpClient} from '@actions/http-client';
|
||||
import * as ifm from '@actions/http-client/lib/interfaces';
|
||||
import * as ifm from '@actions/http-client/interfaces';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
import * as exec from '@actions/exec';
|
||||
import * as core from '@actions/core';
|
||||
|
@ -265,7 +265,7 @@ describe('installPyPy', () => {
|
|||
|
||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||
spyHttpClient.mockImplementation(
|
||||
async (): Promise<ifm.TypedResponse<IPyPyManifestRelease[]>> => {
|
||||
async (): Promise<ifm.ITypedResponse<IPyPyManifestRelease[]>> => {
|
||||
const result = JSON.stringify(manifestData);
|
||||
return {
|
||||
statusCode: 200,
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
import numpy as np
|
||||
|
||||
a = np.array([2, 3, 4])
|
||||
print(type(a))
|
||||
|
||||
b = np.array([1.2, 3.5, 5.1])
|
||||
print(type(b))
|
|
@ -1,18 +1,9 @@
|
|||
import * as cache from '@actions/cache';
|
||||
import * as core from '@actions/core';
|
||||
import * as io from '@actions/io';
|
||||
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
import {
|
||||
validateVersion,
|
||||
validatePythonVersionFormatForPyPy,
|
||||
isCacheFeatureAvailable,
|
||||
getVersionInputFromFile,
|
||||
getVersionInputFromPlainFile,
|
||||
getVersionInputFromTomlFile,
|
||||
getNextPageUrl
|
||||
isCacheFeatureAvailable
|
||||
} from '../src/utils';
|
||||
|
||||
jest.mock('@actions/cache');
|
||||
|
@ -82,80 +73,3 @@ describe('isCacheFeatureAvailable', () => {
|
|||
expect(isCacheFeatureAvailable()).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
const tempDir = path.join(
|
||||
__dirname,
|
||||
'runner',
|
||||
path.join(Math.random().toString(36).substring(7)),
|
||||
'temp'
|
||||
);
|
||||
|
||||
describe('Version from file test', () => {
|
||||
it.each([getVersionInputFromPlainFile, getVersionInputFromFile])(
|
||||
'Version from plain file test',
|
||||
async _fn => {
|
||||
await io.mkdirP(tempDir);
|
||||
const pythonVersionFileName = 'python-version.file';
|
||||
const pythonVersionFilePath = path.join(tempDir, pythonVersionFileName);
|
||||
const pythonVersionFileContent = '3.7';
|
||||
fs.writeFileSync(pythonVersionFilePath, pythonVersionFileContent);
|
||||
expect(_fn(pythonVersionFilePath)).toEqual([pythonVersionFileContent]);
|
||||
}
|
||||
);
|
||||
it.each([getVersionInputFromTomlFile, getVersionInputFromFile])(
|
||||
'Version from standard pyproject.toml test',
|
||||
async _fn => {
|
||||
await io.mkdirP(tempDir);
|
||||
const pythonVersionFileName = 'pyproject.toml';
|
||||
const pythonVersionFilePath = path.join(tempDir, pythonVersionFileName);
|
||||
const pythonVersion = '>=3.7.0';
|
||||
const pythonVersionFileContent = `[project]\nrequires-python = "${pythonVersion}"`;
|
||||
fs.writeFileSync(pythonVersionFilePath, pythonVersionFileContent);
|
||||
expect(_fn(pythonVersionFilePath)).toEqual([pythonVersion]);
|
||||
}
|
||||
);
|
||||
it.each([getVersionInputFromTomlFile, getVersionInputFromFile])(
|
||||
'Version from poetry pyproject.toml test',
|
||||
async _fn => {
|
||||
await io.mkdirP(tempDir);
|
||||
const pythonVersionFileName = 'pyproject.toml';
|
||||
const pythonVersionFilePath = path.join(tempDir, pythonVersionFileName);
|
||||
const pythonVersion = '>=3.7.0';
|
||||
const pythonVersionFileContent = `[tool.poetry.dependencies]\npython = "${pythonVersion}"`;
|
||||
fs.writeFileSync(pythonVersionFilePath, pythonVersionFileContent);
|
||||
expect(_fn(pythonVersionFilePath)).toEqual([pythonVersion]);
|
||||
}
|
||||
);
|
||||
it.each([getVersionInputFromTomlFile, getVersionInputFromFile])(
|
||||
'Version undefined',
|
||||
async _fn => {
|
||||
await io.mkdirP(tempDir);
|
||||
const pythonVersionFileName = 'pyproject.toml';
|
||||
const pythonVersionFilePath = path.join(tempDir, pythonVersionFileName);
|
||||
fs.writeFileSync(pythonVersionFilePath, ``);
|
||||
expect(_fn(pythonVersionFilePath)).toEqual([]);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
describe('getNextPageUrl', () => {
|
||||
it('GitHub API pagination next page is parsed correctly', () => {
|
||||
function generateResponse(link: string) {
|
||||
return {
|
||||
statusCode: 200,
|
||||
result: null,
|
||||
headers: {
|
||||
link: link
|
||||
}
|
||||
};
|
||||
}
|
||||
const page1Links =
|
||||
'<https://api.github.com/repositories/129883600/releases?page=2>; rel="next", <https://api.github.com/repositories/129883600/releases?page=3>; rel="last"';
|
||||
expect(getNextPageUrl(generateResponse(page1Links))).toStrictEqual(
|
||||
'https://api.github.com/repositories/129883600/releases?page=2'
|
||||
);
|
||||
const page2Links =
|
||||
'<https://api.github.com/repositories/129883600/releases?page=1>; rel="prev", <https://api.github.com/repositories/129883600/releases?page=1>; rel="first"';
|
||||
expect(getNextPageUrl(generateResponse(page2Links))).toBeNull();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -34,7 +34,7 @@ outputs:
|
|||
python-path:
|
||||
description: "The absolute path to the Python or PyPy executable."
|
||||
runs:
|
||||
using: 'node20'
|
||||
using: 'node16'
|
||||
main: 'dist/setup/index.js'
|
||||
post: 'dist/cache-save/index.js'
|
||||
post-if: success()
|
||||
|
|
35592
dist/cache-save/index.js
vendored
35592
dist/cache-save/index.js
vendored
File diff suppressed because one or more lines are too long
40513
dist/setup/index.js
vendored
40513
dist/setup/index.js
vendored
File diff suppressed because one or more lines are too long
|
@ -2,7 +2,7 @@
|
|||
- [Using the python-version input](advanced-usage.md#using-the-python-version-input)
|
||||
- [Specifying a Python version](advanced-usage.md#specifying-a-python-version)
|
||||
- [Specifying a PyPy version](advanced-usage.md#specifying-a-pypy-version)
|
||||
- [Specifying multiple Python/PyPy versions](advanced-usage.md#specifying-multiple-pythonpypy-versions)
|
||||
- [Specifying multiple Python and PyPy versions](advanced-usage.md#specifying-multiple-python/pypy-version)
|
||||
- [Matrix Testing](advanced-usage.md#matrix-testing)
|
||||
- [Using the python-version-file input](advanced-usage.md#using-the-python-version-file-input)
|
||||
- [Check latest version](advanced-usage.md#check-latest-version)
|
||||
|
@ -11,10 +11,9 @@
|
|||
- [Outputs](advanced-usage.md#outputs)
|
||||
- [Environment variables](advanced-usage.md#environment-variables)
|
||||
- [Using update-environment flag](advanced-usage.md#using-update-environment-flag)
|
||||
- [Available versions of Python and PyPy](advanced-usage.md#available-versions-of-python-pypy-and-graalpy)
|
||||
- [Available versions of Python and PyPy](advanced-usage.md#available-versions-of-python-and-pypy)
|
||||
- [Python](advanced-usage.md#python)
|
||||
- [PyPy](advanced-usage.md#pypy)
|
||||
- [GraalPy](advanced-usage.md#graalpy)
|
||||
- [Hosted tool cache](advanced-usage.md#hosted-tool-cache)
|
||||
- [Using `setup-python` with a self-hosted runner](advanced-usage.md#using-setup-python-with-a-self-hosted-runner)
|
||||
- [Windows](advanced-usage.md#windows)
|
||||
|
@ -31,8 +30,8 @@ If there is a specific version of Python that you need and you don't want to wor
|
|||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.7.5'
|
||||
- run: python my_script.py
|
||||
|
@ -45,8 +44,8 @@ You can specify **only a major and minor version** if you are okay with the most
|
|||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.7'
|
||||
- run: python my_script.py
|
||||
|
@ -59,8 +58,8 @@ You can specify the version with **prerelease tag** to download and set up an ac
|
|||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.12.0-alpha.1'
|
||||
- run: python my_script.py
|
||||
|
@ -70,8 +69,8 @@ It's also possible to use **x.y-dev syntax** to download and set up the latest p
|
|||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.12-dev'
|
||||
- run: python my_script.py
|
||||
|
@ -79,23 +78,12 @@ steps:
|
|||
|
||||
You can also use several types of ranges that are specified in [semver](https://github.com/npm/node-semver#ranges), for instance:
|
||||
|
||||
- **[ranges](https://github.com/npm/node-semver#ranges)** to download and set up the latest available version of Python satisfying a range:
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '>=3.9 <3.10'
|
||||
- run: python my_script.py
|
||||
```
|
||||
|
||||
- **[hyphen ranges](https://github.com/npm/node-semver#hyphen-ranges-xyz---abc)** to download and set up the latest available version of Python (includes both pre-release and stable versions):
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.12.0-alpha - 3.12.0'
|
||||
- run: python my_script.py
|
||||
|
@ -105,8 +93,8 @@ steps:
|
|||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- run: python my_script.py
|
||||
|
@ -118,7 +106,7 @@ The version of PyPy should be specified in the format `pypy<python_version>[-v<p
|
|||
The `-v<pypy_version>` parameter is optional and can be skipped. The latest PyPy version will be used in this case.
|
||||
|
||||
```
|
||||
pypy3.9 or pypy-3.9 # the latest available version of PyPy that supports Python 3.9
|
||||
pypy3.8 or 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
|
||||
pypy3.7-v7.3.3 or 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
|
||||
|
@ -138,15 +126,15 @@ jobs:
|
|||
- 'pypy3.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
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- run: python my_script.py
|
||||
```
|
||||
More details on PyPy syntax can be found in the [Available versions of PyPy](#pypy) section.
|
||||
|
||||
### Specifying multiple Python/PyPy versions
|
||||
### Specifying multiple Python/PyPy version
|
||||
The python-version input can get multiple python/pypy versions. The last specified version will be used as a default one.
|
||||
|
||||
Download and set up multiple Python versions:
|
||||
|
@ -156,8 +144,8 @@ jobs:
|
|||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: |
|
||||
3.8
|
||||
|
@ -173,8 +161,8 @@ jobs:
|
|||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: |
|
||||
pypy-3.7-v7.3.x
|
||||
|
@ -190,8 +178,8 @@ jobs:
|
|||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: |
|
||||
3.8
|
||||
|
@ -212,12 +200,12 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [ '2.x', '3.x', 'pypy2.7', 'pypy3.8', 'pypy3.9' ]
|
||||
python-version: [ '2.x', '3.x', 'pypy2.7', 'pypy3.7', 'pypy3.8' ]
|
||||
name: Python ${{ matrix.python-version }} sample
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
architecture: x64
|
||||
|
@ -233,16 +221,16 @@ jobs:
|
|||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
python-version: ['2.7', '3.7', '3.8', '3.9', '3.10', 'pypy2.7', 'pypy3.9']
|
||||
python-version: ['2.7', '3.7', '3.8', '3.9', '3.10', 'pypy2.7', 'pypy3.8']
|
||||
exclude:
|
||||
- os: macos-latest
|
||||
python-version: '3.8'
|
||||
- os: windows-latest
|
||||
python-version: '3.6'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Display Python version
|
||||
|
@ -257,22 +245,12 @@ jobs:
|
|||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version-file: '.python-version' # Read python version from a file .python-version
|
||||
- run: python my_script.py
|
||||
```
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version-file: 'pyproject.toml' # Read python version from a file pyproject.toml
|
||||
- run: python my_script.py
|
||||
```
|
||||
|
||||
## Check latest version
|
||||
|
||||
The `check-latest` flag defaults to `false`. Use the default or set `check-latest` to `false` if you prefer stability and if you want to ensure a specific `Python or PyPy` version is always used.
|
||||
|
@ -281,8 +259,8 @@ If `check-latest` is set to `true`, the action first checks if the cached versio
|
|||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.7'
|
||||
check-latest: true
|
||||
|
@ -296,8 +274,8 @@ steps:
|
|||
**Caching pipenv dependencies:**
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.9'
|
||||
cache: 'pipenv'
|
||||
|
@ -309,10 +287,10 @@ steps:
|
|||
**Caching poetry dependencies:**
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install poetry
|
||||
run: pipx install poetry
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.9'
|
||||
cache: 'poetry'
|
||||
|
@ -323,8 +301,8 @@ steps:
|
|||
**Using a list of file paths to cache dependencies**
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.9'
|
||||
cache: 'pipenv'
|
||||
|
@ -338,8 +316,8 @@ steps:
|
|||
**Using wildcard patterns to cache dependencies**
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.9'
|
||||
cache: 'pip'
|
||||
|
@ -350,8 +328,8 @@ steps:
|
|||
**Using a list of wildcard patterns to cache dependencies**
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.10'
|
||||
cache: 'pip'
|
||||
|
@ -365,8 +343,8 @@ steps:
|
|||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.11'
|
||||
cache: 'pip'
|
||||
|
@ -388,8 +366,8 @@ jobs:
|
|||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
id: cp310
|
||||
with:
|
||||
python-version: "3.8.0 - 3.10.0"
|
||||
|
@ -405,8 +383,8 @@ jobs:
|
|||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
id: cp310
|
||||
with:
|
||||
python-version: "3.10"
|
||||
|
@ -421,13 +399,13 @@ jobs:
|
|||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
id: cp310
|
||||
with:
|
||||
python-version: "3.8.0"
|
||||
cache: "poetry"
|
||||
- run: echo '${{ steps.cp310.outputs.cache-hit }}' # true if cache-hit occurred on the primary key
|
||||
- run: echo '${{ steps.cp310.outputs.cache-hit }}' # true if cache-hit occured on the primary key
|
||||
```
|
||||
|
||||
## Environment variables
|
||||
|
@ -452,15 +430,15 @@ Such a requirement on side-effect could be because you don't want your composite
|
|||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- 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
|
||||
```
|
||||
## Available versions of Python, PyPy and GraalPy
|
||||
## Available versions of Python and PyPy
|
||||
### Python
|
||||
|
||||
`setup-python` is able to configure **Python** from two sources:
|
||||
|
@ -491,11 +469,6 @@ Such a requirement on side-effect could be because you don't want your composite
|
|||
- PyPy < 7.3.3 are not available to install on-flight.
|
||||
- If some versions are not available, you can open an issue in https://foss.heptapod.net/pypy/pypy/
|
||||
|
||||
### GraalPy
|
||||
|
||||
`setup-python` is able to download GraalPy versions from the [official GraalPy repository](https://github.com/oracle/graalpython).
|
||||
- All available versions that we can download are listed in [releases](https://github.com/oracle/graalpython/releases).
|
||||
|
||||
## Hosted tool cache
|
||||
|
||||
GitHub hosted runners have a tool cache that comes with a few versions of Python + PyPy already installed. This tool cache helps speed up runs and tool setup by not requiring any new downloads. There is an environment variable called `RUNNER_TOOL_CACHE` on each runner that describes the location of the tool cache with Python and PyPy installed. `setup-python` works by taking a specific version of Python or PyPy from this tool cache and adding it to PATH.
|
||||
|
@ -586,7 +559,7 @@ Here are the steps you need to follow to avoid the rate limit:
|
|||
|
||||
```yml
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.8
|
||||
token: ${{ secrets.GH_GITHUB_COM_TOKEN }}
|
||||
|
@ -617,8 +590,8 @@ jobs:
|
|||
python_version: ["3.11", "3.12"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "${{ matrix.python_version }}"
|
||||
allow-prereleases: true
|
||||
|
|
10534
package-lock.json
generated
10534
package-lock.json
generated
File diff suppressed because it is too large
Load diff
34
package.json
34
package.json
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "setup-python",
|
||||
"version": "5.0.0",
|
||||
"version": "4.0.0",
|
||||
"private": true,
|
||||
"description": "Setup python action",
|
||||
"main": "dist/index.js",
|
||||
|
@ -11,7 +11,7 @@
|
|||
"lint": "eslint --config ./.eslintrc.js \"**/*.ts\"",
|
||||
"lint:fix": "eslint --config ./.eslintrc.js \"**/*.ts\" --fix",
|
||||
"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 --runInBand --coverage"
|
||||
"test": "jest --coverage"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -28,28 +28,34 @@
|
|||
"@actions/cache": "^3.0.4",
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/exec": "^1.1.0",
|
||||
"@actions/glob": "^0.4.0",
|
||||
"@actions/http-client": "^2.2.0",
|
||||
"@actions/glob": "^0.2.0",
|
||||
"@actions/http-client": "^1.0.11",
|
||||
"@actions/io": "^1.0.2",
|
||||
"@actions/tool-cache": "^2.0.1",
|
||||
"@iarna/toml": "^2.2.5",
|
||||
"semver": "^7.5.2"
|
||||
"@actions/tool-cache": "^1.5.5",
|
||||
"semver": "^7.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.6",
|
||||
"@types/node": "^20.9.1",
|
||||
"@types/jest": "^27.0.2",
|
||||
"@types/node": "^16.11.25",
|
||||
"@types/semver": "^7.1.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.54.0",
|
||||
"@typescript-eslint/parser": "^5.54.0",
|
||||
"@vercel/ncc": "^0.38.0",
|
||||
"@vercel/ncc": "^0.33.4",
|
||||
"eslint": "^8.35.0",
|
||||
"eslint-config-prettier": "^8.6.0",
|
||||
"eslint-plugin-jest": "^27.2.1",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"jest": "^29.7.0",
|
||||
"jest-circus": "^29.7.0",
|
||||
"husky": "^7.0.2",
|
||||
"jest": "^27.2.5",
|
||||
"jest-circus": "^27.2.5",
|
||||
"prettier": "^2.8.4",
|
||||
"ts-jest": "^29.1.1",
|
||||
"typescript": "^5.2.2"
|
||||
"ts-jest": "^27.0.5",
|
||||
"typescript": "^4.2.3"
|
||||
},
|
||||
"husky": {
|
||||
"skipCI": true,
|
||||
"hooks": {
|
||||
"pre-commit": "npm run build && npm run format-check"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,18 +4,11 @@ import * as cache from '@actions/cache';
|
|||
import fs from 'fs';
|
||||
import {State} from './cache-distributions/cache-distributor';
|
||||
|
||||
// Added early exit to resolve issue with slow post action step:
|
||||
// - https://github.com/actions/setup-node/issues/878
|
||||
// https://github.com/actions/cache/pull/1217
|
||||
export async function run(earlyExit?: boolean) {
|
||||
export async function run() {
|
||||
try {
|
||||
const cache = core.getInput('cache');
|
||||
if (cache) {
|
||||
await saveCache(cache);
|
||||
|
||||
if (earlyExit) {
|
||||
process.exit(0);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
const err = error as Error;
|
||||
|
@ -83,4 +76,4 @@ function isCacheDirectoryExists(cacheDirectory: string[]) {
|
|||
return result;
|
||||
}
|
||||
|
||||
run(true);
|
||||
run();
|
||||
|
|
|
@ -1,146 +0,0 @@
|
|||
import * as path from 'path';
|
||||
import * as graalpyInstall from './install-graalpy';
|
||||
import {
|
||||
IS_WINDOWS,
|
||||
validateVersion,
|
||||
IGraalPyManifestRelease,
|
||||
getBinaryDirectory
|
||||
} from './utils';
|
||||
|
||||
import * as semver from 'semver';
|
||||
import * as core from '@actions/core';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
|
||||
export async function findGraalPyVersion(
|
||||
versionSpec: string,
|
||||
architecture: string,
|
||||
updateEnvironment: boolean,
|
||||
checkLatest: boolean,
|
||||
allowPreReleases: boolean
|
||||
): Promise<string> {
|
||||
let resolvedGraalPyVersion = '';
|
||||
let installDir: string | null;
|
||||
let releases: IGraalPyManifestRelease[] | undefined;
|
||||
|
||||
let graalpyVersionSpec = parseGraalPyVersion(versionSpec);
|
||||
|
||||
if (checkLatest) {
|
||||
releases = await graalpyInstall.getAvailableGraalPyVersions();
|
||||
if (releases && releases.length > 0) {
|
||||
const releaseData = graalpyInstall.findRelease(
|
||||
releases,
|
||||
graalpyVersionSpec,
|
||||
architecture,
|
||||
false
|
||||
);
|
||||
|
||||
if (releaseData) {
|
||||
core.info(`Resolved as GraalPy ${releaseData.resolvedGraalPyVersion}`);
|
||||
graalpyVersionSpec = releaseData.resolvedGraalPyVersion;
|
||||
} else {
|
||||
core.info(
|
||||
`Failed to resolve GraalPy ${graalpyVersionSpec} from manifest`
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
({installDir, resolvedGraalPyVersion} = findGraalPyToolCache(
|
||||
graalpyVersionSpec,
|
||||
architecture
|
||||
));
|
||||
|
||||
if (!installDir) {
|
||||
({installDir, resolvedGraalPyVersion} = await graalpyInstall.installGraalPy(
|
||||
graalpyVersionSpec,
|
||||
architecture,
|
||||
allowPreReleases,
|
||||
releases
|
||||
));
|
||||
}
|
||||
|
||||
const pipDir = IS_WINDOWS ? 'Scripts' : 'bin';
|
||||
const _binDir = path.join(installDir, pipDir);
|
||||
const binaryExtension = IS_WINDOWS ? '.exe' : '';
|
||||
const pythonPath = path.join(
|
||||
IS_WINDOWS ? installDir : _binDir,
|
||||
`python${binaryExtension}`
|
||||
);
|
||||
const pythonLocation = getBinaryDirectory(installDir);
|
||||
if (updateEnvironment) {
|
||||
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(_binDir);
|
||||
}
|
||||
core.setOutput('python-version', 'graalpy' + resolvedGraalPyVersion);
|
||||
core.setOutput('python-path', pythonPath);
|
||||
|
||||
return resolvedGraalPyVersion;
|
||||
}
|
||||
|
||||
export function findGraalPyToolCache(
|
||||
graalpyVersion: string,
|
||||
architecture: string
|
||||
) {
|
||||
let resolvedGraalPyVersion = '';
|
||||
let installDir: string | null = tc.find(
|
||||
'GraalPy',
|
||||
graalpyVersion,
|
||||
architecture
|
||||
);
|
||||
|
||||
if (installDir) {
|
||||
// 'tc.find' finds tool based on Python version but we also need to check
|
||||
// whether GraalPy version satisfies requested version.
|
||||
resolvedGraalPyVersion = path.basename(path.dirname(installDir));
|
||||
|
||||
const isGraalPyVersionSatisfies = semver.satisfies(
|
||||
resolvedGraalPyVersion,
|
||||
graalpyVersion
|
||||
);
|
||||
if (!isGraalPyVersionSatisfies) {
|
||||
installDir = null;
|
||||
resolvedGraalPyVersion = '';
|
||||
}
|
||||
}
|
||||
|
||||
if (!installDir) {
|
||||
core.info(
|
||||
`GraalPy version ${graalpyVersion} was not found in the local cache`
|
||||
);
|
||||
}
|
||||
|
||||
return {installDir, resolvedGraalPyVersion};
|
||||
}
|
||||
|
||||
export function parseGraalPyVersion(versionSpec: string): string {
|
||||
const versions = versionSpec.split('-').filter(item => !!item);
|
||||
|
||||
if (/^(graalpy)(.+)/.test(versions[0])) {
|
||||
const version = versions[0].replace('graalpy', '');
|
||||
versions.splice(0, 1, 'graalpy', version);
|
||||
}
|
||||
|
||||
if (versions.length < 2 || versions[0] != 'graalpy') {
|
||||
throw new Error(
|
||||
"Invalid 'version' property for GraalPy. GraalPy version should be specified as 'graalpy<python-version>' or 'graalpy-<python-version>'. See README for examples and documentation."
|
||||
);
|
||||
}
|
||||
|
||||
const pythonVersion = versions[1];
|
||||
|
||||
if (!validateVersion(pythonVersion)) {
|
||||
throw new Error(
|
||||
"Invalid 'version' property for GraalPy. GraalPy versions should satisfy SemVer notation. See README for examples and documentation."
|
||||
);
|
||||
}
|
||||
|
||||
return pythonVersion;
|
||||
}
|
|
@ -7,8 +7,7 @@ import {
|
|||
getPyPyVersionFromPath,
|
||||
readExactPyPyVersionFile,
|
||||
validatePythonVersionFormatForPyPy,
|
||||
IPyPyManifestRelease,
|
||||
getBinaryDirectory
|
||||
IPyPyManifestRelease
|
||||
} from './utils';
|
||||
|
||||
import * as semver from 'semver';
|
||||
|
@ -83,7 +82,7 @@ export async function findPyPyVersion(
|
|||
IS_WINDOWS ? installDir : _binDir,
|
||||
`python${binaryExtension}`
|
||||
);
|
||||
const pythonLocation = getBinaryDirectory(installDir);
|
||||
const pythonLocation = pypyInstall.getPyPyBinaryPath(installDir);
|
||||
if (updateEnvironment) {
|
||||
core.exportVariable('pythonLocation', installDir);
|
||||
// https://cmake.org/cmake/help/latest/module/FindPython.html#module:FindPython
|
||||
|
|
|
@ -11,7 +11,7 @@ import * as tc from '@actions/tool-cache';
|
|||
|
||||
// Python has "scripts" or "bin" directories where command-line tools that come with packages are installed.
|
||||
// This is where pip is, along with anything that pip installs.
|
||||
// There is a separate directory for `pip install --user`.
|
||||
// There is a seperate directory for `pip install --user`.
|
||||
//
|
||||
// For reference, these directories are as follows:
|
||||
// macOS / Linux:
|
||||
|
|
|
@ -1,264 +0,0 @@
|
|||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import * as core from '@actions/core';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
import * as semver from 'semver';
|
||||
import * as httpm from '@actions/http-client';
|
||||
import * as ifm from '@actions/http-client/lib/interfaces';
|
||||
import * as exec from '@actions/exec';
|
||||
|
||||
import fs from 'fs';
|
||||
import * as http from 'http';
|
||||
|
||||
import {
|
||||
IS_WINDOWS,
|
||||
IGraalPyManifestRelease,
|
||||
createSymlinkInFolder,
|
||||
isNightlyKeyword,
|
||||
getBinaryDirectory,
|
||||
getNextPageUrl
|
||||
} from './utils';
|
||||
|
||||
const TOKEN = core.getInput('token');
|
||||
const AUTH = !TOKEN ? undefined : `token ${TOKEN}`;
|
||||
|
||||
export async function installGraalPy(
|
||||
graalpyVersion: string,
|
||||
architecture: string,
|
||||
allowPreReleases: boolean,
|
||||
releases: IGraalPyManifestRelease[] | undefined
|
||||
) {
|
||||
let downloadDir;
|
||||
|
||||
releases = releases ?? (await getAvailableGraalPyVersions());
|
||||
|
||||
if (!releases || !releases.length) {
|
||||
throw new Error('No release was found in GraalPy version.json');
|
||||
}
|
||||
|
||||
let releaseData = findRelease(releases, graalpyVersion, architecture, false);
|
||||
|
||||
if (allowPreReleases && (!releaseData || !releaseData.foundAsset)) {
|
||||
// check for pre-release
|
||||
core.info(
|
||||
[
|
||||
`Stable GraalPy version ${graalpyVersion} with arch ${architecture} not found`,
|
||||
`Trying pre-release versions`
|
||||
].join(os.EOL)
|
||||
);
|
||||
releaseData = findRelease(releases, graalpyVersion, architecture, true);
|
||||
}
|
||||
|
||||
if (!releaseData || !releaseData.foundAsset) {
|
||||
throw new Error(
|
||||
`GraalPy version ${graalpyVersion} with arch ${architecture} not found`
|
||||
);
|
||||
}
|
||||
|
||||
const {foundAsset, resolvedGraalPyVersion} = releaseData;
|
||||
const downloadUrl = `${foundAsset.browser_download_url}`;
|
||||
|
||||
core.info(`Downloading GraalPy from "${downloadUrl}" ...`);
|
||||
|
||||
try {
|
||||
const graalpyPath = await tc.downloadTool(downloadUrl, undefined, AUTH);
|
||||
|
||||
core.info('Extracting downloaded archive...');
|
||||
downloadDir = await tc.extractTar(graalpyPath);
|
||||
|
||||
// root folder in archive can have unpredictable name so just take the first folder
|
||||
// downloadDir is unique folder under TEMP and can't contain any other folders
|
||||
const archiveName = fs.readdirSync(downloadDir)[0];
|
||||
|
||||
const toolDir = path.join(downloadDir, archiveName);
|
||||
let installDir = toolDir;
|
||||
if (!isNightlyKeyword(resolvedGraalPyVersion)) {
|
||||
installDir = await tc.cacheDir(
|
||||
toolDir,
|
||||
'GraalPy',
|
||||
resolvedGraalPyVersion,
|
||||
architecture
|
||||
);
|
||||
}
|
||||
|
||||
const binaryPath = getBinaryDirectory(installDir);
|
||||
await createGraalPySymlink(binaryPath, resolvedGraalPyVersion);
|
||||
await installPip(binaryPath);
|
||||
|
||||
return {installDir, resolvedGraalPyVersion};
|
||||
} catch (err) {
|
||||
if (err instanceof Error) {
|
||||
// Rate limit?
|
||||
if (
|
||||
err instanceof tc.HTTPError &&
|
||||
(err.httpStatusCode === 403 || err.httpStatusCode === 429)
|
||||
) {
|
||||
core.info(
|
||||
`Received HTTP status code ${err.httpStatusCode}. This usually indicates the rate limit has been exceeded`
|
||||
);
|
||||
} else {
|
||||
core.info(err.message);
|
||||
}
|
||||
if (err.stack !== undefined) {
|
||||
core.debug(err.stack);
|
||||
}
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
export async function getAvailableGraalPyVersions() {
|
||||
const http: httpm.HttpClient = new httpm.HttpClient('tool-cache');
|
||||
|
||||
const headers: http.OutgoingHttpHeaders = {};
|
||||
if (AUTH) {
|
||||
headers.authorization = AUTH;
|
||||
}
|
||||
|
||||
let url: string | null =
|
||||
'https://api.github.com/repos/oracle/graalpython/releases';
|
||||
const result: IGraalPyManifestRelease[] = [];
|
||||
do {
|
||||
const response: ifm.TypedResponse<IGraalPyManifestRelease[]> =
|
||||
await http.getJson(url, headers);
|
||||
if (!response.result) {
|
||||
throw new Error(
|
||||
`Unable to retrieve the list of available GraalPy versions from '${url}'`
|
||||
);
|
||||
}
|
||||
result.push(...response.result);
|
||||
url = getNextPageUrl(response);
|
||||
} while (url);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
async function createGraalPySymlink(
|
||||
graalpyBinaryPath: string,
|
||||
graalpyVersion: string
|
||||
) {
|
||||
const version = semver.coerce(graalpyVersion)!;
|
||||
const pythonBinaryPostfix = semver.major(version);
|
||||
const pythonMinor = semver.minor(version);
|
||||
const graalpyMajorMinorBinaryPostfix = `${pythonBinaryPostfix}.${pythonMinor}`;
|
||||
const binaryExtension = IS_WINDOWS ? '.exe' : '';
|
||||
|
||||
core.info('Creating symlinks...');
|
||||
createSymlinkInFolder(
|
||||
graalpyBinaryPath,
|
||||
`graalpy${binaryExtension}`,
|
||||
`python${pythonBinaryPostfix}${binaryExtension}`,
|
||||
true
|
||||
);
|
||||
|
||||
createSymlinkInFolder(
|
||||
graalpyBinaryPath,
|
||||
`graalpy${binaryExtension}`,
|
||||
`python${binaryExtension}`,
|
||||
true
|
||||
);
|
||||
|
||||
createSymlinkInFolder(
|
||||
graalpyBinaryPath,
|
||||
`graalpy${binaryExtension}`,
|
||||
`graalpy${graalpyMajorMinorBinaryPostfix}${binaryExtension}`,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
async function installPip(pythonLocation: string) {
|
||||
core.info(
|
||||
"Installing pip (GraalPy doesn't update pip because it uses a patched version of pip)"
|
||||
);
|
||||
const pythonBinary = path.join(pythonLocation, 'python');
|
||||
await exec.exec(`${pythonBinary} -m ensurepip --default-pip`);
|
||||
}
|
||||
|
||||
export function graalPyTagToVersion(tag: string) {
|
||||
const versionPattern = /.*-(\d+\.\d+\.\d+(?:\.\d+)?)((?:a|b|rc))?(\d*)?/;
|
||||
const match = tag.match(versionPattern);
|
||||
if (match && match[2]) {
|
||||
return `${match[1]}-${match[2]}.${match[3]}`;
|
||||
} else if (match) {
|
||||
return match[1];
|
||||
} else {
|
||||
return tag.replace(/.*-/, '');
|
||||
}
|
||||
}
|
||||
|
||||
export function findRelease(
|
||||
releases: IGraalPyManifestRelease[],
|
||||
graalpyVersion: string,
|
||||
architecture: string,
|
||||
includePrerelease: boolean
|
||||
) {
|
||||
const options = {includePrerelease: includePrerelease};
|
||||
const filterReleases = releases.filter(item => {
|
||||
const isVersionSatisfied = semver.satisfies(
|
||||
graalPyTagToVersion(item.tag_name),
|
||||
graalpyVersion,
|
||||
options
|
||||
);
|
||||
return (
|
||||
isVersionSatisfied && !!findAsset(item, architecture, process.platform)
|
||||
);
|
||||
});
|
||||
|
||||
if (!filterReleases.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const sortedReleases = filterReleases.sort((previous, current) =>
|
||||
semver.compare(
|
||||
semver.coerce(graalPyTagToVersion(current.tag_name))!,
|
||||
semver.coerce(graalPyTagToVersion(previous.tag_name))!
|
||||
)
|
||||
);
|
||||
|
||||
const foundRelease = sortedReleases[0];
|
||||
const foundAsset = findAsset(foundRelease, architecture, process.platform);
|
||||
|
||||
return {
|
||||
foundAsset,
|
||||
resolvedGraalPyVersion: graalPyTagToVersion(foundRelease.tag_name)
|
||||
};
|
||||
}
|
||||
|
||||
export function toGraalPyPlatform(platform: string) {
|
||||
switch (platform) {
|
||||
case 'win32':
|
||||
return 'windows';
|
||||
case 'darwin':
|
||||
return 'macos';
|
||||
}
|
||||
return platform;
|
||||
}
|
||||
|
||||
export function toGraalPyArchitecture(architecture: string) {
|
||||
switch (architecture) {
|
||||
case 'x64':
|
||||
return 'amd64';
|
||||
case 'arm64':
|
||||
return 'aarch64';
|
||||
}
|
||||
return architecture;
|
||||
}
|
||||
|
||||
export function findAsset(
|
||||
item: IGraalPyManifestRelease,
|
||||
architecture: string,
|
||||
platform: string
|
||||
) {
|
||||
const graalpyArch = toGraalPyArchitecture(architecture);
|
||||
const graalpyPlatform = toGraalPyPlatform(platform);
|
||||
const found = item.assets.filter(
|
||||
file =>
|
||||
file.name.startsWith('graalpy') &&
|
||||
file.name.endsWith(`-${graalpyPlatform}-${graalpyArch}.tar.gz`)
|
||||
);
|
||||
/*
|
||||
In the future there could be more variants of GraalPy for a single release. Pick the shortest name, that one is the most likely to be the primary variant.
|
||||
*/
|
||||
found.sort((f1, f2) => f1.name.length - f2.name.length);
|
||||
return found[0];
|
||||
}
|
|
@ -13,8 +13,7 @@ import {
|
|||
IPyPyManifestRelease,
|
||||
createSymlinkInFolder,
|
||||
isNightlyKeyword,
|
||||
writeExactPyPyVersionFile,
|
||||
getBinaryDirectory
|
||||
writeExactPyPyVersionFile
|
||||
} from './utils';
|
||||
|
||||
export async function installPyPy(
|
||||
|
@ -95,7 +94,7 @@ export async function installPyPy(
|
|||
|
||||
writeExactPyPyVersionFile(installDir, resolvedPyPyVersion);
|
||||
|
||||
const binaryPath = getBinaryDirectory(installDir);
|
||||
const binaryPath = getPyPyBinaryPath(installDir);
|
||||
await createPyPySymlink(binaryPath, resolvedPythonVersion);
|
||||
await installPip(binaryPath);
|
||||
|
||||
|
@ -238,6 +237,15 @@ export function findRelease(
|
|||
};
|
||||
}
|
||||
|
||||
/** Get PyPy binary location from the tool of installation directory
|
||||
* - On Linux and macOS, the Python interpreter is in 'bin'.
|
||||
* - On Windows, it is in the installation root.
|
||||
*/
|
||||
export function getPyPyBinaryPath(installDir: string) {
|
||||
const _binDir = path.join(installDir, 'bin');
|
||||
return IS_WINDOWS ? installDir : _binDir;
|
||||
}
|
||||
|
||||
export function pypyVersionToSemantic(versionSpec: string) {
|
||||
const prereleaseVersion = /(\d+\.\d+\.\d+)((?:a|b|rc))(\d*)/g;
|
||||
return versionSpec.replace(prereleaseVersion, '$1-$2.$3');
|
||||
|
|
|
@ -1,27 +1,16 @@
|
|||
import * as core from '@actions/core';
|
||||
import * as finder from './find-python';
|
||||
import * as finderPyPy from './find-pypy';
|
||||
import * as finderGraalPy from './find-graalpy';
|
||||
import * as path from 'path';
|
||||
import * as os from 'os';
|
||||
import fs from 'fs';
|
||||
import {getCacheDistributor} from './cache-distributions/cache-factory';
|
||||
import {
|
||||
isCacheFeatureAvailable,
|
||||
logWarning,
|
||||
IS_MAC,
|
||||
getVersionInputFromFile,
|
||||
getVersionInputFromPlainFile
|
||||
} from './utils';
|
||||
import {isCacheFeatureAvailable, logWarning, IS_MAC} from './utils';
|
||||
|
||||
function isPyPyVersion(versionSpec: string) {
|
||||
return versionSpec.startsWith('pypy');
|
||||
}
|
||||
|
||||
function isGraalPyVersion(versionSpec: string) {
|
||||
return versionSpec.startsWith('graalpy');
|
||||
}
|
||||
|
||||
async function cacheDependencies(cache: string, pythonVersion: string) {
|
||||
const cacheDependencyPath =
|
||||
core.getInput('cache-dependency-path') || undefined;
|
||||
|
@ -33,46 +22,43 @@ async function cacheDependencies(cache: string, pythonVersion: string) {
|
|||
await cacheDistributor.restoreCache();
|
||||
}
|
||||
|
||||
function resolveVersionInputFromDefaultFile(): string[] {
|
||||
const couples: [string, (versionFile: string) => string[]][] = [
|
||||
['.python-version', getVersionInputFromPlainFile]
|
||||
];
|
||||
for (const [versionFile, _fn] of couples) {
|
||||
logWarning(
|
||||
`Neither 'python-version' nor 'python-version-file' inputs were supplied. Attempting to find '${versionFile}' file.`
|
||||
);
|
||||
if (fs.existsSync(versionFile)) {
|
||||
return _fn(versionFile);
|
||||
} else {
|
||||
logWarning(`${versionFile} doesn't exist.`);
|
||||
}
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
function resolveVersionInput() {
|
||||
let versions = core.getMultilineInput('python-version');
|
||||
const versionFile = core.getInput('python-version-file');
|
||||
const versions = core.getMultilineInput('python-version');
|
||||
let versionFile = core.getInput('python-version-file');
|
||||
|
||||
if (versions.length && versionFile) {
|
||||
core.warning(
|
||||
'Both python-version and python-version-file inputs are specified, only python-version will be used.'
|
||||
);
|
||||
}
|
||||
|
||||
if (versions.length) {
|
||||
if (versionFile) {
|
||||
core.warning(
|
||||
'Both python-version and python-version-file inputs are specified, only python-version will be used.'
|
||||
return versions;
|
||||
}
|
||||
|
||||
if (versionFile) {
|
||||
if (!fs.existsSync(versionFile)) {
|
||||
throw new Error(
|
||||
`The specified python version file at: ${versionFile} doesn't exist.`
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (versionFile) {
|
||||
if (!fs.existsSync(versionFile)) {
|
||||
throw new Error(
|
||||
`The specified python version file at: ${versionFile} doesn't exist.`
|
||||
);
|
||||
}
|
||||
versions = getVersionInputFromFile(versionFile);
|
||||
} else {
|
||||
versions = resolveVersionInputFromDefaultFile();
|
||||
}
|
||||
const version = fs.readFileSync(versionFile, 'utf8');
|
||||
core.info(`Resolved ${versionFile} as ${version}`);
|
||||
return [version];
|
||||
}
|
||||
|
||||
logWarning(
|
||||
"Neither 'python-version' nor 'python-version-file' inputs were supplied. Attempting to find '.python-version' file."
|
||||
);
|
||||
versionFile = '.python-version';
|
||||
if (fs.existsSync(versionFile)) {
|
||||
const version = fs.readFileSync(versionFile, 'utf8');
|
||||
core.info(`Resolved ${versionFile} as ${version}`);
|
||||
return [version];
|
||||
}
|
||||
|
||||
logWarning(`${versionFile} doesn't exist.`);
|
||||
|
||||
return versions;
|
||||
}
|
||||
|
||||
|
@ -111,20 +97,10 @@ async function run() {
|
|||
core.info(
|
||||
`Successfully set up PyPy ${installed.resolvedPyPyVersion} with Python (${installed.resolvedPythonVersion})`
|
||||
);
|
||||
} else if (isGraalPyVersion(version)) {
|
||||
const installed = await finderGraalPy.findGraalPyVersion(
|
||||
version,
|
||||
arch,
|
||||
updateEnvironment,
|
||||
checkLatest,
|
||||
allowPreReleases
|
||||
);
|
||||
pythonVersion = `${installed}`;
|
||||
core.info(`Successfully set up GraalPy ${installed}`);
|
||||
} else {
|
||||
if (version.startsWith('2')) {
|
||||
core.warning(
|
||||
'The support for python 2.7 was removed on June 19, 2023. Related issue: https://github.com/actions/setup-python/issues/672'
|
||||
'The support for python 2.7 will be removed on June 19. Related issue: https://github.com/actions/setup-python/issues/672'
|
||||
);
|
||||
}
|
||||
const installed = await finder.useCpythonVersion(
|
||||
|
|
131
src/utils.ts
131
src/utils.ts
|
@ -4,11 +4,7 @@ import * as core from '@actions/core';
|
|||
import fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as semver from 'semver';
|
||||
import * as toml from '@iarna/toml';
|
||||
import * as exec from '@actions/exec';
|
||||
import * as ifm from '@actions/http-client/lib/interfaces';
|
||||
|
||||
import * as http from 'http';
|
||||
|
||||
export const IS_WINDOWS = process.platform === 'win32';
|
||||
export const IS_LINUX = process.platform === 'linux';
|
||||
|
@ -32,16 +28,6 @@ export interface IPyPyManifestRelease {
|
|||
files: IPyPyManifestAsset[];
|
||||
}
|
||||
|
||||
export interface IGraalPyManifestAsset {
|
||||
name: string;
|
||||
browser_download_url: string;
|
||||
}
|
||||
|
||||
export interface IGraalPyManifestRelease {
|
||||
tag_name: string;
|
||||
assets: IGraalPyManifestAsset[];
|
||||
}
|
||||
|
||||
/** create Symlinks for downloaded PyPy
|
||||
* It should be executed only for downloaded versions in runtime, because
|
||||
* toolcache versions have this setup.
|
||||
|
@ -103,7 +89,7 @@ export function writeExactPyPyVersionFile(
|
|||
}
|
||||
|
||||
/**
|
||||
* Python version should be specified explicitly like "x.y" (3.10, 3.11, etc)
|
||||
* Python version should be specified explicitly like "x.y" (2.7, 3.6, 3.7)
|
||||
* "3.x" or "3" are not supported
|
||||
* because it could cause ambiguity when both PyPy version and Python version are not precise
|
||||
*/
|
||||
|
@ -195,118 +181,3 @@ export async function getOSInfo() {
|
|||
return osInfo;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract a value from an object by following the keys path provided.
|
||||
* If the value is present, it is returned. Otherwise undefined is returned.
|
||||
*/
|
||||
function extractValue(obj: any, keys: string[]): string | undefined {
|
||||
if (keys.length > 0) {
|
||||
const value = obj[keys[0]];
|
||||
if (keys.length > 1 && value !== undefined) {
|
||||
return extractValue(value, keys.slice(1));
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Python version extracted from the TOML file.
|
||||
* If the `project` key is present at the root level, the version is assumed to
|
||||
* be specified according to PEP 621 in `project.requires-python`.
|
||||
* Otherwise, if the `tool` key is present at the root level, the version is
|
||||
* assumed to be specified using poetry under `tool.poetry.dependencies.python`.
|
||||
* If none is present, returns an empty list.
|
||||
*/
|
||||
export function getVersionInputFromTomlFile(versionFile: string): string[] {
|
||||
core.debug(`Trying to resolve version form ${versionFile}`);
|
||||
|
||||
const pyprojectFile = fs.readFileSync(versionFile, 'utf8');
|
||||
const pyprojectConfig = toml.parse(pyprojectFile);
|
||||
let keys = [];
|
||||
|
||||
if ('project' in pyprojectConfig) {
|
||||
// standard project metadata (PEP 621)
|
||||
keys = ['project', 'requires-python'];
|
||||
} else {
|
||||
// python poetry
|
||||
keys = ['tool', 'poetry', 'dependencies', 'python'];
|
||||
}
|
||||
const versions = [];
|
||||
const version = extractValue(pyprojectConfig, keys);
|
||||
if (version !== undefined) {
|
||||
versions.push(version);
|
||||
}
|
||||
|
||||
core.info(`Extracted ${versions} from ${versionFile}`);
|
||||
const rawVersions = Array.from(versions, version =>
|
||||
version.split(',').join(' ')
|
||||
);
|
||||
const validatedVersions = rawVersions
|
||||
.map(item => semver.validRange(item, true))
|
||||
.filter((versionRange, index) => {
|
||||
if (!versionRange) {
|
||||
core.debug(
|
||||
`The version ${rawVersions[index]} is not valid SemVer range`
|
||||
);
|
||||
}
|
||||
|
||||
return !!versionRange;
|
||||
}) as string[];
|
||||
return validatedVersions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Python version extracted from a plain text file.
|
||||
*/
|
||||
export function getVersionInputFromPlainFile(versionFile: string): string[] {
|
||||
core.debug(`Trying to resolve version form ${versionFile}`);
|
||||
const version = fs.readFileSync(versionFile, 'utf8').trim();
|
||||
core.info(`Resolved ${versionFile} as ${version}`);
|
||||
return [version];
|
||||
}
|
||||
|
||||
/**
|
||||
* Python version extracted from a plain or TOML file.
|
||||
*/
|
||||
export function getVersionInputFromFile(versionFile: string): string[] {
|
||||
if (versionFile.endsWith('.toml')) {
|
||||
return getVersionInputFromTomlFile(versionFile);
|
||||
} else {
|
||||
return getVersionInputFromPlainFile(versionFile);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the directory containing interpreter binary from installation directory of PyPy or GraalPy
|
||||
* - On Linux and macOS, the Python interpreter is in 'bin'.
|
||||
* - On Windows, it is in the installation root.
|
||||
*/
|
||||
export function getBinaryDirectory(installDir: string) {
|
||||
return IS_WINDOWS ? installDir : path.join(installDir, 'bin');
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract next page URL from a HTTP response "link" header. Such headers are used in GitHub APIs.
|
||||
*/
|
||||
export function getNextPageUrl<T>(response: ifm.TypedResponse<T>) {
|
||||
const responseHeaders = <http.OutgoingHttpHeaders>response.headers;
|
||||
const linkHeader = responseHeaders.link;
|
||||
if (typeof linkHeader === 'string') {
|
||||
for (const link of linkHeader.split(/\s*,\s*/)) {
|
||||
const match = link.match(/<([^>]+)>(.*)/);
|
||||
if (match) {
|
||||
const url = match[1];
|
||||
for (const param of match[2].split(/\s*;\s*/)) {
|
||||
if (param.match(/rel="?next"?/)) {
|
||||
return url;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue