From c5497346bee2932386cd2646b16a5f7aa4218bf4 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Fri, 21 Jul 2023 11:51:56 -0700 Subject: [PATCH 1/4] CI: Try out pre-commit.ci again --- .../autoupdate-pre-commit-config.yml | 39 ------------------- .github/workflows/code-checks.yml | 22 +---------- .pre-commit-config.yaml | 8 ++-- 3 files changed, 6 insertions(+), 63 deletions(-) delete mode 100644 .github/workflows/autoupdate-pre-commit-config.yml diff --git a/.github/workflows/autoupdate-pre-commit-config.yml b/.github/workflows/autoupdate-pre-commit-config.yml deleted file mode 100644 index 376aa8343c571..0000000000000 --- a/.github/workflows/autoupdate-pre-commit-config.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: "Update pre-commit config" - -on: - schedule: - - cron: "0 7 1 * *" # At 07:00 on 1st of every month. - workflow_dispatch: - -permissions: - contents: read - -jobs: - update-pre-commit: - permissions: - contents: write # for technote-space/create-pr-action to push code - pull-requests: write # for technote-space/create-pr-action to create a PR - if: github.repository_owner == 'pandas-dev' - name: Autoupdate pre-commit config - runs-on: ubuntu-22.04 - steps: - - name: Set up Python - uses: actions/setup-python@v4 - - name: Cache multiple paths - uses: actions/cache@v3 - with: - path: | - ~/.cache/pre-commit - ~/.cache/pip - key: pre-commit-autoupdate-${{ runner.os }}-build - - name: Update pre-commit config packages - uses: technote-space/create-pr-action@v2 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - EXECUTE_COMMANDS: | - pip install pre-commit - pre-commit autoupdate || (exit 0); - pre-commit run -a || (exit 0); - COMMIT_MESSAGE: "⬆️ UPGRADE: Autoupdate pre-commit config" - PR_BRANCH_NAME: "pre-commit-config-update-${PR_ID}" - PR_TITLE: "⬆️ UPGRADE: Autoupdate pre-commit config" diff --git a/.github/workflows/code-checks.yml b/.github/workflows/code-checks.yml index f6c35decfd30b..0954bf7d9231c 100644 --- a/.github/workflows/code-checks.yml +++ b/.github/workflows/code-checks.yml @@ -17,28 +17,8 @@ env: permissions: contents: read +# pre-commit run by https://pre-commit.ci/ jobs: - pre_commit: - name: pre-commit - runs-on: ubuntu-22.04 - concurrency: - # https://github.community/t/concurrecy-not-work-for-push/183068/7 - group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-pre-commit - cancel-in-progress: true - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install Python - uses: actions/setup-python@v4 - with: - python-version: '3.9' - - - name: Run pre-commit - uses: pre-commit/action@v3.0.0 - with: - extra_args: --verbose --all-files - docstring_typing_manual_hooks: name: Docstring validation, typing, and other manual pre-commit hooks runs-on: ubuntu-22.04 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 366db4337b0e1..d60929f18416f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,9 @@ default_stages: [ post-rewrite ] ci: - autofix_prs: false + autoupdate_schedule: monthly + # manual stage hooks + skip: [pylint, pyright, mypy, autotyping] repos: - repo: https://github.com/hauntsaninja/black-pre-commit-mirror # black compiled with mypyc @@ -131,7 +133,7 @@ repos: stages: [manual] additional_dependencies: &pyright_dependencies - pyright@1.1.296 - - id: pyright_reportGeneralTypeIssues + - id: pyright # note: assumes python env is setup and activated name: pyright reportGeneralTypeIssues entry: pyright --skipunannotated -p pyright_reportGeneralTypeIssues.json --level warning @@ -148,7 +150,7 @@ repos: pass_filenames: false types: [python] stages: [manual] - - id: stubtest + - id: mypy # note: assumes python env is setup and activated # note: requires pandas dev to be installed name: mypy (stubtest) From db0bb8c6619b143820b87c167c7f85ddd5b9a9e3 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Thu, 27 Jul 2023 09:36:01 -0700 Subject: [PATCH 2/4] Test CI autofix --- pandas/compat/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/compat/__init__.py b/pandas/compat/__init__.py index 434517474d8bd..76c51bcd03fb3 100644 --- a/pandas/compat/__init__.py +++ b/pandas/compat/__init__.py @@ -120,7 +120,7 @@ def is_platform_power() -> bool: return platform.machine() in ("ppc64", "ppc64le") -def is_ci_environment() -> bool: +def is_ci_environment() -> bool: """ Checking if running in a continuous integration environment by checking the PANDAS_CI environment variable. From 33b79e4016740c96c475c3cc695317922f8df130 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 27 Jul 2023 16:38:55 +0000 Subject: [PATCH 3/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pandas/compat/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/compat/__init__.py b/pandas/compat/__init__.py index 76c51bcd03fb3..434517474d8bd 100644 --- a/pandas/compat/__init__.py +++ b/pandas/compat/__init__.py @@ -120,7 +120,7 @@ def is_platform_power() -> bool: return platform.machine() in ("ppc64", "ppc64le") -def is_ci_environment() -> bool: +def is_ci_environment() -> bool: """ Checking if running in a continuous integration environment by checking the PANDAS_CI environment variable. From ecd67d37511851529cf65b6fcb46b84d3b6f492c Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Thu, 27 Jul 2023 13:26:15 -0700 Subject: [PATCH 4/4] turn autofix off --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d60929f18416f..e19a74e8a462e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,6 +13,7 @@ default_stages: [ post-rewrite ] ci: + autofix_prs: false autoupdate_schedule: monthly # manual stage hooks skip: [pylint, pyright, mypy, autotyping]