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 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') }) 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/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) { 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": { 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) {