From a9f06edc48a050c54aff8583c8a67bbcfb75474c Mon Sep 17 00:00:00 2001 From: Stijn Van Hoey Date: Fri, 16 Aug 2024 10:59:40 +0200 Subject: [PATCH] Update and run pre-commit hooks --- .pre-commit-config.yaml | 7 +++---- setup.py | 1 + src/pywaterinfo/waterinfo.py | 3 ++- tests/test_waterinfo.py | 13 +++++++------ 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 32f96a6..dc6e0bd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,13 +2,12 @@ exclude: '^docs/conf.py' repos: - repo: https://github.com/psf/black - rev: 23.1.0 + rev: 24.8.0 hooks: - id: black - language_version: python3.9 - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.6.0 hooks: - id: trailing-whitespace - id: check-added-large-files @@ -24,7 +23,7 @@ repos: args: ['--fix=no'] - repo: https://github.com/pycqa/flake8 - rev: 6.0.0 + rev: 7.1.1 hooks: - id: flake8 args: ['--max-line-length=88'] # default of Black diff --git a/setup.py b/setup.py index 363a32e..53fbbbb 100644 --- a/setup.py +++ b/setup.py @@ -6,6 +6,7 @@ PyScaffold helps you to put up the scaffold of your new Python project. Learn more under: https://pyscaffold.org/ """ + from setuptools import setup if __name__ == "__main__": diff --git a/src/pywaterinfo/waterinfo.py b/src/pywaterinfo/waterinfo.py index 14e7d94..b6d1c78 100755 --- a/src/pywaterinfo/waterinfo.py +++ b/src/pywaterinfo/waterinfo.py @@ -633,7 +633,8 @@ def get_timeseries_values( if "Timestamp" in df.columns: # round trip via UTC to handle mixed time series df["Timestamp"] = pd.to_datetime( - df["Timestamp"], utc=True).dt.tz_convert(timezone) + df["Timestamp"], utc=True + ).dt.tz_convert(timezone) time_series.append(df) return pd.concat(time_series) diff --git a/tests/test_waterinfo.py b/tests/test_waterinfo.py index db77320..3e96b41 100755 --- a/tests/test_waterinfo.py +++ b/tests/test_waterinfo.py @@ -362,12 +362,13 @@ def test_timezone_mixed_timezone(self, connection, request): See also https://github.com/fluves/pywaterinfo/issues/67 """ connection = request.getfixturevalue(connection) - df = connection.get_timeseries_values('69928042', - start='2013-03-21 00:00:00', - end='2013-04-01 23:00:00', - timezone='CET', - returnfields="Timestamp,Value" - ) + df = connection.get_timeseries_values( + "69928042", + start="2013-03-21 00:00:00", + end="2013-04-01 23:00:00", + timezone="CET", + returnfields="Timestamp,Value", + ) assert isinstance(df["Timestamp"].dtype, pd.DatetimeTZDtype) assert df["Timestamp"].dt.tz == pytz.timezone("CET")