Skip to content

Commit

Permalink
⬆️ Update dependency ruff to v0.2.0 (#570)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
  • Loading branch information
renovate[bot] and frenck authored Feb 4, 2024
1 parent 455df62 commit 9fc6f8d
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 27 deletions.
2 changes: 1 addition & 1 deletion examples/ruff.toml
Original file line number Diff line number Diff line change
@@ -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
]
38 changes: 19 additions & 19 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -128,7 +128,7 @@ max-line-length=88
addopts = "--cov"
asyncio_mode = "auto"

[tool.ruff]
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"ANN101", # Self... explanatory
Expand All @@ -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]
Expand Down
1 change: 1 addition & 0 deletions src/pvo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def reported_datetime(self) -> datetime:
Returns
-------
A datetime object.
"""
return datetime.combine(
self.reported_date,
Expand Down
5 changes: 5 additions & 0 deletions src/pvo/pvoutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -109,6 +110,7 @@ async def status(self) -> Status:
Returns
-------
An PVOutput Status object.
"""
data = await self._request("getstatus.jsp")
return Status.from_dict(
Expand Down Expand Up @@ -137,6 +139,7 @@ async def system(self) -> System:
Returns
-------
An PVOutput System object.
"""
data = await self._request("getsystem.jsp")
return System.from_dict(
Expand Down Expand Up @@ -177,6 +180,7 @@ async def __aenter__(self) -> Self:
Returns
-------
The PVOutput object.
"""
return self

Expand All @@ -186,5 +190,6 @@ async def __aexit__(self, *_exc_info: object) -> None:
Args:
----
_exc_info: Exec type.
"""
await self.close()
4 changes: 2 additions & 2 deletions tests/ruff.toml
Original file line number Diff line number Diff line change
@@ -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...
Expand Down

0 comments on commit 9fc6f8d

Please sign in to comment.