From 0bf05d367ef0ef1824d74eb60e00737a81a10433 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 4 Feb 2024 03:25:55 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Update=20dependency=20?= =?UTF-8?q?ruff=20to=20v0.2.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- poetry.lock | 38 +++++++++++++++++++------------------- pyproject.toml | 2 +- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/poetry.lock b/poetry.lock index faf7936c..80ecd580 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1467,28 +1467,28 @@ files = [ [[package]] name = "ruff" -version = "0.1.14" +version = "0.2.0" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.1.14-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:96f76536df9b26622755c12ed8680f159817be2f725c17ed9305b472a757cdbb"}, - {file = "ruff-0.1.14-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:ab3f71f64498c7241123bb5a768544cf42821d2a537f894b22457a543d3ca7a9"}, - {file = "ruff-0.1.14-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7060156ecc572b8f984fd20fd8b0fcb692dd5d837b7606e968334ab7ff0090ab"}, - {file = "ruff-0.1.14-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a53d8e35313d7b67eb3db15a66c08434809107659226a90dcd7acb2afa55faea"}, - {file = "ruff-0.1.14-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bea9be712b8f5b4ebed40e1949379cfb2a7d907f42921cf9ab3aae07e6fba9eb"}, - {file = "ruff-0.1.14-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:2270504d629a0b064247983cbc495bed277f372fb9eaba41e5cf51f7ba705a6a"}, - {file = "ruff-0.1.14-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:80258bb3b8909b1700610dfabef7876423eed1bc930fe177c71c414921898efa"}, - {file = "ruff-0.1.14-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:653230dd00aaf449eb5ff25d10a6e03bc3006813e2cb99799e568f55482e5cae"}, - {file = "ruff-0.1.14-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:87b3acc6c4e6928459ba9eb7459dd4f0c4bf266a053c863d72a44c33246bfdbf"}, - {file = "ruff-0.1.14-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:6b3dadc9522d0eccc060699a9816e8127b27addbb4697fc0c08611e4e6aeb8b5"}, - {file = "ruff-0.1.14-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:1c8eca1a47b4150dc0fbec7fe68fc91c695aed798532a18dbb1424e61e9b721f"}, - {file = "ruff-0.1.14-py3-none-musllinux_1_2_i686.whl", hash = "sha256:62ce2ae46303ee896fc6811f63d6dabf8d9c389da0f3e3f2bce8bc7f15ef5488"}, - {file = "ruff-0.1.14-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:b2027dde79d217b211d725fc833e8965dc90a16d0d3213f1298f97465956661b"}, - {file = "ruff-0.1.14-py3-none-win32.whl", hash = "sha256:722bafc299145575a63bbd6b5069cb643eaa62546a5b6398f82b3e4403329cab"}, - {file = "ruff-0.1.14-py3-none-win_amd64.whl", hash = "sha256:e3d241aa61f92b0805a7082bd89a9990826448e4d0398f0e2bc8f05c75c63d99"}, - {file = "ruff-0.1.14-py3-none-win_arm64.whl", hash = "sha256:269302b31ade4cde6cf6f9dd58ea593773a37ed3f7b97e793c8594b262466b67"}, - {file = "ruff-0.1.14.tar.gz", hash = "sha256:ad3f8088b2dfd884820289a06ab718cde7d38b94972212cc4ba90d5fbc9955f3"}, + {file = "ruff-0.2.0-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:638ea3294f800d18bae84a492cb5a245c8d29c90d19a91d8e338937a4c27fca0"}, + {file = "ruff-0.2.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:3ff35433fcf4dff6d610738712152df6b7d92351a1bde8e00bd405b08b3d5759"}, + {file = "ruff-0.2.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bf9faafbdcf4f53917019f2c230766da437d4fd5caecd12ddb68bb6a17d74399"}, + {file = "ruff-0.2.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8153a3e4128ed770871c47545f1ae7b055023e0c222ff72a759f5a341ee06483"}, + {file = "ruff-0.2.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e8a75a98ae989a27090e9c51f763990ad5bbc92d20626d54e9701c7fe597f399"}, + {file = "ruff-0.2.0-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:87057dd2fdde297130ff99553be8549ca38a2965871462a97394c22ed2dfc19d"}, + {file = "ruff-0.2.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6d232f99d3ab00094ebaf88e0fb7a8ccacaa54cc7fa3b8993d9627a11e6aed7a"}, + {file = "ruff-0.2.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3d3c641f95f435fc6754b05591774a17df41648f0daf3de0d75ad3d9f099ab92"}, + {file = "ruff-0.2.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3826fb34c144ef1e171b323ed6ae9146ab76d109960addca730756dc19dc7b22"}, + {file = "ruff-0.2.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:eceab7d85d09321b4de18b62d38710cf296cb49e98979960a59c6b9307c18cfe"}, + {file = "ruff-0.2.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:30ad74687e1f4a9ff8e513b20b82ccadb6bd796fe5697f1e417189c5cde6be3e"}, + {file = "ruff-0.2.0-py3-none-musllinux_1_2_i686.whl", hash = "sha256:a7e3818698f8460bd0f8d4322bbe99db8327e9bc2c93c789d3159f5b335f47da"}, + {file = "ruff-0.2.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:edf23041242c48b0d8295214783ef543847ef29e8226d9f69bf96592dba82a83"}, + {file = "ruff-0.2.0-py3-none-win32.whl", hash = "sha256:e155147199c2714ff52385b760fe242bb99ea64b240a9ffbd6a5918eb1268843"}, + {file = "ruff-0.2.0-py3-none-win_amd64.whl", hash = "sha256:ba918e01cdd21e81b07555564f40d307b0caafa9a7a65742e98ff244f5035c59"}, + {file = "ruff-0.2.0-py3-none-win_arm64.whl", hash = "sha256:3fbaff1ba9564a2c5943f8f38bc221f04bac687cc7485e45237579fee7ccda79"}, + {file = "ruff-0.2.0.tar.gz", hash = "sha256:63856b91837606c673537d2889989733d7dffde553828d3b0f0bacfa6def54be"}, ] [[package]] @@ -1775,4 +1775,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "8fe9f2eb0dc28b73fed2636f32ba98f24d16a6b73165e15a045c3b86f6443737" +content-hash = "9f78da5e8cc0a6a61ef0ce3c039c1e38701463fc8af057b252ac02c17bd2dcb8" diff --git a/pyproject.toml b/pyproject.toml index 2cb5c04a..9195a7de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,7 +46,7 @@ pylint = "3.0.3" pytest = "7.4.4" pytest-asyncio = "0.23.4" pytest-cov = "4.1.0" -ruff = "0.1.14" +ruff = "0.2.0" safety = "3.0.1" syrupy = "4.6.0" yamllint = "1.33.0" From b089aa30759c9d237f484765211228dbcb7282ac Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sun, 4 Feb 2024 16:32:26 +0100 Subject: [PATCH 2/2] Migrate config --- examples/ruff.toml | 2 +- pyproject.toml | 8 ++++---- src/pvo/models.py | 1 + src/pvo/pvoutput.py | 5 +++++ tests/ruff.toml | 4 ++-- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/examples/ruff.toml b/examples/ruff.toml index 2eb42d98..8caec9e5 100644 --- a/examples/ruff.toml +++ b/examples/ruff.toml @@ -1,6 +1,6 @@ # This extend our general Ruff rules specifically for the examples extend = "../pyproject.toml" -extend-ignore = [ +lint.extend-ignore = [ "T201", # Allow the use of print() in examples ] diff --git a/pyproject.toml b/pyproject.toml index 9195a7de..56b039c2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -128,7 +128,7 @@ max-line-length=88 addopts = "--cov" asyncio_mode = "auto" -[tool.ruff] +[tool.ruff.lint] select = ["ALL"] ignore = [ "ANN101", # Self... explanatory @@ -144,17 +144,17 @@ ignore = [ "ISC001", ] -[tool.ruff.flake8-pytest-style] +[tool.ruff.lint.flake8-pytest-style] mark-parentheses = false fixture-parentheses = false -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["pvo"] [tool.ruff.lint.flake8-type-checking] runtime-evaluated-base-classes = ["mashumaro.mixins.orjson.DataClassORJSONMixin"] -[tool.ruff.mccabe] +[tool.ruff.lint.mccabe] max-complexity = 25 [build-system] diff --git a/src/pvo/models.py b/src/pvo/models.py index 7eea4f3e..8ca6cd2f 100644 --- a/src/pvo/models.py +++ b/src/pvo/models.py @@ -73,6 +73,7 @@ def reported_datetime(self) -> datetime: Returns ------- A datetime object. + """ return datetime.combine( self.reported_date, diff --git a/src/pvo/pvoutput.py b/src/pvo/pvoutput.py index f58f329c..82dc7f1a 100644 --- a/src/pvo/pvoutput.py +++ b/src/pvo/pvoutput.py @@ -61,6 +61,7 @@ async def _request( the PVOutput API. PVOutputError: Received an unexpected response from the PVOutput API. + """ version = metadata.version(__package__) url = URL("https://pvoutput.org/service/r2/").join(URL(uri)) @@ -109,6 +110,7 @@ async def status(self) -> Status: Returns ------- An PVOutput Status object. + """ data = await self._request("getstatus.jsp") return Status.from_dict( @@ -137,6 +139,7 @@ async def system(self) -> System: Returns ------- An PVOutput System object. + """ data = await self._request("getsystem.jsp") return System.from_dict( @@ -177,6 +180,7 @@ async def __aenter__(self) -> Self: Returns ------- The PVOutput object. + """ return self @@ -186,5 +190,6 @@ async def __aexit__(self, *_exc_info: object) -> None: Args: ---- _exc_info: Exec type. + """ await self.close() diff --git a/tests/ruff.toml b/tests/ruff.toml index b346c562..1005d3e1 100644 --- a/tests/ruff.toml +++ b/tests/ruff.toml @@ -1,11 +1,11 @@ # This extend our general Ruff rules specifically for tests extend = "../pyproject.toml" -extend-select = [ +lint.extend-select = [ "PT", # Use @pytest.fixture without parentheses ] -extend-ignore = [ +lint.extend-ignore = [ "S101", # Use of assert detected. As these are tests... "SLF001", # Tests will access private/protected members... "TCH002", # pytest doesn't like this one...