You've already forked setup-python
mirror of
https://github.com/actions/setup-python.git
synced 2025-07-04 22:23:14 +07:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
28a6c1b915 | |||
6654142a95 | |||
47b0b94f96 | |||
1396627e9d | |||
a3e488ea33 | |||
62618cdaa5 | |||
31d200eb44 | |||
ebb2329155 | |||
346e88b930 |
10
README.md
10
README.md
@ -4,9 +4,9 @@
|
|||||||
<a href="https://github.com/actions/setup-python"><img alt="GitHub Actions status" src="https://github.com/actions/setup-python/workflows/Main%20workflow/badge.svg"></a>
|
<a href="https://github.com/actions/setup-python"><img alt="GitHub Actions status" src="https://github.com/actions/setup-python/workflows/Main%20workflow/badge.svg"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
This action sets up a python environment for use in actions by:
|
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.
|
- 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.
|
||||||
- registering problem matchers for error output
|
- registering problem matchers for error output
|
||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
@ -31,14 +31,14 @@ jobs:
|
|||||||
runs-on: ubuntu-16.04
|
runs-on: ubuntu-16.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python: [ '2.x', '3.x', 'pypy3' ]
|
python-version: [ '2.x', '3.x', 'pypy2', 'pypy3' ]
|
||||||
name: Python ${{ matrix.python }} sample
|
name: Python ${{ matrix.python-version }} sample
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
- name: Setup python
|
- name: Setup python
|
||||||
uses: actions/setup-python@v1
|
uses: actions/setup-python@v1
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python-version }}
|
||||||
architecture: x64
|
architecture: x64
|
||||||
- run: python my_script.py
|
- run: python my_script.py
|
||||||
```
|
```
|
||||||
|
@ -8,10 +8,6 @@ inputs:
|
|||||||
architecture:
|
architecture:
|
||||||
description: 'The target architecture (x86, x64) of the Python interpreter.'
|
description: 'The target architecture (x86, x64) of the Python interpreter.'
|
||||||
default: 'x64'
|
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'
|
|
||||||
deprecationMessage: 'The version property will not be supported after October 1, 2019. Use python-version instead'
|
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node12'
|
||||||
main: 'lib/setup-python.js'
|
main: 'lib/setup-python.js'
|
||||||
|
@ -21,10 +21,7 @@ const path = __importStar(require("path"));
|
|||||||
function run() {
|
function run() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
try {
|
try {
|
||||||
let version = core.getInput('version');
|
let version = core.getInput('python-version');
|
||||||
if (!version) {
|
|
||||||
version = core.getInput('python-version');
|
|
||||||
}
|
|
||||||
if (version) {
|
if (version) {
|
||||||
const arch = core.getInput('architecture', { required: true });
|
const arch = core.getInput('architecture', { required: true });
|
||||||
yield finder.findPythonVersion(version, arch);
|
yield finder.findPythonVersion(version, arch);
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/actions/ssetup-python.git"
|
"url": "git+https://github.com/actions/setup-python.git"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"actions",
|
"actions",
|
||||||
|
@ -4,10 +4,7 @@ import * as path from 'path';
|
|||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
try {
|
try {
|
||||||
let version = core.getInput('version');
|
let version = core.getInput('python-version');
|
||||||
if (!version) {
|
|
||||||
version = core.getInput('python-version');
|
|
||||||
}
|
|
||||||
if (version) {
|
if (version) {
|
||||||
const arch: string = core.getInput('architecture', {required: true});
|
const arch: string = core.getInput('architecture', {required: true});
|
||||||
await finder.findPythonVersion(version, arch);
|
await finder.findPythonVersion(version, arch);
|
||||||
|
Reference in New Issue
Block a user