Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Main workflow
on: [push]
on: [push, pull_request]
jobs:
run:
name: Run
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
7 changes: 4 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
@@ -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.'
Expand All @@ -13,4 +14,4 @@ runs:
main: 'dist/index.js'
branding:
icon: 'code'
color: 'yellow'
color: 'yellow'
163 changes: 153 additions & 10 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports =
/******/ // the startup function
/******/ function startup() {
/******/ // Load entry module and return exports
/******/ return __webpack_require__(429);
/******/ return __webpack_require__(264);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran with version 0.20.5 of ncc.

/******/ };
/******/
/******/ // run startup
Expand Down Expand Up @@ -71,22 +71,98 @@ module.exports = require("https");

/***/ }),

/***/ 264:
/***/ (function(module, __unusedexports, __webpack_require__) {

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__(429);
/******/ };
/******/
/******/ // run startup
/******/ return startup();
/******/ })
/************************************************************************/
/******/ ({

/***/ 16:
/***/ (function(module) {

module.exports = __webpack_require__(16);

/***/ }),

/***/ 87:
/***/ (function(module) {

module.exports = __webpack_require__(87);

/***/ }),

/***/ 129:
/***/ (function(module) {

module.exports = __webpack_require__(129);

/***/ }),

/***/ 211:
/***/ (function(module) {

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
Expand Down Expand Up @@ -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);

/***/ }),

Expand Down Expand Up @@ -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);

/***/ })

/******/ });

/***/ }),

Expand Down Expand Up @@ -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) {

Expand Down
14 changes: 7 additions & 7 deletions docs/contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/find-python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions yaml-lint-config.yml
Original file line number Diff line number Diff line change
@@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had tried spreading the description, etc., across multiple lines, but I decided it would probably be better to raise the limit. Monitors have gotten bigger since the days of the 80-char guideline, so I think 120 is a good number today.

line-length:
max: 80
max: 120
level: warning