From 379d006a0223314ab309bbf1d2f31b70585825e6 Mon Sep 17 00:00:00 2001 From: Yasser Tahiri Date: Sat, 24 Feb 2024 17:52:09 +0100 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=94=A5=20remove=20preview=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- action.yml | 4 ---- src/inputs.ts | 12 ------------ 2 files changed, 16 deletions(-) diff --git a/action.yml b/action.yml index e6d97c7..f547fcd 100644 --- a/action.yml +++ b/action.yml @@ -2,10 +2,6 @@ name: Setup uv description: Set up your GitHub Actions workflow with a specific version of uv author: Yasser Tahiri inputs: - uv-preview: - description: Allow to install prerelease versions of uv. - required: false - default: "false" uv-version: description: uv version to use, if version is not provided then latest stable version will be used required: false diff --git a/src/inputs.ts b/src/inputs.ts index 0d25c4b..7e30664 100644 --- a/src/inputs.ts +++ b/src/inputs.ts @@ -1,29 +1,17 @@ import { getInput } from '@actions/core' import semver from 'semver' export interface Inputs { - // Finder related inputs - preview: boolean version: string | null venv: string | null } export function getInputs(): Inputs { return { - preview: getBooleanInput('uv-preview'), version: getVersionInput('uv-version'), venv: getVenvInput('uv-venv') } } -export function getBooleanInput(name: string, default_ = false): boolean { - const value = getInput(name) - if (!value) { - return default_ - } - - return value === 'true' -} - export function getVersionInput(name: string): string | null { const version = getInput(name) if (!version) { From fd5be8dd426244fe6a355280d86630dfbe57bd8c Mon Sep 17 00:00:00 2001 From: Yasser Tahiri Date: Sat, 24 Feb 2024 17:52:29 +0100 Subject: [PATCH 2/5] =?UTF-8?q?=E2=9C=85=20remove=20preview=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __tests__/input.test.ts | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/__tests__/input.test.ts b/__tests__/input.test.ts index e063c19..7146526 100644 --- a/__tests__/input.test.ts +++ b/__tests__/input.test.ts @@ -1,10 +1,5 @@ import { getInput } from '@actions/core' -import { - getBooleanInput, - getInputs, - getVenvInput, - getVersionInput -} from '../src/inputs' +import { getInputs, getVenvInput, getVersionInput } from '../src/inputs' const TEST_ENV_VARS = { INPUT_MISSING: '', @@ -12,9 +7,7 @@ const TEST_ENV_VARS = { INPUT_TRUTHY: 'true', INPUT_VERSION_UNSUPPORTED: '0.0.3', INPUT_VERSION_SUPPORTED: '0.1.2', - INPUT_VERSION_ALPHA: '0.1.3.0a1', - 'INPUT_UV-PREVIEW': 'true', 'INPUT_UV-VERSION': '0.1.2', 'INPUT_UV-VENV': 'my_venv' } @@ -32,25 +25,12 @@ describe('options', () => { } }) - it('getBooleanInput returns false if input is missing', () => { - expect(getBooleanInput('missing')).toBeFalsy() - }) - - it('getBooleanInput returns false if input is falsy', () => { - expect(getBooleanInput('falsy')).toBeFalsy() - }) - - it('getBooleanInput returns true if input is truthy', () => { - expect(getBooleanInput('truthy')).toBeTruthy() - }) - it('getVersionInput returns null if input is missing', () => { expect(getVersionInput('missing')).toBeNull() }) it('getInputs returns inputs', () => { expect(getInputs()).toStrictEqual({ - preview: true, version: '0.1.2', venv: 'my_venv' }) @@ -66,10 +46,6 @@ describe('options', () => { expect(getVersionInput('version_supported')).toBe('0.1.2') }) - it('getVersionInput returns version if input is alpha', () => { - expect(getVersionInput('version_alpha')).toBe('0.1.3.0a1') - }) - it('getVenvInput returns venv name if input is valid', () => { expect(getVenvInput('uv-venv')).toBe('my_venv') }) From 6f8ea071e525a049a96e5676c727cddb8b95f38c Mon Sep 17 00:00:00 2001 From: Yasser Tahiri Date: Sat, 24 Feb 2024 17:52:39 +0100 Subject: [PATCH 3/5] :memo: update documentation --- README.md | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/README.md b/README.md index 3af33b1..094feaa 100644 --- a/README.md +++ b/README.md @@ -37,20 +37,6 @@ steps: - run: uv --version ``` -### Allow to install prerelease versions of UV - -```yaml -steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: "3.11" - - uses: yezz123/setup-uv@v1 - with: - uv-preview: true - - run: uv --version -``` - ### Create and activate a virtual environment using uv ```yaml From bf04abe1c74e345c74f7988586b1b51834e2d26d Mon Sep 17 00:00:00 2001 From: Yasser Tahiri Date: Sat, 24 Feb 2024 17:52:51 +0100 Subject: [PATCH 4/5] =?UTF-8?q?=E2=9C=A8=20Remove=20unused=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/index.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/dist/index.js b/dist/index.js index 50dcc60..a66889f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -31906,25 +31906,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getVenvInput = exports.getVersionInput = exports.getBooleanInput = exports.getInputs = void 0; +exports.getVenvInput = exports.getVersionInput = exports.getInputs = void 0; const core_1 = __nccwpck_require__(2186); const semver_1 = __importDefault(__nccwpck_require__(1383)); function getInputs() { return { - preview: getBooleanInput('uv-preview'), version: getVersionInput('uv-version'), venv: getVenvInput('uv-venv') }; } exports.getInputs = getInputs; -function getBooleanInput(name, default_ = false) { - const value = (0, core_1.getInput)(name); - if (!value) { - return default_; - } - return value === 'true'; -} -exports.getBooleanInput = getBooleanInput; function getVersionInput(name) { const version = (0, core_1.getInput)(name); if (!version) { From 17ce5cb53f389802668dea20d3c6d130364c928f Mon Sep 17 00:00:00 2001 From: Yasser Tahiri Date: Sat, 24 Feb 2024 17:53:30 +0100 Subject: [PATCH 5/5] :bug: Remove lint and coverage scripts from "all" script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 936d20a..c3f5308 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "package": "ncc build src/main.ts --license licenses.txt", "package:watch": "npm run package -- --watch", "test": "jest", - "all": "npm run format:write && npm run lint && npm run test && npm run coverage && npm run package" + "all": "npm run format:write && npm run test && npm run package" }, "license": "MIT", "jest": {