Merge pull request #46 from brcrista/brcrista/old-references

Update terminology in setup-python
This commit is contained in:
Konrad Pabjan 2019-12-30 10:37:15 -05:00 committed by GitHub
commit f907029c9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 173 additions and 29 deletions

View file

@ -1,5 +1,5 @@
name: Main workflow
on: [push]
on: [push, pull_request]
jobs:
run:
name: Run

View file

@ -19,7 +19,7 @@ steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-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 SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- run: python my_script.py
```

View file

@ -1,9 +1,10 @@
---
name: 'Setup Python'
description: 'Set up a specific version of Python and add the command-line tools to the PATH'
description: 'Set up a specific version of Python and add the command-line tools to the PATH.'
author: 'GitHub'
inputs:
python-version:
description: 'Version range or exact version of a Python version to use, using semvers version range syntax.'
description: "Version range or exact version of a Python version to use, using SemVer's version range syntax."
default: '3.x'
architecture:
description: 'The target architecture (x86, x64) of the Python interpreter.'
@ -13,4 +14,4 @@ runs:
main: 'dist/index.js'
branding:
icon: 'code'
color: 'yellow'
color: 'yellow'

169
dist/index.js vendored
View file

@ -1,3 +1,79 @@
module.exports =
/******/ (function(modules, runtime) { // webpackBootstrap
/******/ "use strict";
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ __webpack_require__.ab = __dirname + "/";
/******/
/******/ // the startup function
/******/ function startup() {
/******/ // Load entry module and return exports
/******/ return __webpack_require__(264);
/******/ };
/******/
/******/ // run startup
/******/ return startup();
/******/ })
/************************************************************************/
/******/ ({
/***/ 16:
/***/ (function(module) {
module.exports = require("tls");
/***/ }),
/***/ 87:
/***/ (function(module) {
module.exports = require("os");
/***/ }),
/***/ 129:
/***/ (function(module) {
module.exports = require("child_process");
/***/ }),
/***/ 211:
/***/ (function(module) {
module.exports = require("https");
/***/ }),
/***/ 264:
/***/ (function(module, __unusedexports, __webpack_require__) {
module.exports =
/******/ (function(modules, runtime) { // webpackBootstrap
/******/ "use strict";
@ -46,47 +122,47 @@ module.exports =
/***/ 16:
/***/ (function(module) {
module.exports = require("tls");
module.exports = __webpack_require__(16);
/***/ }),
/***/ 87:
/***/ (function(module) {
module.exports = require("os");
module.exports = __webpack_require__(87);
/***/ }),
/***/ 129:
/***/ (function(module) {
module.exports = require("child_process");
module.exports = __webpack_require__(129);
/***/ }),
/***/ 211:
/***/ (function(module) {
module.exports = require("https");
module.exports = __webpack_require__(211);
/***/ }),
/***/ 357:
/***/ (function(module) {
module.exports = require("assert");
module.exports = __webpack_require__(357);
/***/ }),
/***/ 417:
/***/ (function(module) {
module.exports = require("crypto");
module.exports = __webpack_require__(417);
/***/ }),
/***/ 429:
/***/ (function(module, __unusedexports, __webpack_require__) {
/***/ (function(module, __unusedexports, __nested_webpack_require_2019__) {
module.exports =
/******/ (function(modules, runtime) { // webpackBootstrap
@ -136,28 +212,28 @@ module.exports =
/***/ 16:
/***/ (function(module) {
module.exports = __webpack_require__(16);
module.exports = __nested_webpack_require_2019__(16);
/***/ }),
/***/ 87:
/***/ (function(module) {
module.exports = __webpack_require__(87);
module.exports = __nested_webpack_require_2019__(87);
/***/ }),
/***/ 129:
/***/ (function(module) {
module.exports = __webpack_require__(129);
module.exports = __nested_webpack_require_2019__(129);
/***/ }),
/***/ 211:
/***/ (function(module) {
module.exports = __webpack_require__(211);
module.exports = __nested_webpack_require_2019__(211);
/***/ }),
@ -5404,14 +5480,67 @@ module.exports = __nested_webpack_require_1759__(835);
/***/ 357:
/***/ (function(module) {
module.exports = __webpack_require__(357);
module.exports = __nested_webpack_require_2019__(357);
/***/ }),
/***/ 417:
/***/ (function(module) {
module.exports = __webpack_require__(417);
module.exports = __nested_webpack_require_2019__(417);
/***/ }),
/***/ 605:
/***/ (function(module) {
module.exports = __nested_webpack_require_2019__(605);
/***/ }),
/***/ 614:
/***/ (function(module) {
module.exports = __nested_webpack_require_2019__(614);
/***/ }),
/***/ 622:
/***/ (function(module) {
module.exports = __nested_webpack_require_2019__(622);
/***/ }),
/***/ 631:
/***/ (function(module) {
module.exports = __nested_webpack_require_2019__(631);
/***/ }),
/***/ 669:
/***/ (function(module) {
module.exports = __nested_webpack_require_2019__(669);
/***/ }),
/***/ 747:
/***/ (function(module) {
module.exports = __nested_webpack_require_2019__(747);
/***/ }),
/***/ 835:
/***/ (function(module) {
module.exports = __nested_webpack_require_2019__(835);
/***/ })
/******/ });
/***/ }),
@ -5468,6 +5597,20 @@ module.exports = __webpack_require__(835);
/***/ }),
/***/ 357:
/***/ (function(module) {
module.exports = require("assert");
/***/ }),
/***/ 417:
/***/ (function(module) {
module.exports = require("crypto");
/***/ }),
/***/ 605:
/***/ (function(module) {

View file

@ -2,29 +2,29 @@
### Checkin
- Do checkin source (src)
- Do checkin a single index.js file after running `ncc`
- Do not checkin node_modules
- Do check in source (`src/`)
- Do check in a single `index.js` file after running `ncc`
- Do not check in `node_modules/`
### NCC
In order to avoid uploading `node_modules` to the repository, we use [zeit/ncc](https://github.com/zeit/ncc) to create a single `index.js` file that gets saved in `dist/`.
In order to avoid uploading `node_modules/` to the repository, we use [zeit/ncc](https://github.com/zeit/ncc) to create a single `index.js` file that gets saved in `dist/`.
### Developing
If you're developing locally you can run
If you're developing locally, you can run
```
npm install
tsc
ncc build
```
Any files generated using `tsc` will be added to `lib/*`, however those files also are not uploaded to the repository and are exluded using `.gitignore`.
Any files generated using `tsc` will be added to `lib/`, however those files also are not uploaded to the repository and are exluded using `.gitignore`.
During the commit step, Husky will take care of formatting all files with [Prettier](https://github.com/prettier/prettier)
### Testing
We ask that you include a link to a succesfull run that utilizes the changes you are working on. For example, if your changes are in the branch `newAwesomeFeature`, then show an example run that uses `setup-python@newAwesomeFeature` or `my-fork@newAwesomeFeature`. This will help speed up testing and help us confirm that there are no breaking changes or bugs.
We ask that you include a link to a successful run that utilizes the changes you are working on. For example, if your changes are in the branch `newAwesomeFeature`, then show an example run that uses `setup-python@newAwesomeFeature` or `my-fork@newAwesomeFeature`. This will help speed up testing and help us confirm that there are no breaking changes or bugs.
### Releases

View file

@ -57,7 +57,7 @@ function usePyPy(majorVersion: 2 | 3, architecture: string): void {
if (!installDir && IS_WINDOWS) {
// PyPy only precompiles binaries for x86, but the architecture parameter defaults to x64.
// On Hosted VS2017, we only install an x86 version.
// On our Windows virtual environments, we only install an x86 version.
// Fall back to x86.
installDir = findPyPy('x86');
}
@ -120,7 +120,7 @@ async function useCpythonVersion(
if (IS_WINDOWS) {
// Add --user directory
// `installDir` from tool cache should look like $AGENT_TOOLSDIRECTORY/Python/<semantic version>/x64/
// `installDir` from tool cache should look like $RUNNER_TOOL_CACHE/Python/<semantic version>/x64/
// So if `findLocalTool` succeeded above, we must have a conformant `installDir`
const version = path.basename(path.dirname(installDir));
const major = semver.major(version);

View file

@ -1,7 +1,7 @@
extends: default
rules:
# 80 chars should be enough, but don't fail if a line is longer
# 120 chars should be enough, but don't fail if a line is longer
line-length:
max: 80
max: 120
level: warning