Giter Site home page Giter Site logo

action-python's Introduction

action-python

Test reviewdog depup release GitHub release (latest SemVer) action-bumpr supported

This repo contains a action to run various Python tools including:

Input

inputs:
  black:
    description: |
      Run Black
      Default is false.
    default: false
  bandit:
    description: |
      Run Bandit
      Default is false.
    default: false
  pylint:
    description: |
      Run Pylint
      Default is false.
    default: false
  pyright:
    description: |
      Run Pyright
      Default is false.
    default: false
  flake8:
    description: |
      Run Flake8
      Default is false.
    default: false
  testing:
    description: |
      Run tests with PyTest
      Default is false.
    default: false
  publish:
    description: |
      Publish to PyPi
      Default is false
    default: false
  publish_url:
    description: |
      PyPi Target. Use this to point to private or test locations.      
      Default https://pypi.org
    defualt: 'https://pypi.org'
  github_token:
    description: 'GITHUB_TOKEN'
    default: '${{ github.token }}'
  workdir:
    description: 'Working directory relative to the root directory.'
    default: 'src'
  ### Flags for reviewdog ###
  level:
    description: 'Report level for reviewdog [info,warning,error]'
    default: 'error'
  reporter:
    description: 'Reporter of reviewdog command [github-pr-check,github-pr-review].'
    default: 'github-pr-check'
  filter_mode:
    description: |
      Filtering mode for the reviewdog command [added,diff_context,file,nofilter].
      Default is added.
    default: 'added'
  fail_on_error:
    description: |
      Exit code for reviewdog when errors are found [true,false]
      Default is `false`.
    default: 'false'
  reviewdog_flags:
    description: 'Additional reviewdog flags'
    default: ''
  toml:
    description: |
      pyproject.toml location.
      Default pyproject.toml
    default: 'pyproject.toml'
  pylint_rc:
    description: '.pylintrc configuration file'
    default: '.pylintrc'

Usage

name: Pull Request
on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  workflow_dispatch:

jobs:
  linting:
    runs-on: ubuntu-latest
    steps:
      - name: Black
        uses: microsoft/[email protected]
        with:
          black: true

      - name: Bandit
        uses: microsoft/[email protected]
        with:          
          bandit: true

      - name: Pylint
        uses: microsoft/[email protected]
        with:
          pylint: true
          
      - name: Pyright
        uses: microsoft/[email protected]
        with:          
          pyright: true
          
      - name: Flake8
        uses: microsoft/[email protected]
        with:          
          flake8: true

  testing:
    runs-on: ubuntu-latest
    steps:    
      - name: Pytest
        uses: microsoft/[email protected]
        with:          
          testing: true

Development

Release

You can bump version on merging Pull Requests with specific labels (bump:major,bump:minor,bump:patch). Pushing tag manually by yourself also work.

This action updates major/minor release tags on a tag push. e.g. Update v1 and v1.2 tag when released v1.2.3. ref: https://help.github.com/en/articles/about-actions#versioning-your-action

action-python's People

Contributors

dciborow avatar dependabot[bot] avatar microsoft-github-policy-service[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

action-python's Issues

Use estimated retry time from error message

When we get rate limited the API tells us how long to wait,

INFO:openai:error_code=429 error_message='Requests to the Creates a completion for the chat message Operation under Azure OpenAI API version 2023-03-15-preview have exceeded call rate limit of your current OpenAI S0 pricing tier. Please retry after 3 seconds. Please go here: https://aka.ms/oai/quotaincrease if you would like to further increase the default rate limit.' error_param=None error_type=None message='OpenAI API error received' stream_error=False
WARNING:root:Call to GPT failed due to rate limit, retry attempt: 1

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.