From 1e62077177b9250ef226d039d4286d32cd94db87 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Sun, 25 Jun 2023 10:51:29 -0700 Subject: [PATCH 1/4] CLN: Dependencies --- .pre-commit-config.yaml | 7 +------ environment.yml | 13 ++++--------- pyproject.toml | 2 -- requirements-dev.txt | 7 +------ 4 files changed, 6 insertions(+), 23 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 220465a1d2847..907945177abd2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -74,7 +74,7 @@ repos: --linelength=88, '--filter=-readability/casting,-runtime/int,-build/include_subdir,-readability/fn_size' ] -- repo: https://github.com/pycqa/pylint +- repo: https://github.com/pylint-dev/pylint rev: v3.0.0a6 hooks: - id: pylint @@ -93,11 +93,6 @@ repos: |^pandas/conftest\.py # keep excluded args: [--disable=all, --enable=redefined-outer-name] stages: [manual] - - id: pylint - alias: unspecified-encoding - name: Using open without explicitly specifying an encoding - args: [--disable=all, --enable=unspecified-encoding] - stages: [manual] - repo: https://github.com/PyCQA/isort rev: 5.12.0 hooks: diff --git a/environment.yml b/environment.yml index 6178fe896760f..4d62bbf05a2bd 100644 --- a/environment.yml +++ b/environment.yml @@ -39,7 +39,7 @@ dependencies: - lxml>=4.8.0 - matplotlib>=3.6.1 - numba>=0.55.2 - - numexpr>=2.8.0 # pin for "Run checks on imported code" job + - numexpr>=2.8.0 - openpyxl>=3.0.10 - odfpy>=1.4.1 - py @@ -75,14 +75,9 @@ dependencies: - cxx-compiler # code checks - - black=23.3.0 - - cpplint - - flake8=6.0.0 - - isort>=5.2.1 # check that imports are in the right order - - mypy=1.2 + - flake8=6.0.0 # run in subprocess over docstring examples + - mypy=1.2 # pre-commit uses locally installed mypy - pre-commit>=2.15.0 - - pyupgrade - - ruff=0.0.215 # documentation - gitpython # obtain contributors from git for whatsnew @@ -94,6 +89,7 @@ dependencies: - sphinx - sphinx-design - sphinx-copybutton + - sphinx-toggleprompt - types-python-dateutil - types-PyMySQL - types-pytz @@ -118,6 +114,5 @@ dependencies: - pygments # Code highlighting - pip: - - sphinx-toggleprompt - typing_extensions; python_version<"3.11" - tzdata>=2022.1 diff --git a/pyproject.toml b/pyproject.toml index 0d1bca886a638..35c7bd4c4d29d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -331,7 +331,6 @@ exclude = [ ".eggs/*.py", # vendored files "pandas/util/version/*", - "versioneer.py", # exclude asv benchmark environments from linting "env", ] @@ -445,7 +444,6 @@ disable = [ "super-init-not-called", "try-except-raise", "unnecessary-lambda", - "unspecified-encoding", "unused-argument", "unused-variable", "using-constant-test" diff --git a/requirements-dev.txt b/requirements-dev.txt index 38a2ce7f66aa3..2ac038acc6894 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -52,14 +52,9 @@ seaborn moto flask asv>=0.5.1 -black==23.3.0 -cpplint flake8==6.0.0 -isort>=5.2.1 mypy==1.2 pre-commit>=2.15.0 -pyupgrade -ruff==0.0.215 gitpython gitdb natsort @@ -69,6 +64,7 @@ pytest-cython sphinx sphinx-design sphinx-copybutton +sphinx-toggleprompt types-python-dateutil types-PyMySQL types-pytz @@ -87,6 +83,5 @@ feedparser pyyaml requests pygments -sphinx-toggleprompt typing_extensions; python_version<"3.11" tzdata>=2022.1 From afa0b242d5cec853d4aa11f493d215dfe9dc4c72 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Mon, 26 Jun 2023 11:42:16 -0700 Subject: [PATCH 2/4] Move back togglepromt --- environment.yml | 2 +- requirements-dev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/environment.yml b/environment.yml index 4d62bbf05a2bd..246f2cf8c139a 100644 --- a/environment.yml +++ b/environment.yml @@ -89,7 +89,6 @@ dependencies: - sphinx - sphinx-design - sphinx-copybutton - - sphinx-toggleprompt - types-python-dateutil - types-PyMySQL - types-pytz @@ -114,5 +113,6 @@ dependencies: - pygments # Code highlighting - pip: + - sphinx-toggleprompt # conda-forge version has stricter pins on jinja2 - typing_extensions; python_version<"3.11" - tzdata>=2022.1 diff --git a/requirements-dev.txt b/requirements-dev.txt index 2ac038acc6894..6d38fa03413e0 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -64,7 +64,6 @@ pytest-cython sphinx sphinx-design sphinx-copybutton -sphinx-toggleprompt types-python-dateutil types-PyMySQL types-pytz @@ -83,5 +82,6 @@ feedparser pyyaml requests pygments +sphinx-toggleprompt typing_extensions; python_version<"3.11" tzdata>=2022.1 From 0d7da166bbc16314bc463730113d602789784aa1 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Tue, 27 Jun 2023 18:58:20 -0700 Subject: [PATCH 3/4] Add tokenize-rt --- environment.yml | 1 + requirements-dev.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/environment.yml b/environment.yml index d91cf1bc67fb1..707cb6d498b40 100644 --- a/environment.yml +++ b/environment.yml @@ -78,6 +78,7 @@ dependencies: # code checks - flake8=6.0.0 # run in subprocess over docstring examples - mypy=1.2 # pre-commit uses locally installed mypy + - tokenize-rt # scripts/check_for_inconsistent_pandas_namespace.py - pre-commit>=2.15.0 # documentation diff --git a/requirements-dev.txt b/requirements-dev.txt index 8e30d56612015..260ed264495a2 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -55,6 +55,7 @@ flask asv>=0.5.1 flake8==6.0.0 mypy==1.2 +tokenize-rt pre-commit>=2.15.0 gitpython gitdb From 45b4d08fd9cb043f16aa9a8942ca7f8d11662df3 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Thu, 29 Jun 2023 13:06:58 -0700 Subject: [PATCH 4/4] Use hauntsaninja/black-pre-commit-mirror --- .pre-commit-config.yaml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d384e2f1a9c57..c9cd7528bcd2f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,18 +15,11 @@ default_stages: [ ci: autofix_prs: false repos: -- repo: local +- repo: https://github.com/hauntsaninja/black-pre-commit-mirror + # black compiled with mypyc + rev: 23.3.0 hooks: - # NOTE: we make `black` a local hook because if it's installed from - # PyPI (rather than from source) then it'll run twice as fast thanks to mypyc - - id: black - name: black - description: "Black: The uncompromising Python code formatter" - entry: black - language: python - require_serial: true - types_or: [python, pyi] - additional_dependencies: [black==23.3.0] + - id: black - repo: https://github.com/charliermarsh/ruff-pre-commit rev: v0.0.270 hooks: