Compare commits
22
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
57ded4d7d5 | ||
|
|
df6abcc733 | ||
|
|
7a4f344e33 | ||
|
|
d1244c8404 | ||
|
|
3091b37310 | ||
|
|
dfa76f8d0d | ||
|
|
03eb867e3d | ||
|
|
b41aaf9f0c | ||
|
|
0ffa49cfca | ||
|
|
ec365b4eba | ||
|
|
7b9ef6fc5a | ||
|
|
869e769ec8 | ||
|
|
3faddefb4c | ||
|
|
181184007f | ||
|
|
2652534ead | ||
|
|
a6eba85bba | ||
|
|
34b4b622e3 | ||
|
|
f60fe39c45 | ||
|
|
d27e3f3d7c | ||
|
|
dec86ecf4e | ||
|
|
4dcd67678f | ||
|
|
8b89ef08a0 |
@@ -0,0 +1,6 @@
|
|||||||
|
# Ignore list
|
||||||
|
/*
|
||||||
|
|
||||||
|
# Do not ignore these folders:
|
||||||
|
!__tests__/
|
||||||
|
!src/
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
// This is a reusable configuration file copied from https://github.com/actions/reusable-workflows/tree/main/reusable-configurations. Please don't make changes to this file as it's the subject of an automatic update.
|
||||||
|
module.exports = {
|
||||||
|
extends: [
|
||||||
|
'eslint:recommended',
|
||||||
|
'plugin:@typescript-eslint/recommended',
|
||||||
|
'plugin:eslint-plugin-jest/recommended',
|
||||||
|
'eslint-config-prettier'
|
||||||
|
],
|
||||||
|
parser: '@typescript-eslint/parser',
|
||||||
|
plugins: ['@typescript-eslint', 'eslint-plugin-jest'],
|
||||||
|
rules: {
|
||||||
|
'@typescript-eslint/no-require-imports': 'error',
|
||||||
|
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||||
|
'@typescript-eslint/no-explicit-any': 'off',
|
||||||
|
'@typescript-eslint/no-empty-function': 'off',
|
||||||
|
'@typescript-eslint/ban-ts-comment': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
'ts-ignore': 'allow-with-description'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'no-console': 'error',
|
||||||
|
'yoda': 'error',
|
||||||
|
'prefer-const': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
destructuring: 'all'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'no-control-regex': 'off',
|
||||||
|
'no-constant-condition': ['error', {checkLoops: false}]
|
||||||
|
},
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ['**/*{test,spec}.ts'],
|
||||||
|
rules: {
|
||||||
|
'@typescript-eslint/no-unused-vars': 'off',
|
||||||
|
'jest/no-standalone-expect': 'off',
|
||||||
|
'jest/no-conditional-expect': 'off',
|
||||||
|
'no-console': 'off',
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
env: {
|
||||||
|
node: true,
|
||||||
|
es6: true,
|
||||||
|
'jest/globals': true
|
||||||
|
}
|
||||||
|
};
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
* @actions/actions-service
|
* @actions/setup-actions-team
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ jobs:
|
|||||||
id: cp310
|
id: cp310
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
python-version: "3.10"
|
python-version: '3.10'
|
||||||
- name: Verify 3.10
|
- name: Verify 3.10
|
||||||
run: python __tests__/verify-python.py 3.10
|
run: python __tests__/verify-python.py 3.10
|
||||||
- name: Run python-path sample 3.10
|
- name: Run python-path sample 3.10
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Update the ${{ env.TAG_NAME }} tag
|
- name: Update the ${{ env.TAG_NAME }} tag
|
||||||
uses: actions/[email protected].1
|
uses: actions/[email protected].2
|
||||||
with:
|
with:
|
||||||
source-tag: ${{ env.TAG_NAME }}
|
source-tag: ${{ env.TAG_NAME }}
|
||||||
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
|
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
|
||||||
@@ -19,7 +19,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-20.04, ubuntu-latest]
|
||||||
pypy:
|
pypy:
|
||||||
- 'pypy-2.7'
|
- 'pypy-2.7'
|
||||||
- 'pypy-3.7'
|
- 'pypy-3.7'
|
||||||
@@ -73,7 +73,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-20.04, ubuntu-latest]
|
||||||
pypy: ['pypy2.7', 'pypy3.7', 'pypy3.8', 'pypy3.9-nightly']
|
pypy: ['pypy2.7', 'pypy3.7', 'pypy3.8', 'pypy3.9-nightly']
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -20,8 +20,17 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04]
|
os: [macos-latest, windows-latest, ubuntu-20.04, ubuntu-22.04]
|
||||||
python: [3.5.4, 3.6.7, 3.7.5, 3.8.1]
|
python: [3.5.4, 3.6.7, 3.7.5, 3.8.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:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -55,8 +64,17 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04]
|
os: [macos-latest, windows-latest, ubuntu-20.04, ubuntu-22.04]
|
||||||
python: [3.5.4, 3.6.7, 3.7.5, 3.8.1]
|
python: [3.5.4, 3.6.7, 3.7.5, 3.8.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:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -93,7 +111,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04]
|
os: [macos-latest, windows-latest, ubuntu-20.04]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -149,14 +167,43 @@ jobs:
|
|||||||
- name: Run simple code
|
- name: Run simple code
|
||||||
run: python -c 'import math; print(math.factorial(5))'
|
run: python -c 'import math; print(math.factorial(5))'
|
||||||
|
|
||||||
|
setup-prerelease-version:
|
||||||
|
name: Setup 3.12 ${{ matrix.os }}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: setup-python 3.12
|
||||||
|
id: setup-python
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
python-version: '3.12'
|
||||||
|
allow-prereleases: true
|
||||||
|
|
||||||
|
- name: Check python-path
|
||||||
|
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Validate version
|
||||||
|
run: ${{ startsWith(steps.setup-python.outputs.python-version, '3.12.') }}
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Run simple code
|
||||||
|
run: python -c 'import math; print(math.factorial(5))'
|
||||||
|
|
||||||
setup-versions-noenv:
|
setup-versions-noenv:
|
||||||
name: Setup ${{ matrix.python }} ${{ matrix.os }} (noenv)
|
name: Setup ${{ matrix.python }} ${{ matrix.os }} (noenv)
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04]
|
os: [macos-latest, windows-latest, ubuntu-20.04, ubuntu-22.04]
|
||||||
python: ["3.7", "3.8", "3.9", "3.10"]
|
python: ['3.7', '3.8', '3.9', '3.10']
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -180,7 +227,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
python-version: ["3.8", "3.9", "3.10"]
|
python-version: ['3.8', '3.9', '3.10']
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Setup Python and check latest
|
- name: Setup Python and check latest
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
name: Update configuration files
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 3 * * 0'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
call-update-configuration-files:
|
||||||
|
name: Update configuration files
|
||||||
|
uses: actions/reusable-workflows/.github/workflows/update-config-files.yml@main
|
||||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@actions/cache"
|
name: "@actions/cache"
|
||||||
version: 3.0.4
|
version: 3.1.4
|
||||||
type: npm
|
type: npm
|
||||||
summary: Actions cache lib
|
summary: Actions cache lib
|
||||||
homepage: https://github.com/actions/toolkit/tree/main/packages/cache
|
homepage: https://github.com/actions/toolkit/tree/main/packages/cache
|
||||||
|
|||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
name: "@azure/abort-controller"
|
name: "@azure/abort-controller"
|
||||||
version: 1.0.4
|
version: 1.1.0
|
||||||
type: npm
|
type: npm
|
||||||
summary: Microsoft Azure SDK for JavaScript - Aborter
|
summary: Microsoft Azure SDK for JavaScript - Aborter
|
||||||
homepage: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/abort-controller/README.md
|
homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/abort-controller/README.md
|
||||||
license: mit
|
license: mit
|
||||||
licenses:
|
licenses:
|
||||||
- sources: LICENSE
|
- sources: LICENSE
|
||||||
|
|||||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@azure/core-http"
|
name: "@azure/core-http"
|
||||||
version: 2.2.2
|
version: 3.0.1
|
||||||
type: npm
|
type: npm
|
||||||
summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client
|
summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client
|
||||||
libraries generated using AutoRest
|
libraries generated using AutoRest
|
||||||
|
|||||||
Generated
+32
@@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
name: "@azure/core-util"
|
||||||
|
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/
|
||||||
|
license: mit
|
||||||
|
licenses:
|
||||||
|
- sources: LICENSE
|
||||||
|
text: |
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2020 Microsoft
|
||||||
|
|
||||||
|
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: []
|
||||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@azure/ms-rest-js"
|
name: "@azure/ms-rest-js"
|
||||||
version: 2.6.0
|
version: 2.6.6
|
||||||
type: npm
|
type: npm
|
||||||
summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client
|
summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client
|
||||||
libraries generated using AutoRest
|
libraries generated using AutoRest
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@azure/storage-blob"
|
name: "@azure/storage-blob"
|
||||||
version: 12.8.0
|
version: 12.14.0
|
||||||
type: npm
|
type: npm
|
||||||
summary: Microsoft Azure Storage SDK for JavaScript - Blob
|
summary: Microsoft Azure Storage SDK for JavaScript - Blob
|
||||||
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storage/storage-blob/
|
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storage/storage-blob/
|
||||||
|
|||||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@types/node-fetch"
|
name: "@types/node-fetch"
|
||||||
version: 2.5.12
|
version: 2.6.3
|
||||||
type: npm
|
type: npm
|
||||||
summary: TypeScript definitions for node-fetch
|
summary: TypeScript definitions for node-fetch
|
||||||
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-fetch
|
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-fetch
|
||||||
|
|||||||
Generated
+26
@@ -0,0 +1,26 @@
|
|||||||
|
---
|
||||||
|
name: lru-cache
|
||||||
|
version: 6.0.0
|
||||||
|
type: npm
|
||||||
|
summary: A cache object that deletes the least-recently-used items.
|
||||||
|
homepage:
|
||||||
|
license: isc
|
||||||
|
licenses:
|
||||||
|
- sources: LICENSE
|
||||||
|
text: |
|
||||||
|
The ISC License
|
||||||
|
|
||||||
|
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
|
||||||
|
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: []
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
name: semver
|
name: semver
|
||||||
version: 7.1.3
|
version: 7.3.8
|
||||||
type: npm
|
type: npm
|
||||||
summary: The semantic version parser used by npm.
|
summary: The semantic version parser used by npm.
|
||||||
homepage: https://github.com/npm/node-semver#readme
|
homepage:
|
||||||
license: isc
|
license: isc
|
||||||
licenses:
|
licenses:
|
||||||
- sources: LICENSE
|
- sources: LICENSE
|
||||||
Generated
-23
File diff suppressed because one or more lines are too long
Generated
+35
@@ -0,0 +1,35 @@
|
|||||||
|
---
|
||||||
|
name: tslib
|
||||||
|
version: 2.5.0
|
||||||
|
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.
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
purpose with or without fee is hereby granted.
|
||||||
|
|
||||||
|
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:
|
||||||
|
- 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*****************************************************************************
|
||||||
|
*/"
|
||||||
Generated
-33
@@ -1,33 +0,0 @@
|
|||||||
---
|
|
||||||
name: universalify
|
|
||||||
version: 0.1.2
|
|
||||||
type: npm
|
|
||||||
summary: Make a callback- or promise-based function support both promises and callbacks.
|
|
||||||
homepage: https://github.com/RyanZim/universalify#readme
|
|
||||||
license: mit
|
|
||||||
licenses:
|
|
||||||
- sources: LICENSE
|
|
||||||
text: |
|
|
||||||
(The MIT License)
|
|
||||||
|
|
||||||
Copyright (c) 2017, Ryan Zimmerman <[email protected]>
|
|
||||||
|
|
||||||
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: MIT
|
|
||||||
notices: []
|
|
||||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: xml2js
|
name: xml2js
|
||||||
version: 0.4.23
|
version: 0.5.0
|
||||||
type: npm
|
type: npm
|
||||||
summary: Simple XML to JavaScript object converter.
|
summary: Simple XML to JavaScript object converter.
|
||||||
homepage: https://github.com/Leonidas-from-XIV/node-xml2js
|
homepage: https://github.com/Leonidas-from-XIV/node-xml2js
|
||||||
|
|||||||
Generated
+26
@@ -0,0 +1,26 @@
|
|||||||
|
---
|
||||||
|
name: yallist
|
||||||
|
version: 4.0.0
|
||||||
|
type: npm
|
||||||
|
summary: Yet Another Linked List
|
||||||
|
homepage:
|
||||||
|
license: isc
|
||||||
|
licenses:
|
||||||
|
- sources: LICENSE
|
||||||
|
text: |
|
||||||
|
The ISC License
|
||||||
|
|
||||||
|
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
|
||||||
|
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: []
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# Ignore list
|
||||||
|
/*
|
||||||
|
|
||||||
|
# Do not ignore these folders:
|
||||||
|
!__tests__/
|
||||||
|
!.github/
|
||||||
|
!src/
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
// This is a reusable configuration file copied from https://github.com/actions/reusable-workflows/tree/main/reusable-configurations. Please don't make changes to this file as it's the subject of an automatic update.
|
||||||
|
module.exports = {
|
||||||
|
printWidth: 80,
|
||||||
|
tabWidth: 2,
|
||||||
|
useTabs: false,
|
||||||
|
semi: true,
|
||||||
|
singleQuote: true,
|
||||||
|
trailingComma: 'none',
|
||||||
|
bracketSpacing: false,
|
||||||
|
arrowParens: 'avoid'
|
||||||
|
};
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"printWidth": 80,
|
|
||||||
"tabWidth": 2,
|
|
||||||
"useTabs": false,
|
|
||||||
"semi": true,
|
|
||||||
"singleQuote": true,
|
|
||||||
"trailingComma": "none",
|
|
||||||
"bracketSpacing": false,
|
|
||||||
"arrowParens": "avoid",
|
|
||||||
"parser": "typescript"
|
|
||||||
}
|
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
# setup-python
|
# setup-python
|
||||||
|
|
||||||
<p align="left">
|
[](https://github.com/actions/setup-python/actions/workflows/basic-validation.yml)
|
||||||
<a href="https://github.com/actions/setup-python"><img alt="GitHub Actions status" src="https://github.com/actions/setup-python/workflows/Main%20workflow/badge.svg"></a>
|
[](https://github.com/actions/setup-python/actions/workflows/test-python.yml)
|
||||||
</p>
|
[](https://github.com/actions/setup-python/actions/workflows/test-pypy.yml)
|
||||||
|
[](https://github.com/actions/setup-python/actions/workflows/e2e-cache.yml)
|
||||||
|
|
||||||
This action provides the following functionality for GitHub Actions users:
|
This action provides the following functionality for GitHub Actions users:
|
||||||
|
|
||||||
@@ -51,11 +52,11 @@ Using `architecture` input it is possible to specify the required Python or PyPy
|
|||||||
|
|
||||||
The action has built-in functionality for caching and restoring dependencies. It uses [toolkit/cache](https://github.com/actions/toolkit/tree/main/packages/cache) under the hood for caching dependencies but requires less configuration settings. Supported package managers are `pip`, `pipenv` and `poetry`. The `cache` input is optional, and caching is turned off by default.
|
The action has built-in functionality for caching and restoring dependencies. It uses [toolkit/cache](https://github.com/actions/toolkit/tree/main/packages/cache) under the hood for caching dependencies but requires less configuration settings. Supported package managers are `pip`, `pipenv` and `poetry`. The `cache` input is optional, and caching is turned off by default.
|
||||||
|
|
||||||
The action defaults to searching for a dependency file (`requirements.txt` for pip, `Pipfile.lock` for pipenv or `poetry.lock` for poetry) in the repository, and uses its hash as a part of the cache key. Input `cache-dependency-path` is used for cases when multiple dependency files are used, they are located in different subdirectories or different files for the hash that want to be used.
|
The action defaults to searching for a dependency file (`requirements.txt` or `pyproject.toml` for pip, `Pipfile.lock` for pipenv or `poetry.lock` for poetry) in the repository, and uses its hash as a part of the cache key. Input `cache-dependency-path` is used for cases when multiple dependency files are used, they are located in different subdirectories or different files for the hash that want to be used.
|
||||||
|
|
||||||
- For `pip`, the action will cache the global cache directory
|
- For `pip`, the action will cache the global cache directory
|
||||||
- For `pipenv`, the action will cache virtualenv directory
|
- For `pipenv`, the action will cache virtualenv directory
|
||||||
- For `poetry`, the action will cache virtualenv directory
|
- For `poetry`, the action will cache virtualenv directories -- one for each poetry project found
|
||||||
|
|
||||||
**Caching pip dependencies:**
|
**Caching pip dependencies:**
|
||||||
|
|
||||||
@@ -85,6 +86,7 @@ See examples of using `cache` and `cache-dependency-path` for `pipenv` and `poet
|
|||||||
- [Hosted tool cache](docs/advanced-usage.md#hosted-tool-cache)
|
- [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` 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)
|
- [Using `setup-python` on GHES](docs/advanced-usage.md#using-setup-python-on-ghes)
|
||||||
|
- [Allow pre-releases](docs/advanced-usage.md#allow-pre-releases)
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
+124
-24
@@ -1,9 +1,10 @@
|
|||||||
|
import * as path from 'path';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as cache from '@actions/cache';
|
import * as cache from '@actions/cache';
|
||||||
import * as exec from '@actions/exec';
|
import * as exec from '@actions/exec';
|
||||||
import * as io from '@actions/io';
|
import * as io from '@actions/io';
|
||||||
import {getCacheDistributor} from '../src/cache-distributions/cache-factory';
|
import {getCacheDistributor} from '../src/cache-distributions/cache-factory';
|
||||||
import * as utils from './../src/utils';
|
import {State} from '../src/cache-distributions/cache-distributor';
|
||||||
|
|
||||||
describe('restore-cache', () => {
|
describe('restore-cache', () => {
|
||||||
const pipFileLockHash =
|
const pipFileLockHash =
|
||||||
@@ -13,7 +14,7 @@ describe('restore-cache', () => {
|
|||||||
const requirementsLinuxHash =
|
const requirementsLinuxHash =
|
||||||
'2d0ff7f46b0e120e3d3294db65768b474934242637b9899b873e6283dfd16d7c';
|
'2d0ff7f46b0e120e3d3294db65768b474934242637b9899b873e6283dfd16d7c';
|
||||||
const poetryLockHash =
|
const poetryLockHash =
|
||||||
'571bf984f8d210e6a97f854e479fdd4a2b5af67b5fdac109ec337a0ea16e7836';
|
'f24ea1ad73968e6c8d80c16a093ade72d9332c433aeef979a0dd943e6a99b2ab';
|
||||||
const poetryConfigOutput = `
|
const poetryConfigOutput = `
|
||||||
cache-dir = "/Users/patrick/Library/Caches/pypoetry"
|
cache-dir = "/Users/patrick/Library/Caches/pypoetry"
|
||||||
experimental.new-installer = false
|
experimental.new-installer = false
|
||||||
@@ -27,7 +28,7 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py
|
|||||||
let infoSpy: jest.SpyInstance;
|
let infoSpy: jest.SpyInstance;
|
||||||
let warningSpy: jest.SpyInstance;
|
let warningSpy: jest.SpyInstance;
|
||||||
let debugSpy: jest.SpyInstance;
|
let debugSpy: jest.SpyInstance;
|
||||||
let saveSatetSpy: jest.SpyInstance;
|
let saveStateSpy: jest.SpyInstance;
|
||||||
let getStateSpy: jest.SpyInstance;
|
let getStateSpy: jest.SpyInstance;
|
||||||
let setOutputSpy: jest.SpyInstance;
|
let setOutputSpy: jest.SpyInstance;
|
||||||
|
|
||||||
@@ -52,8 +53,8 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py
|
|||||||
debugSpy = jest.spyOn(core, 'debug');
|
debugSpy = jest.spyOn(core, 'debug');
|
||||||
debugSpy.mockImplementation(input => undefined);
|
debugSpy.mockImplementation(input => undefined);
|
||||||
|
|
||||||
saveSatetSpy = jest.spyOn(core, 'saveState');
|
saveStateSpy = jest.spyOn(core, 'saveState');
|
||||||
saveSatetSpy.mockImplementation(input => undefined);
|
saveStateSpy.mockImplementation(input => undefined);
|
||||||
|
|
||||||
getStateSpy = jest.spyOn(core, 'getState');
|
getStateSpy = jest.spyOn(core, 'getState');
|
||||||
getStateSpy.mockImplementation(input => undefined);
|
getStateSpy.mockImplementation(input => undefined);
|
||||||
@@ -93,28 +94,81 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py
|
|||||||
async packageManager => {
|
async packageManager => {
|
||||||
expect(() =>
|
expect(() =>
|
||||||
getCacheDistributor(packageManager, '3.8.12', undefined)
|
getCacheDistributor(packageManager, '3.8.12', undefined)
|
||||||
).toThrowError(`Caching for '${packageManager}' is not supported`);
|
).toThrow(`Caching for '${packageManager}' is not supported`);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Restore dependencies', () => {
|
describe('Restore dependencies', () => {
|
||||||
it.each([
|
it.each([
|
||||||
['pip', '3.8.12', undefined, requirementsHash],
|
[
|
||||||
['pip', '3.8.12', '**/requirements-linux.txt', requirementsLinuxHash],
|
'pip',
|
||||||
|
'3.8.12',
|
||||||
|
'__tests__/data/**/requirements.txt',
|
||||||
|
requirementsHash,
|
||||||
|
undefined
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'pip',
|
||||||
|
'3.8.12',
|
||||||
|
'__tests__/data/**/requirements-linux.txt',
|
||||||
|
requirementsLinuxHash,
|
||||||
|
undefined
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'pip',
|
'pip',
|
||||||
'3.8.12',
|
'3.8.12',
|
||||||
'__tests__/data/requirements-linux.txt',
|
'__tests__/data/requirements-linux.txt',
|
||||||
requirementsLinuxHash
|
requirementsLinuxHash,
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
['pip', '3.8.12', '__tests__/data/requirements.txt', requirementsHash],
|
[
|
||||||
['pipenv', '3.9.1', undefined, pipFileLockHash],
|
'pip',
|
||||||
['pipenv', '3.9.12', '__tests__/data/requirements.txt', requirementsHash],
|
'3.8.12',
|
||||||
['poetry', '3.9.1', undefined, poetryLockHash]
|
'__tests__/data/requirements.txt',
|
||||||
|
requirementsHash,
|
||||||
|
undefined
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'pipenv',
|
||||||
|
'3.9.1',
|
||||||
|
'__tests__/data/**/Pipfile.lock',
|
||||||
|
pipFileLockHash,
|
||||||
|
undefined
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'pipenv',
|
||||||
|
'3.9.12',
|
||||||
|
'__tests__/data/requirements.txt',
|
||||||
|
requirementsHash,
|
||||||
|
undefined
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'poetry',
|
||||||
|
'3.9.1',
|
||||||
|
'__tests__/data/**/poetry.lock',
|
||||||
|
poetryLockHash,
|
||||||
|
[
|
||||||
|
'/Users/patrick/Library/Caches/pypoetry/virtualenvs',
|
||||||
|
path.join(__dirname, 'data', 'inner', '.venv'),
|
||||||
|
path.join(__dirname, 'data', '.venv')
|
||||||
|
]
|
||||||
|
]
|
||||||
])(
|
])(
|
||||||
'restored dependencies for %s by primaryKey',
|
'restored dependencies for %s by primaryKey',
|
||||||
async (packageManager, pythonVersion, dependencyFile, fileHash) => {
|
async (
|
||||||
|
packageManager,
|
||||||
|
pythonVersion,
|
||||||
|
dependencyFile,
|
||||||
|
fileHash,
|
||||||
|
cachePaths
|
||||||
|
) => {
|
||||||
|
restoreCacheSpy.mockImplementation(
|
||||||
|
(cachePaths: string[], primaryKey: string, restoreKey?: string) => {
|
||||||
|
return primaryKey.includes(fileHash) ? primaryKey : '';
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
const cacheDistributor = getCacheDistributor(
|
const cacheDistributor = getCacheDistributor(
|
||||||
packageManager,
|
packageManager,
|
||||||
pythonVersion,
|
pythonVersion,
|
||||||
@@ -123,10 +177,21 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py
|
|||||||
|
|
||||||
await cacheDistributor.restoreCache();
|
await cacheDistributor.restoreCache();
|
||||||
|
|
||||||
|
if (cachePaths !== undefined) {
|
||||||
|
expect(saveStateSpy).toHaveBeenCalledWith(
|
||||||
|
State.CACHE_PATHS,
|
||||||
|
cachePaths
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (process.platform === 'linux' && packageManager === 'pip') {
|
if (process.platform === 'linux' && packageManager === 'pip') {
|
||||||
expect(infoSpy).toHaveBeenCalledWith(
|
expect(infoSpy).toHaveBeenCalledWith(
|
||||||
`Cache restored from key: setup-python-${process.env['RUNNER_OS']}-20.04-Ubuntu-python-${pythonVersion}-${packageManager}-${fileHash}`
|
`Cache restored from key: setup-python-${process.env['RUNNER_OS']}-20.04-Ubuntu-python-${pythonVersion}-${packageManager}-${fileHash}`
|
||||||
);
|
);
|
||||||
|
} else if (packageManager === 'poetry') {
|
||||||
|
expect(infoSpy).toHaveBeenCalledWith(
|
||||||
|
`Cache restored from key: setup-python-${process.env['RUNNER_OS']}-python-${pythonVersion}-${packageManager}-v2-${fileHash}`
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
expect(infoSpy).toHaveBeenCalledWith(
|
expect(infoSpy).toHaveBeenCalledWith(
|
||||||
`Cache restored from key: setup-python-${process.env['RUNNER_OS']}-python-${pythonVersion}-${packageManager}-${fileHash}`
|
`Cache restored from key: setup-python-${process.env['RUNNER_OS']}-python-${pythonVersion}-${packageManager}-${fileHash}`
|
||||||
@@ -136,11 +201,7 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py
|
|||||||
30000
|
30000
|
||||||
);
|
);
|
||||||
|
|
||||||
it.each([
|
it.each([['pipenv', '3.9.12', 'requirements.txt', 'requirements.txt']])(
|
||||||
['pip', '3.8.12', 'requirements-linux.txt', 'requirements-linux.txt'],
|
|
||||||
['pip', '3.8.12', 'requirements.txt', 'requirements.txt'],
|
|
||||||
['pipenv', '3.9.12', 'requirements.txt', 'requirements.txt']
|
|
||||||
])(
|
|
||||||
'Should throw an error because dependency file is not found',
|
'Should throw an error because dependency file is not found',
|
||||||
async (
|
async (
|
||||||
packageManager,
|
packageManager,
|
||||||
@@ -153,19 +214,58 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py
|
|||||||
pythonVersion,
|
pythonVersion,
|
||||||
dependencyFile
|
dependencyFile
|
||||||
);
|
);
|
||||||
await expect(cacheDistributor.restoreCache()).rejects.toThrowError(
|
|
||||||
|
await expect(cacheDistributor.restoreCache()).rejects.toThrow(
|
||||||
`No file in ${process.cwd()} matched to [${cacheDependencyPath
|
`No file in ${process.cwd()} matched to [${cacheDependencyPath
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.join(',')}], make sure you have checked out the target repository`
|
.join(',')}], make sure you have checked out the target repository`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
it.each([
|
||||||
|
['pip', '3.8.12', 'requirements-linux.txt'],
|
||||||
|
['pip', '3.8.12', 'requirements.txt']
|
||||||
|
])(
|
||||||
|
'Shouldn`t throw an error as there is a default file `pyproject.toml` to use when requirements.txt is not specified',
|
||||||
|
async (packageManager, pythonVersion, dependencyFile) => {
|
||||||
|
const cacheDistributor = getCacheDistributor(
|
||||||
|
packageManager,
|
||||||
|
pythonVersion,
|
||||||
|
dependencyFile
|
||||||
|
);
|
||||||
|
await expect(cacheDistributor.restoreCache()).resolves.not.toThrow();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
it.each([
|
||||||
|
['pip', '3.8.12', 'requirements-linux.txt'],
|
||||||
|
['pip', '3.8.12', 'requirements.txt']
|
||||||
|
])(
|
||||||
|
'Should throw an error as there is no default file `pyproject.toml` to use when requirements.txt is not specified',
|
||||||
|
async (packageManager, pythonVersion, dependencyFile) => {
|
||||||
|
const cacheDistributor = getCacheDistributor(
|
||||||
|
packageManager,
|
||||||
|
pythonVersion,
|
||||||
|
dependencyFile
|
||||||
|
) as any; // Widening PipCache | PipenvCache | PoetryCache type to any allow us to change private property on the cacheDistributor to test value: "**/pyprojecttest.toml"
|
||||||
|
|
||||||
|
cacheDistributor.cacheDependencyBackupPath = '**/pyprojecttest.toml';
|
||||||
|
|
||||||
|
await expect(cacheDistributor.restoreCache()).rejects.toThrow();
|
||||||
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Dependencies changed', () => {
|
describe('Dependencies changed', () => {
|
||||||
it.each([
|
it.each([
|
||||||
['pip', '3.8.12', undefined, pipFileLockHash],
|
['pip', '3.8.12', '__tests__/data/**/requirements.txt', pipFileLockHash],
|
||||||
['pip', '3.8.12', '**/requirements-linux.txt', pipFileLockHash],
|
[
|
||||||
|
'pip',
|
||||||
|
'3.8.12',
|
||||||
|
'__tests__/data/**/requirements-linux.txt',
|
||||||
|
pipFileLockHash
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'pip',
|
'pip',
|
||||||
'3.8.12',
|
'3.8.12',
|
||||||
@@ -173,9 +273,9 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py
|
|||||||
pipFileLockHash
|
pipFileLockHash
|
||||||
],
|
],
|
||||||
['pip', '3.8.12', '__tests__/data/requirements.txt', pipFileLockHash],
|
['pip', '3.8.12', '__tests__/data/requirements.txt', pipFileLockHash],
|
||||||
['pipenv', '3.9.1', undefined, requirementsHash],
|
['pipenv', '3.9.1', '__tests__/data/**/Pipfile.lock', requirementsHash],
|
||||||
['pipenv', '3.9.12', '__tests__/data/requirements.txt', requirementsHash],
|
['pipenv', '3.9.12', '__tests__/data/requirements.txt', requirementsHash],
|
||||||
['poetry', '3.9.1', undefined, requirementsHash]
|
['poetry', '3.9.1', '__tests__/data/**/poetry.lock', requirementsHash]
|
||||||
])(
|
])(
|
||||||
'restored dependencies for %s by primaryKey',
|
'restored dependencies for %s by primaryKey',
|
||||||
async (packageManager, pythonVersion, dependencyFile, fileHash) => {
|
async (packageManager, pythonVersion, dependencyFile, fileHash) => {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ describe('run', () => {
|
|||||||
let infoSpy: jest.SpyInstance;
|
let infoSpy: jest.SpyInstance;
|
||||||
let warningSpy: jest.SpyInstance;
|
let warningSpy: jest.SpyInstance;
|
||||||
let debugSpy: jest.SpyInstance;
|
let debugSpy: jest.SpyInstance;
|
||||||
let saveSatetSpy: jest.SpyInstance;
|
let saveStateSpy: jest.SpyInstance;
|
||||||
let getStateSpy: jest.SpyInstance;
|
let getStateSpy: jest.SpyInstance;
|
||||||
let getInputSpy: jest.SpyInstance;
|
let getInputSpy: jest.SpyInstance;
|
||||||
let setFailedSpy: jest.SpyInstance;
|
let setFailedSpy: jest.SpyInstance;
|
||||||
@@ -43,8 +43,8 @@ describe('run', () => {
|
|||||||
debugSpy = jest.spyOn(core, 'debug');
|
debugSpy = jest.spyOn(core, 'debug');
|
||||||
debugSpy.mockImplementation(input => undefined);
|
debugSpy.mockImplementation(input => undefined);
|
||||||
|
|
||||||
saveSatetSpy = jest.spyOn(core, 'saveState');
|
saveStateSpy = jest.spyOn(core, 'saveState');
|
||||||
saveSatetSpy.mockImplementation(input => undefined);
|
saveStateSpy.mockImplementation(input => undefined);
|
||||||
|
|
||||||
getStateSpy = jest.spyOn(core, 'getState');
|
getStateSpy = jest.spyOn(core, 'getState');
|
||||||
getStateSpy.mockImplementation(input => {
|
getStateSpy.mockImplementation(input => {
|
||||||
@@ -87,6 +87,7 @@ describe('run', () => {
|
|||||||
describe('Validate unchanged cache is not saved', () => {
|
describe('Validate unchanged cache is not saved', () => {
|
||||||
it('should not save cache for pip', async () => {
|
it('should not save cache for pip', async () => {
|
||||||
inputs['cache'] = 'pip';
|
inputs['cache'] = 'pip';
|
||||||
|
inputs['python-version'] = '3.10.0';
|
||||||
|
|
||||||
await run();
|
await run();
|
||||||
|
|
||||||
@@ -103,22 +104,7 @@ describe('run', () => {
|
|||||||
|
|
||||||
it('should not save cache for pipenv', async () => {
|
it('should not save cache for pipenv', async () => {
|
||||||
inputs['cache'] = 'pipenv';
|
inputs['cache'] = 'pipenv';
|
||||||
|
inputs['python-version'] = '3.10.0';
|
||||||
await run();
|
|
||||||
|
|
||||||
expect(getInputSpy).toHaveBeenCalled();
|
|
||||||
expect(debugSpy).toHaveBeenCalledWith(
|
|
||||||
`paths for caching are ${__dirname}`
|
|
||||||
);
|
|
||||||
expect(getStateSpy).toHaveBeenCalledTimes(3);
|
|
||||||
expect(infoSpy).toHaveBeenCalledWith(
|
|
||||||
`Cache hit occurred on the primary key ${requirementsHash}, not saving cache.`
|
|
||||||
);
|
|
||||||
expect(setFailedSpy).not.toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should not save cache for pipenv', async () => {
|
|
||||||
inputs['cache'] = 'pipenv';
|
|
||||||
|
|
||||||
await run();
|
await run();
|
||||||
|
|
||||||
@@ -137,6 +123,7 @@ describe('run', () => {
|
|||||||
describe('action saves the cache', () => {
|
describe('action saves the cache', () => {
|
||||||
it('saves cache from pip', async () => {
|
it('saves cache from pip', async () => {
|
||||||
inputs['cache'] = 'pip';
|
inputs['cache'] = 'pip';
|
||||||
|
inputs['python-version'] = '3.10.0';
|
||||||
getStateSpy.mockImplementation((name: string) => {
|
getStateSpy.mockImplementation((name: string) => {
|
||||||
if (name === State.CACHE_MATCHED_KEY) {
|
if (name === State.CACHE_MATCHED_KEY) {
|
||||||
return requirementsHash;
|
return requirementsHash;
|
||||||
@@ -163,6 +150,7 @@ describe('run', () => {
|
|||||||
|
|
||||||
it('saves cache from pipenv', async () => {
|
it('saves cache from pipenv', async () => {
|
||||||
inputs['cache'] = 'pipenv';
|
inputs['cache'] = 'pipenv';
|
||||||
|
inputs['python-version'] = '3.10.0';
|
||||||
getStateSpy.mockImplementation((name: string) => {
|
getStateSpy.mockImplementation((name: string) => {
|
||||||
if (name === State.CACHE_MATCHED_KEY) {
|
if (name === State.CACHE_MATCHED_KEY) {
|
||||||
return pipFileLockHash;
|
return pipFileLockHash;
|
||||||
@@ -189,6 +177,7 @@ describe('run', () => {
|
|||||||
|
|
||||||
it('saves cache from poetry', async () => {
|
it('saves cache from poetry', async () => {
|
||||||
inputs['cache'] = 'poetry';
|
inputs['cache'] = 'poetry';
|
||||||
|
inputs['python-version'] = '3.10.0';
|
||||||
getStateSpy.mockImplementation((name: string) => {
|
getStateSpy.mockImplementation((name: string) => {
|
||||||
if (name === State.CACHE_MATCHED_KEY) {
|
if (name === State.CACHE_MATCHED_KEY) {
|
||||||
return poetryLockHash;
|
return poetryLockHash;
|
||||||
@@ -215,6 +204,7 @@ describe('run', () => {
|
|||||||
|
|
||||||
it('saves with -1 cacheId , should not fail workflow', async () => {
|
it('saves with -1 cacheId , should not fail workflow', async () => {
|
||||||
inputs['cache'] = 'poetry';
|
inputs['cache'] = 'poetry';
|
||||||
|
inputs['python-version'] = '3.10.0';
|
||||||
getStateSpy.mockImplementation((name: string) => {
|
getStateSpy.mockImplementation((name: string) => {
|
||||||
if (name === State.STATE_CACHE_PRIMARY_KEY) {
|
if (name === State.STATE_CACHE_PRIMARY_KEY) {
|
||||||
return poetryLockHash;
|
return poetryLockHash;
|
||||||
@@ -241,8 +231,9 @@ describe('run', () => {
|
|||||||
expect(setFailedSpy).not.toHaveBeenCalled();
|
expect(setFailedSpy).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('saves with error from toolkit, should fail workflow', async () => {
|
it('saves with error from toolkit, should not fail the workflow', async () => {
|
||||||
inputs['cache'] = 'npm';
|
inputs['cache'] = 'npm';
|
||||||
|
inputs['python-version'] = '3.10.0';
|
||||||
getStateSpy.mockImplementation((name: string) => {
|
getStateSpy.mockImplementation((name: string) => {
|
||||||
if (name === State.STATE_CACHE_PRIMARY_KEY) {
|
if (name === State.STATE_CACHE_PRIMARY_KEY) {
|
||||||
return poetryLockHash;
|
return poetryLockHash;
|
||||||
@@ -263,7 +254,7 @@ describe('run', () => {
|
|||||||
expect(getStateSpy).toHaveBeenCalledTimes(3);
|
expect(getStateSpy).toHaveBeenCalledTimes(3);
|
||||||
expect(infoSpy).not.toHaveBeenCalledWith();
|
expect(infoSpy).not.toHaveBeenCalledWith();
|
||||||
expect(saveCacheSpy).toHaveBeenCalled();
|
expect(saveCacheSpy).toHaveBeenCalled();
|
||||||
expect(setFailedSpy).toHaveBeenCalled();
|
expect(setFailedSpy).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
../poetry.lock
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user