diff --git a/.github/workflows/e2e-cache-freethreaded.yml b/.github/workflows/e2e-cache-freethreaded.yml index 40c2d859..3c998cfc 100644 --- a/.github/workflows/e2e-cache-freethreaded.yml +++ b/.github/workflows/e2e-cache-freethreaded.yml @@ -239,56 +239,3 @@ jobs: pip-version: '25.0.1' - name: Install dependencies run: pip install numpy pandas requests - - python-pip-dependencies-caching-with-pip-install: - name: Test pip (Python ${{ matrix.python-version}}, ${{ matrix.os }}) - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: - [ - ubuntu-latest, - ubuntu-22.04, - ubuntu-24.04-arm, - ubuntu-22.04-arm, - windows-latest, - macos-latest, - macos-15-intel - ] - python-version: [3.13.0t, 3.13.1t, 3.13.2t] - steps: - - uses: actions/checkout@v6 - - name: Setup Python - uses: ./ - with: - python-version: ${{ matrix.python-version }} - cache: 'pip' - pip-install: numpy pandas requests - - python-pip-dependencies-caching-path-with-pip-install: - name: Test pip (Python ${{ matrix.python-version}}, ${{ matrix.os }}, caching path) - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: - [ - ubuntu-latest, - ubuntu-22.04, - ubuntu-24.04-arm, - ubuntu-22.04-arm, - windows-latest, - macos-latest, - macos-15-intel - ] - python-version: [3.13.0t, 3.13.1t, 3.13.2t] - steps: - - uses: actions/checkout@v6 - - name: Setup Python - uses: ./ - with: - python-version: ${{ matrix.python-version }} - cache: 'pip' - cache-dependency-path: __tests__/data/requirements.txt - pip-install: numpy pandas requests diff --git a/.github/workflows/e2e-cache.yml b/.github/workflows/e2e-cache.yml index 6b09cb01..bb36cfb1 100644 --- a/.github/workflows/e2e-cache.yml +++ b/.github/workflows/e2e-cache.yml @@ -316,56 +316,3 @@ jobs: pip-version: '25.0.1' - name: Install dependencies run: pip install numpy pandas requests - - python-pip-dependencies-caching-with-pip-install: - name: Test pip (Python ${{ matrix.python-version}}, ${{ matrix.os }}) - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: - [ - ubuntu-latest, - ubuntu-24.04-arm, - ubuntu-22.04, - ubuntu-22.04-arm, - windows-latest, - macos-latest, - macos-15-intel - ] - python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] - steps: - - uses: actions/checkout@v6 - - name: Setup Python - uses: ./ - with: - python-version: ${{ matrix.python-version }} - cache: 'pip' - pip-install: numpy pandas requests - - python-pip-dependencies-caching-path-with-pip-install: - name: Test pip (Python ${{ matrix.python-version}}, ${{ matrix.os }}, caching path) - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: - [ - ubuntu-latest, - ubuntu-24.04-arm, - ubuntu-22.04, - ubuntu-22.04-arm, - windows-latest, - macos-latest, - macos-15-intel - ] - python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] - steps: - - uses: actions/checkout@v6 - - name: Setup Python - uses: ./ - with: - python-version: ${{ matrix.python-version }} - cache: 'pip' - cache-dependency-path: __tests__/data/requirements.txt - pip-install: numpy pandas requests diff --git a/README.md b/README.md index 7cf695cf..6c9f9ff6 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,6 @@ See examples of using `cache` and `cache-dependency-path` for `pipenv` and `poet - [Using `setup-python` on GHES](docs/advanced-usage.md#using-setup-python-on-ghes) - [Allow pre-releases](docs/advanced-usage.md#allow-pre-releases) - [Using the pip-version input](docs/advanced-usage.md#using-the-pip-version-input) -- [Using the pip-install input](docs/advanced-usage.md#using-the-pip-install-input) ## Recommended permissions diff --git a/action.yml b/action.yml index 7a9a7b63..df6c8235 100644 --- a/action.yml +++ b/action.yml @@ -31,8 +31,6 @@ inputs: default: false pip-version: description: "Used to specify the version of pip to install with the Python. Supported format: major[.minor][.patch]." - pip-install: - description: "Used to specify the packages to install with pip after setting up Python. Can be a requirements file or package names." outputs: python-version: description: "The installed Python or PyPy version. Useful when given a version range as input." diff --git a/dist/setup/index.js b/dist/setup/index.js index 6ac18cd5..cbb96369 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -55865,24 +55865,12 @@ const os = __importStar(__nccwpck_require__(70857)); const fs_1 = __importDefault(__nccwpck_require__(79896)); const cache_factory_1 = __nccwpck_require__(80665); const utils_1 = __nccwpck_require__(71798); -const exec_1 = __nccwpck_require__(95236); function isPyPyVersion(versionSpec) { return versionSpec.startsWith('pypy'); } function isGraalPyVersion(versionSpec) { return versionSpec.startsWith('graalpy'); } -async function installPipPackages(pipInstall) { - core.info(`Installing pip packages: ${pipInstall}`); - try { - const installArgs = pipInstall.trim().split(/\s+/); - await (0, exec_1.exec)('python', ['-m', 'pip', 'install', ...installArgs]); - core.info('Successfully installed pip packages'); - } - catch (error) { - core.setFailed(`Failed to install pip packages from "${pipInstall}". Please verify that the package names, versions, or requirements files provided are correct and installable, that the specified packages and versions can be resolved from PyPI or the configured package index, and that your network connection is stable and allows access to the package index.`); - } -} async function cacheDependencies(cache, pythonVersion) { const cacheDependencyPath = core.getInput('cache-dependency-path') || undefined; const cacheDistributor = (0, cache_factory_1.getCacheDistributor)(cache, pythonVersion, cacheDependencyPath); @@ -55967,10 +55955,6 @@ async function run() { if (cache && (0, utils_1.isCacheFeatureAvailable)()) { await cacheDependencies(cache, pythonVersion); } - const pipInstall = core.getInput('pip-install'); - if (pipInstall) { - await installPipPackages(pipInstall); - } } else { core.warning('The `python-version` input is not set. The version of Python currently in `PATH` will be used.'); diff --git a/docs/advanced-usage.md b/docs/advanced-usage.md index a28707b4..1cc38fd3 100644 --- a/docs/advanced-usage.md +++ b/docs/advanced-usage.md @@ -23,7 +23,6 @@ - [Using `setup-python` on GHES](advanced-usage.md#using-setup-python-on-ghes) - [Allow pre-releases](advanced-usage.md#allow-pre-releases) - [Using the pip-version input](advanced-usage.md#using-the-pip-version-input) -- [Using the pip-install input](advanced-usage.md#using-the-pip-install-input) ## Using the `python-version` input @@ -673,22 +672,3 @@ The version of Pip should be specified in the format `major`, `major.minor`, or > The `pip-version` input is supported only with standard Python versions. It is not available when using PyPy or GraalPy. > Using a specific or outdated version of pip may result in compatibility or security issues and can cause job failures. For best practices and guidance, refer to the official [pip documentation](https://pip.pypa.io/en/stable/). - -## Using the pip-install input - -The `pip-install` input allows you to install dependencies as part of the Python setup step. - - -```yaml - steps: - - uses: actions/checkout@v6 - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: '3.13' - pip-install: -r requirements.txt -``` -> Note: This feature is intended for standard pip-based dependency installations. -For complex workflows, or alternative package managers (e.g., poetry, pipenv), we recommend using separate steps to maintain clarity and flexibility. - -> The `pip-install` input mirrors the flexibility of a standard pip install command and supports most of its arguments. diff --git a/src/setup-python.ts b/src/setup-python.ts index 91a0c176..5d585d73 100644 --- a/src/setup-python.ts +++ b/src/setup-python.ts @@ -13,7 +13,6 @@ import { getVersionInputFromFile, getVersionsInputFromPlainFile } from './utils'; -import {exec} from '@actions/exec'; function isPyPyVersion(versionSpec: string) { return versionSpec.startsWith('pypy'); @@ -23,19 +22,6 @@ function isGraalPyVersion(versionSpec: string) { return versionSpec.startsWith('graalpy'); } -async function installPipPackages(pipInstall: string) { - core.info(`Installing pip packages: ${pipInstall}`); - try { - const installArgs = pipInstall.trim().split(/\s+/); - await exec('python', ['-m', 'pip', 'install', ...installArgs]); - core.info('Successfully installed pip packages'); - } catch (error) { - core.setFailed( - `Failed to install pip packages from "${pipInstall}". Please verify that the package names, versions, or requirements files provided are correct and installable, that the specified packages and versions can be resolved from PyPI or the configured package index, and that your network connection is stable and allows access to the package index.` - ); - } -} - async function cacheDependencies(cache: string, pythonVersion: string) { const cacheDependencyPath = core.getInput('cache-dependency-path') || undefined; @@ -159,10 +145,6 @@ async function run() { if (cache && isCacheFeatureAvailable()) { await cacheDependencies(cache, pythonVersion); } - const pipInstall = core.getInput('pip-install'); - if (pipInstall) { - await installPipPackages(pipInstall); - } } else { core.warning( 'The `python-version` input is not set. The version of Python currently in `PATH` will be used.'