Giter VIP home page Giter VIP 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  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

Bumps [jakebailey/pyright-action](https://github.com/jakebailey/pyright-action) from 1.6.0 to 1.8.1.

Bumps jakebailey/pyright-action from 1.6.0 to 1.8.1.

Release notes

Sourced from jakebailey/pyright-action's releases.

v1.8.1

  • More verbose npm error (ab655b5)

v1.8.0

This release adds a pylance-version option which allows specifying Pylance versions instead of pyright versions.

  • Bump node types, tests cover everything (be76cc4)
  • Bump deps (867d946)
  • Add pylance-version option (#63) (4f86b1c)

v1.7.1

Fixes:

  • Fix skip-unannotated (f0b639c)

Other:

  • Don't watch in release-it (af54139)
  • Update actions/checkout digest to b4ffde6 (#50) (b7a5ff7)
  • Update actions/setup-node action to v4 (#56) (3400d73)
  • dprint config update (6005fd3)
  • Update deps (f9ae0ac)
  • Switch to vitest (34c9e23)
  • Update actions/setup-node digest to 5e21ff4 (#41) (e4696e5)
  • Update actions/checkout action to v4 (#42) (c96123b)

v1.7.0

This version automatically uses Node 20 if present on the runner, rather than Node 16; this should improve performance by using a newer / faster version of Node.

This should bea backwards-compatible change; if a runner is missing Node 20 in the default runner install, Node 16 will continue to be used instead.

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Originally posted by @dependabot in #35

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.