From 633a4406d76d99c3f56ed47c2a1d0f42e139123a Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Thu, 1 Aug 2019 11:07:19 -0400 Subject: [PATCH 1/5] Quoting --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ccb969dae..acf0b51ce 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ steps: - uses: actions/checkout@master - uses: actions/setup-python@v1 with: - version: 3.x // Version range or exact version of a Python version to use, using semvers version range syntax. - architecture: x64 // (x64 or x86) + version: '3.x' // Version range or exact version of a Python version to use, using semvers version range syntax. + architecture: 'x64' // (x64 or x86) - run: python my_script.py ``` @@ -24,9 +24,10 @@ Matrix Testing: ```yaml jobs: build: + runs-on: ubuntu-16.04 strategy: matrix: - python: [ 2.x, 3.x, pypy3 ] + python: [ '2.x', '3.x', 'pypy3' ] name: Python ${{ matrix.python }} sample steps: - uses: actions/checkout@master From 0611362f9b41ff4e62e3b953629e0d2cf35f8f23 Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Thu, 8 Aug 2019 13:34:19 -0400 Subject: [PATCH 2/5] Update action.yml --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index d1d761271..b891162e9 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,5 @@ -name: 'Setup Node.js for use with actions' -description: 'Setup a Node.js environment and add it to the PATH, additionally providing proxy support' +name: 'Setup Python for use with actions' +description: 'Setup a Python environment and add it to the PATH, additionally providing proxy support' author: 'GitHub' inputs: version: From fe821292b0fa63bfd942acab615209babf3dd14d Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Mon, 12 Aug 2019 14:40:58 -0400 Subject: [PATCH 3/5] Update action name --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index b891162e9..413448668 100644 --- a/action.yml +++ b/action.yml @@ -1,4 +1,4 @@ -name: 'Setup Python for use with actions' +name: 'Setup Python environment' description: 'Setup a Python environment and add it to the PATH, additionally providing proxy support' author: 'GitHub' inputs: From 3342d62b16a340578de4f3e3f7669c60ceac9024 Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Mon, 12 Aug 2019 15:13:56 -0400 Subject: [PATCH 4/5] Add badge --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index acf0b51ce..3032964d9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # setup-python +

+ GitHub Actions status +

+ This action sets up a python environment for use in actions by: - optionally installing a version of python and adding to PATH. Note that this action only uses versions of Python already installed in the cache. The action will fail if no matching versions are found. From e336b852d5f9655a0094c046d25132683519d762 Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Tue, 13 Aug 2019 16:30:18 -0400 Subject: [PATCH 5/5] Use python-version (#10) --- README.md | 4 ++-- action.yml | 7 +++++-- lib/setup-python.js | 5 ++++- src/setup-python.ts | 5 ++++- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3032964d9..8040f8995 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ steps: - uses: actions/checkout@master - uses: actions/setup-python@v1 with: - version: '3.x' // Version range or exact version of a Python version to use, using semvers version range syntax. + python-version: '3.x' // Version range or exact version of a Python version to use, using semvers version range syntax. architecture: 'x64' // (x64 or x86) - run: python my_script.py ``` @@ -38,7 +38,7 @@ jobs: - name: Setup python uses: actions/setup-python@v1 with: - version: ${{ matrix.python }} + python-version: ${{ matrix.python }} architecture: x64 - run: python my_script.py ``` diff --git a/action.yml b/action.yml index 413448668..0c04aede8 100644 --- a/action.yml +++ b/action.yml @@ -1,13 +1,16 @@ name: 'Setup Python environment' description: 'Setup a Python environment and add it to the PATH, additionally providing proxy support' author: 'GitHub' -inputs: - version: +inputs: + python-version: description: 'Version range or exact version of a Python version to use, using semvers version range syntax.' default: '3.x' architecture: description: 'The target architecture (x86, x64) of the Python interpreter.' default: 'x64' +# Deprecated option, do not use. Will not be supported after October 1, 2019 + version: + description: 'Deprecated. Use python-version instead. Will not be supported after October 1, 2019' runs: using: 'node12' main: 'lib/setup-python.js' diff --git a/lib/setup-python.js b/lib/setup-python.js index 7b7fe07ca..ecbf61112 100644 --- a/lib/setup-python.js +++ b/lib/setup-python.js @@ -21,7 +21,10 @@ const path = __importStar(require("path")); function run() { return __awaiter(this, void 0, void 0, function* () { try { - const version = core.getInput('version'); + let version = core.getInput('version'); + if (!version) { + version = core.getInput('python-version'); + } if (version) { const arch = core.getInput('architecture', { required: true }); yield finder.findPythonVersion(version, arch); diff --git a/src/setup-python.ts b/src/setup-python.ts index 68540d881..3f72debe3 100644 --- a/src/setup-python.ts +++ b/src/setup-python.ts @@ -4,7 +4,10 @@ import * as path from 'path'; async function run() { try { - const version: string = core.getInput('version'); + let version = core.getInput('version'); + if (!version) { + version = core.getInput('python-version'); + } if (version) { const arch: string = core.getInput('architecture', {required: true}); await finder.findPythonVersion(version, arch);