Code Monkey home page Code Monkey logo

setup-pipx's Introduction

setup-pipx

🍰 this project is deprecated. Just do this instead:

on: [push]

jobs:
  example:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v4
        id: cpython_setup
        with:
          python-version: "3.10"
      - run: pipx install poetry --python '${{ steps.cpython_setup.outputs.python-path }}'
      - run: poetry install

Original README below:


Pipx setup for GitHub Actions.

Quickstart example

on: [push]

jobs:
  example:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
        with:
          python-version: "3.10"
      - uses: fredrikaverpil/[email protected]
        with:
          pipx-version: "1.1.0"
      - run: pipx install <package>

Features

  • You decide the Python and pipx versions used.
  • Pipx will be installed in an isolated virtual environment, in .venv_pipx. You may want to add this to your .gitignore so to avoid a dirty git branch during CI execution.
  • Can be used in conjunction with actions/cache
  • Support for linux, macOS and windows runners

Inputs

Inputs Description Required Default
pipx-version Pipx Version false N/A
venv-name Name of pipx virtual environment false .venv_pipx

Advanced usage

Matrix with caching and poetry

on: [push]

jobs:
  example:
    strategy:
      fail-fast: false
      matrix:
        python-version: ["3.7", "3.8", "3.9", "3.10"]
        pipx-version: ["1.1.0"]
        poetry-version: ["1.1.13"]
        os: [ubuntu-latest, windows-latest, macos-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}
      - uses: fredrikaverpil/[email protected]
        with:
          pipx-version: ${{ matrix.pipx-version }}
      - uses: actions/cache@v2
        id: cache
        with:
          path: |
            ~/.cache/pip
            ~/.cache/pypoetry/virtualenvs
            .venv_pipx
          key: ${{ runner.os }}-${{ runner.arch }}-py-${{ matrix.python-version }}-pipx-${{ matrix.pipx-version }}-poetry-${{ matrix.poetry-version }}-${{ hashFiles('poetry.lock') }}

      - run: pipx install poetry==${{ matrix.poetry-version }}
      - run: poetry install
      - run: poetry show --outdated

setup-pipx's People

Contributors

fredrikaverpil avatar

Stargazers

Roman avatar Reed Rosenberg avatar Rasmus Bergström avatar

Watchers

James Cloos avatar  avatar  avatar

setup-pipx's Issues

Pipx and caching

If caching is enabled, like in the advanced example, the ../pipx_venv should not be created. Only the $PATH should be updated, so the pipx-installed binaries can be found.

Or, more likely, might want this order instead:

      - uses: fredrikaverpil/[email protected]
        with:
          pipx-version: "1.0"

      - uses: actions/cache@v2
        id: cache
        with:
          path: |
            ~/.cache/pip
            ~/.cache/pypoetry/virtualenvs
            ../pipx_venv
            ~/.local/bin
            ~/.local/Scripts
          key: ${{ runner.os }}-py-${{ matrix.python-version }}-pipx-${{ matrix.pipx-version }}-poetry-${{ matrix.poetry-version }}-${{ hashFiles('poetry.lock') }}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.