From a63db3dbd8db7f62be493f56493c0b2f08f9263c Mon Sep 17 00:00:00 2001 From: Jonas Haag Date: Sun, 6 Feb 2022 23:37:34 +0100 Subject: [PATCH] Remove dependencies to Conda (#45641) --- .pre-commit-config.yaml | 2 +- environment.yml | 10 ++++------ pandas/io/formats/excel.py | 4 +++- pandas/io/json/_json.py | 2 +- pandas/io/pytables.py | 8 ++++---- requirements-dev.txt | 9 ++++----- scripts/tests/test_sync_flake8_versions.py | 6 +++--- setup.cfg | 6 +++++- 8 files changed, 25 insertions(+), 22 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4492f9c20cd0a..6f91c885bf1e8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -50,7 +50,7 @@ repos: - flake8==4.0.1 - flake8-comprehensions==3.7.0 - flake8-bugbear==21.3.2 - - pandas-dev-flaker==0.2.0 + - pandas-dev-flaker==0.4.0 - repo: https://github.com/PyCQA/isort rev: 5.10.1 hooks: diff --git a/environment.yml b/environment.yml index 51350a143b913..66df6a4ac05e6 100644 --- a/environment.yml +++ b/environment.yml @@ -32,10 +32,12 @@ dependencies: # documentation - gitpython # obtain contributors from git for whatsnew - gitdb - - sphinx - - sphinx-panels - numpydoc < 1.2 # 2021-02-09 1.2dev breaking CI + - pandas-dev-flaker=0.4.0 - pydata-sphinx-theme + - pytest-cython + - sphinx + - sphinx-panels - types-python-dateutil - types-PyMySQL - types-pytz @@ -78,7 +80,6 @@ dependencies: - ipywidgets - nbformat - notebook>=6.0.3 - - pip # optional - blosc @@ -120,6 +121,3 @@ dependencies: - pyreadstat # pandas.read_spss - tabulate>=0.8.3 # DataFrame.to_markdown - natsort # DataFrame.sort_values - - pip: - - pandas-dev-flaker==0.2.0 - - pytest-cython diff --git a/pandas/io/formats/excel.py b/pandas/io/formats/excel.py index 2aa67746c16d7..81076ef11e727 100644 --- a/pandas/io/formats/excel.py +++ b/pandas/io/formats/excel.py @@ -85,7 +85,9 @@ def __init__( **kwargs, ): if css_styles and css_converter: - css = ";".join(a + ":" + str(v) for (a, v) in css_styles[css_row, css_col]) + css = ";".join( + [a + ":" + str(v) for (a, v) in css_styles[css_row, css_col]] + ) style = css_converter(css) return super().__init__(row=row, col=col, val=val, style=style, **kwargs) diff --git a/pandas/io/json/_json.py b/pandas/io/json/_json.py index 9d4998784222f..910ba63b5bb3a 100644 --- a/pandas/io/json/_json.py +++ b/pandas/io/json/_json.py @@ -724,7 +724,7 @@ def _combine_lines(self, lines) -> str: Combines a list of JSON objects into one JSON object. """ return ( - f'[{",".join((line for line in (line.strip() for line in lines) if line))}]' + f'[{",".join([line for line in (line.strip() for line in lines) if line])}]' ) def read(self): diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index cfcdde40549b9..53b5079ed6be9 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -2040,10 +2040,10 @@ def __repr__(self) -> str: map(pprint_thing, (self.name, self.cname, self.axis, self.pos, self.kind)) ) return ",".join( - ( + [ f"{key}->{value}" for key, value in zip(["name", "cname", "axis", "pos", "kind"], temp) - ) + ] ) def __eq__(self, other: Any) -> bool: @@ -2341,10 +2341,10 @@ def __repr__(self) -> str: ) ) return ",".join( - ( + [ f"{key}->{value}" for key, value in zip(["name", "cname", "dtype", "kind", "shape"], temp) - ) + ] ) def __eq__(self, other: Any) -> bool: diff --git a/requirements-dev.txt b/requirements-dev.txt index 04ae7f6a97b16..729f44b4696ab 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -18,10 +18,12 @@ pycodestyle pyupgrade gitpython gitdb -sphinx -sphinx-panels numpydoc < 1.2 +pandas-dev-flaker==0.4.0 pydata-sphinx-theme +pytest-cython +sphinx +sphinx-panels types-python-dateutil types-PyMySQL types-pytz @@ -52,7 +54,6 @@ statsmodels ipywidgets nbformat notebook>=6.0.3 -pip blosc bottleneck>=1.3.1 ipykernel @@ -84,6 +85,4 @@ cftime pyreadstat tabulate>=0.8.3 natsort -pandas-dev-flaker==0.2.0 -pytest-cython setuptools>=51.0.0 diff --git a/scripts/tests/test_sync_flake8_versions.py b/scripts/tests/test_sync_flake8_versions.py index 21c3b743830ee..cd8d18f7e41cc 100644 --- a/scripts/tests/test_sync_flake8_versions.py +++ b/scripts/tests/test_sync_flake8_versions.py @@ -87,7 +87,7 @@ def test_get_revisions_no_failure(capsys): { "id": "flake8", "additional_dependencies": [ - "pandas-dev-flaker==0.2.0", + "pandas-dev-flaker==0.4.0", "flake8-bugs==1.1.1", ], } @@ -101,7 +101,7 @@ def test_get_revisions_no_failure(capsys): "id": "yesqa", "additional_dependencies": [ "flake8==0.1.1", - "pandas-dev-flaker==0.2.0", + "pandas-dev-flaker==0.4.0", "flake8-bugs==1.1.1", ], } @@ -116,7 +116,7 @@ def test_get_revisions_no_failure(capsys): { "pip": [ "git+https://github.com/pydata/pydata-sphinx-theme.git@master", - "pandas-dev-flaker==0.2.0", + "pandas-dev-flaker==0.4.0", ] }, ] diff --git a/setup.cfg b/setup.cfg index 9deebb835eff7..27a5c51d2f2aa 100644 --- a/setup.cfg +++ b/setup.cfg @@ -103,7 +103,11 @@ ignore = # tests use comparisons but not their returned value B015, # false positives - B301 + B301, + # single-letter variables + PDF023 + # "use 'pandas._testing' instead" in non-test code + PDF025 exclude = doc/sphinxext/*.py, doc/build/*.py,